1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Webino™ (http://webino.sk) |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/webino for the canonical source repository |
6
|
|
|
* @copyright Copyright (c) 2015-2017 Webino, s.r.o. (http://webino.sk) |
7
|
|
|
* @author Peter Bačinský <[email protected]> |
8
|
|
|
* @license BSD-3-Clause |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
use Webino\Version; |
12
|
|
|
use WebinoAppLib\Application\CoreConfig; |
13
|
|
|
use WebinoAppLib\Factory; |
14
|
|
|
use WebinoAppLib\Options\DebuggerOptions; |
15
|
|
|
use WebinoAppLib\Service\Debugger; |
16
|
|
|
use WebinoAppLib\Service\DebuggerInterface; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Class Webino |
20
|
|
|
*/ |
21
|
|
|
class Webino |
|
|
|
|
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* Webino™ version |
25
|
|
|
*/ |
26
|
|
|
const VERSION = Version::VERSION; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Create application core config |
30
|
|
|
* |
31
|
|
|
* @param array $config |
32
|
|
|
* @return CoreConfig |
33
|
|
|
*/ |
34
|
|
|
public static function config(array $config) |
35
|
|
|
{ |
36
|
|
|
return new CoreConfig($config); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Create Webino application |
41
|
|
|
* |
42
|
|
|
* @param array|object $config |
43
|
|
|
* @param DebuggerInterface $debugger |
44
|
|
|
* @return \WebinoAppLib\Application\AbstractBaseApplication |
45
|
|
|
*/ |
46
|
|
|
public static function application($config = null, DebuggerInterface $debugger = null) |
47
|
|
|
{ |
48
|
|
|
return (new Factory)->create($config, $debugger); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Create application debugger |
53
|
|
|
* |
54
|
|
|
* @param array|DebuggerOptions $options |
55
|
|
|
* @return Debugger |
56
|
|
|
*/ |
57
|
|
|
public static function debugger($options = []) |
58
|
|
|
{ |
59
|
|
|
return new Debugger($options); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Create application debugger options |
64
|
|
|
* |
65
|
|
|
* @return DebuggerOptions |
66
|
|
|
*/ |
67
|
|
|
public static function debuggerOptions() |
68
|
|
|
{ |
69
|
|
|
return new DebuggerOptions; |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.