| Conditions | 5 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public static function init(string $section) { |
||
| 19 | |||
| 20 | static::$loader = new static::$loader_class($section, false); |
||
| 21 | |||
| 22 | # Throw error if no extensions found |
||
| 23 | |||
| 24 | if (false === static::$loader->active()) throw new static::$exception_class; |
||
| 25 | |||
| 26 | # Activate user defined extension |
||
| 27 | |||
| 28 | if (static::$selectable[$section]) { |
||
| 29 | |||
| 30 | $name = static::$name; $param = static::$param[static::$loader->section()]; |
||
| 31 | |||
| 32 | if (static::$loader->activate(Request::get($name)) || static::$loader->activate(Cookie::get($param))) |
||
| 33 | |||
| 34 | Cookie::set($param, static::$loader->data('name'), static::$cookie_expires); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 39 |