mlo / file-loader
File loader with built in caching
Installs: 19 858
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- symfony/config: ~2.3|~3.0
- symfony/yaml: ~2.3|~3.0
Requires (Dev)
- phpunit/phpunit: ~4.5
This package is not auto-updated.
Last update: 2020-01-24 15:34:31 UTC
README
FileLoader allows you to load files from a collection of directories and then caches the results for faster access later.
Installation
composer require mlo/file-loader
Requirements
The following PHP versions are supported.
- PHP 5.4
- PHP 5.5
- PHP 5.6
- PHP 7.0
- HHVM
The following versions of Symfony components are supported.
- 2.3
- 2.7
- 2.8
- 3.0
Overview
$cacheDirectory = 'app/cache/config'; $dataDirectory = 'app/config'; $loader = new \Mlo\FileLoader\FileLoader($cacheDirectory, $dataDirectory, [ new \Mlo\FileLoader\IniFileLoader(), new \Mlo\FileLoader\JsonFileLoader(), new \Mlo\FileLoader\YamlFileLoader(), ]); $config = $loader->load('database.yml');
Supported File Types
- YAML (.yml/.yaml)
- JSON (.json)
- INI (.ini)