Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

mloberg/FileLoader

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

File Loader

Latest Stable Version License Build Status Coverage Status Scrutinizer Code Quality SensioLabsInsight

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)