| @@ 16-33 (lines=18) @@ | ||
| 13 | * |
|
| 14 | * @author Matthew Loberg <[email protected]> |
|
| 15 | */ |
|
| 16 | class IniFileLoader extends Loader |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @inheritDoc |
|
| 20 | */ |
|
| 21 | public function load($resource, $type = null) |
|
| 22 | { |
|
| 23 | return parse_ini_file($resource); |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @inheritDoc |
|
| 28 | */ |
|
| 29 | public function supports($resource, $type = null) |
|
| 30 | { |
|
| 31 | return is_string($resource) && 'ini' === pathinfo($resource, PATHINFO_EXTENSION); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| @@ 16-33 (lines=18) @@ | ||
| 13 | * |
|
| 14 | * @author Matthew Loberg <[email protected]> |
|
| 15 | */ |
|
| 16 | class JsonFileLoader extends Loader |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @inheritDoc |
|
| 20 | */ |
|
| 21 | public function load($resource, $type = null) |
|
| 22 | { |
|
| 23 | return json_decode(file_get_contents($resource), true); |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @inheritDoc |
|
| 28 | */ |
|
| 29 | public function supports($resource, $type = null) |
|
| 30 | { |
|
| 31 | return is_string($resource) && 'json' === pathinfo($resource, PATHINFO_EXTENSION); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||