src/AssetConfig.php
public function load($path, $prefix = '')
    {
        $config = $this->readConfig($path);

        foreach ($config as $section => $values) {
            if (in_array($section, self::$_extensionTypes)) {
                // extension section, merge in the defaults.
                $defaults = $this->get($section);
                if ($defaults) {
                    $values = array_merge($defaults, $values);
                }
                $this->addExtension($section, $values);
            } elseif (strtolower($section) === self::GENERAL) {
                if (!empty($values['timestampPath'])) {
                    $path = $this->_replacePathConstants($values['timestampPath']);
                    $values['timestampPath'] = rtrim($path, '/') . '/';
                }
                $this->set(self::GENERAL, $values);
            } elseif (strpos($section, self::FILTER_PREFIX) === 0) {
                // filter section.
                $name = str_replace(self::FILTER_PREFIX, '', $section);
                $this->filterConfig($name, $values);
            } else {
                $lastDot = strrpos($section, '.') + 1;
                $extension = substr($section, $lastDot);
                $key = $section;

                // must be a build target.
                $this->addTarget($prefix . $key, $values);
            }
        }

        $this->resolveExtends();

        return $this;
    }
public function load($path, $prefix = '')
    {
        $config = $this->readConfig($path);

        foreach ($config as $section => $values) {
            if (in_array($section, self::$_extensionTypes)) {
                // extension section, merge in the defaults.
                $defaults = $this->get($section);
                if ($defaults) {
                    $values = array_merge($defaults, $values);
                }
                $this->addExtension($section, $values);
            } elseif (strtolower($section) === self::GENERAL) {
                if (!empty($values['timestampPath'])) {
                    $path = $this->_replacePathConstants($values['timestampPath']);
                    $values['timestampPath'] = rtrim($path, '/') . '/';
                }
                $this->set(self::GENERAL, $values);
            } elseif (strpos($section, self::FILTER_PREFIX) === 0) {
                // filter section.
                $name = str_replace(self::FILTER_PREFIX, '', $section);
                $this->filterConfig($name, $values);
            } else {
                $lastDot = strrpos($section, '.') + 1;
                $extension = substr($section, $lastDot);
                $key = $section;

                // must be a build target.
                $this->addTarget($prefix . $key, $values);
            }
        }

        $this->resolveExtends();

        return $this;
    }
public function load ( $ path , $ prefix = '' ) { $ config = $ this -> readConfig ( $ path ) ; foreach ( $ config as $ section => $ values ) { if ( in_array ( $ section , self :: $ _extensionTypes ) ) { // extension section, merge in the defaults. $ defaults = $ this -> get ( $ section ) ; if ( $ defaults ) { $ values = array_merge ( $ defaults , $ values ) ; } $ this -> addExtension ( $ section , $ values ) ; } elseif ( strtolower ( $ section ) === self :: GENERAL ) { if ( ! empty ( $ values [ 'timestampPath' ] ) ) { $ path = $ this -> _replacePathConstants ( $ values [ 'timestampPath' ] ) ; $ values [ 'timestampPath' ] = rtrim ( $ path , '/' ) . '/' ; } $ this -> set ( self :: GENERAL , $ values ) ; } elseif ( strpos ( $ section , self :: FILTER_PREFIX ) === 0 ) { // filter section. $ name = str_replace ( self :: FILTER_PREFIX , '' , $ section ) ; $ this -> filterConfig ( $ name , $ values ) ; } else { $ lastDot = strrpos ( $ section , '.' ) + 1 ; $ extension = substr ( $ section , $ lastDot ) ; $ key = $ section ; // must be a build target. $ this -> addTarget ( $ prefix . $ key , $ values ) ; } } $ this -> resolveExtends ( ) ; return $ this ; }
Load a config file into the current instance.

@param string $path The config file to load.
@param string $prefix The string to prefix all targets in $path with.
@return $this
Load a config file into the current instance .