PHP Classes

File: src/loader/IniLoader.php

Recommend this page to a friend!
  Classes of Vitaly   Queasy PHP Config   src/loader/IniLoader.php   Download  
File: src/loader/IniLoader.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Queasy PHP Config
Read a configuration from files in several formats
Author: By
Last change:
Date: 3 years ago
Size: 704 bytes
 

Contents

Class file image Download
<?php

/*
 * Queasy PHP Framework - Configuration
 *
 * (c) Vitaly Demyanenko <vitaly_demyanenko@yahoo.com>
 *
 * For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
 */

namespace queasy\config\loader;

/**
 * INI file configuration loader class
 */
class IniLoader extends FileSystemLoader
{
   
/**
     * Load and return an array containing configuration.
     *
     * @return array Loaded configuration
     */
   
public function load()
    {
       
$data = @parse_ini_file($this->path(), true);
        if (!
is_array($data)) {
            throw new
CorruptedException($this->path());
        }

        return
$data;
    }
}