| Conditions | 5 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public static function init(string $section) { |
||
| 30 | |||
| 31 | static::$loader = new static::$loader_class($section, false); |
||
| 32 | |||
| 33 | # Throw error if no extensions found |
||
| 34 | |||
| 35 | if (false === static::$loader->get('name')) throw new static::$exception_class; |
||
| 36 | |||
| 37 | # Activate user defined extension |
||
| 38 | |||
| 39 | if (static::$selectable[static::$loader->getSection()]) { |
||
| 40 | |||
| 41 | $name = static::$name; $param = static::$param[static::$loader->getSection()]; |
||
| 42 | |||
| 43 | if (static::$loader->activate(Request::get($name)) || static::$loader->activate(Cookie::get($param))) |
||
| 44 | |||
| 45 | Cookie::set($param, static::$loader->get('name'), static::$cookie_expires); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 50 |