-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitialize.php
More file actions
53 lines (48 loc) · 1.56 KB
/
Copy pathInitialize.php
File metadata and controls
53 lines (48 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* Genial Framework.
*
* @author Nicholas English <https://github.com/Nenglish7>
* @author Genial Contributors <https://github.com/orgs/Genial-Framework/people>
*
* @link <https://github.com/Genial-Framework/Debug> for the canonical source repository.
* @copyright Copyright (c) 2017-2018 Genial Framework. <https://github.com/Genial-Framework>
* @license <https://github.com/Genial-Framework/Debug/blob/master/LICENSE> New BSD License.
*/
namespace Genial\Debug;
/**
* Initialize.
*/
class Initialize implements InitializeInterface
{
/**
* @var int|null $errorReporting The error reporting level the framework should run under.
*/
protected static $errorReporting;
/**
* __construct().
*
* Initalize the debug dependent.
*
* @param mixed|null $errorReporting The error reporting level the framework should run under.
* @param bool|null $logging Should logging be enabled during execution.
*
* @return bool|true If the debug dependent was successfully initialized.
*/
function __construct($errorReporting = null, bool $logging = null)
{
$errorReporting = !is_null($errorReporting)
? $errorReporting
: 0;
$logging = !is_null($logging)
? $logging
: env('application', 'log', true);
if ($logging && LOGGING_TOOLS_ACTIVE)
{
\Genial\Log\Log::enable();
}
Debug::enable($errorReporting);
self::$errorReporting = $errorReporting;
return true;
}
}