public function read($filename)
    {
        // Create UUID in a generic way
        $this->setUuid(md5($this->getUuid().$filename));

        // Get all loaded configurations
        $configurations = $this->getConfigurations();

        // Now check if the configuration is in runtime cache
        if (isset($configurations[$this->getUuid()]) === false) {

            // Otherwise look for cached version?
            if (true === $this->getCache()) {
                try {
                    $configuration = $this->getCacheService()->read($this->getUuid(), $this->getScope());

                    // Check returned value => NULL = possible timed out cached entry ...
                    if ($configuration !== null) {
                        $configurations[$this->getUuid()] = $configuration;
                        $this->setConfiguration($configuration);
                        $this->setConfigurations($configurations);

                        return $configuration;
                    }
                } catch (Doozr_Cache_Service_Exception $e) {
                    //
                }
            }

            // If not cached we need to clone a configuration parser and begin parsing and merging
            $configuration = clone $this->getConfigurationReader();
            $configuration->read($filename);
            $configurations[$this->getUuid()] = $configuration->get();

            // Merge with master
            $configuration = $this->merge(
                $this->getConfiguration(),
                $configuration->get()
            );

            // Store merge result
            if ($this->getCache() === true) {
                $this->getCacheService()->create($this->getUuid(), $configuration, null, $this->getScope());
            }

            // Store configurations
            $this->setConfiguration($configuration);
            $this->setConfigurations($configurations);
        } else {
            return $configurations[$this->getUuid()];
        }
    }
public function read($filename)
    {
        // Create UUID in a generic way
        $this->setUuid(md5($this->getUuid().$filename));

        // Get all loaded configurations
        $configurations = $this->getConfigurations();

        // Now check if the configuration is in runtime cache
        if (isset($configurations[$this->getUuid()]) === false) {

            // Otherwise look for cached version?
            if (true === $this->getCache()) {
                try {
                    $configuration = $this->getCacheService()->read($this->getUuid(), $this->getScope());

                    // Check returned value => NULL = possible timed out cached entry ...
                    if ($configuration !== null) {
                        $configurations[$this->getUuid()] = $configuration;
                        $this->setConfiguration($configuration);
                        $this->setConfigurations($configurations);

                        return $configuration;
                    }
                } catch (Doozr_Cache_Service_Exception $e) {
                    //
                }
            }

            // If not cached we need to clone a configuration parser and begin parsing and merging
            $configuration = clone $this->getConfigurationReader();
            $configuration->read($filename);
            $configurations[$this->getUuid()] = $configuration->get();

            // Merge with master
            $configuration = $this->merge(
                $this->getConfiguration(),
                $configuration->get()
            );

            // Store merge result
            if ($this->getCache() === true) {
                $this->getCacheService()->create($this->getUuid(), $configuration, null, $this->getScope());
            }

            // Store configurations
            $this->setConfiguration($configuration);
            $this->setConfigurations($configurations);
        } else {
            return $configurations[$this->getUuid()];
        }
    }
public function read ( $ filename ) { // Create UUID in a generic way $ this -> setUuid ( md5 ( $ this -> getUuid ( ) . $ filename ) ) ; // Get all loaded configurations $ configurations = $ this -> getConfigurations ( ) ; // Now check if the configuration is in runtime cache if ( isset ( $ configurations [ $ this -> getUuid ( ) ] ) === false ) { // Otherwise look for cached version? if ( true === $ this -> getCache ( ) ) { try { $ configuration = $ this -> getCacheService ( ) -> read ( $ this -> getUuid ( ) , $ this -> getScope ( ) ) ; // Check returned value => NULL = possible timed out cached entry ... if ( $ configuration !== null ) { $ configurations [ $ this -> getUuid ( ) ] = $ configuration ; $ this -> setConfiguration ( $ configuration ) ; $ this -> setConfigurations ( $ configurations ) ; return $ configuration ; } } catch ( Doozr_Cache_Service_Exception $ e ) { // } } // If not cached we need to clone a configuration parser and begin parsing and merging $ configuration = clone $ this -> getConfigurationReader ( ) ; $ configuration -> read ( $ filename ) ; $ configurations [ $ this -> getUuid ( ) ] = $ configuration -> get ( ) ; // Merge with master $ configuration = $ this -> merge ( $ this -> getConfiguration ( ) , $ configuration -> get ( ) ) ; // Store merge result if ( $ this -> getCache ( ) === true ) { $ this -> getCacheService ( ) -> create ( $ this -> getUuid ( ) , $ configuration , null , $ this -> getScope ( ) ) ; } // Store configurations $ this -> setConfiguration ( $ configuration ) ; $ this -> setConfigurations ( $ configurations ) ; } else { return $ configurations [ $ this -> getUuid ( ) ] ; } }
Reads a configuration by using the injected Doozr_Configuration_Reader_Interface.
The result of the call will be merged with previously loaded configurations
and it will be cached.

@param string $filename The filename to parse

@return Doozr_Configuration_Reader_Interface|mixed|null|stdClass

@throws Doozr_Cache_Service_Exception
@throws Doozr_Configuration_Reader_Exception
Reads a configuration by using the injected Doozr_Configuration_Reader_Interface . The result of the call will be merged with previously loaded configurations and it will be cached .