1 | <?php |
||
22 | class App { |
||
23 | |||
24 | /** |
||
25 | * Flag if Carbon Fields has been booted |
||
26 | * |
||
27 | * @var bool |
||
28 | */ |
||
29 | public $booted = false; |
||
30 | |||
31 | /** |
||
32 | * Inversion of Control container instance |
||
33 | * |
||
34 | * @var PimpleContainer |
||
35 | */ |
||
36 | protected $ioc = null; |
||
37 | |||
38 | /** |
||
39 | * Singleton implementation |
||
40 | * |
||
41 | * @return App |
||
42 | */ |
||
43 | public static function instance() { |
||
50 | |||
51 | /** |
||
52 | * Get default IoC container dependencies |
||
53 | * |
||
54 | * @return PimpleContainer |
||
55 | */ |
||
56 | protected static function get_default_ioc() { |
||
103 | |||
104 | /** |
||
105 | * Resolve a dependency through IoC |
||
106 | * |
||
107 | * @param string $key |
||
108 | * @return mixed |
||
109 | */ |
||
110 | public static function resolve( $key ) { |
||
113 | |||
114 | /** |
||
115 | * Resolve a service through IoC |
||
116 | * |
||
117 | * @param string $service_name |
||
118 | * @return mixed |
||
119 | */ |
||
120 | public static function service( $service_name ) { |
||
123 | |||
124 | /** |
||
125 | * Replace the ioc container for the App |
||
126 | * |
||
127 | * @param PimpleContainer $ioc |
||
128 | */ |
||
129 | public function install( PimpleContainer $ioc ) { |
||
132 | |||
133 | /** |
||
134 | * Boot Carbon Fields with default IoC dependencies |
||
135 | */ |
||
136 | public static function boot() { |
||
149 | |||
150 | /** |
||
151 | * Check if Carbon Fields has booted |
||
152 | */ |
||
153 | public static function is_booted() { |
||
156 | |||
157 | /** |
||
158 | * Throw exception if Carbon Fields has not been booted |
||
159 | */ |
||
160 | public static function verify_boot() { |
||
165 | } |