public function read($filename)
    {
        // Our identifier -> important :D
        $this->setUuid(md5($filename));

        $configuration = null;

        // Is cache enabled?
        if (true === $this->cacheEnabled()) {
            try {
                $configuration = $this->getCacheService()->read($this->getUuid());
            } catch (Doozr_Cache_Service_Exception $exception) {
                // Intentionally left blank
            }
        }

        // Either not cached or cache disabled ...
        if (null === $configuration) {
            // we read the content in same way as before ...
            $configuration = parent::read($filename);
        }

        // ... but we need to validation here cause our domain
        $configuration = $this->validate($configuration);

        // Error handling
        if (false === $configuration) {
            throw new Doozr_Configuration_Reader_Exception(
                'Configuration could no be parsed. Ensure its valid.'
                /* @todo Ensure Lint on error with exception = details! */
            );
        }

        $this->setDecodedContent($configuration);

        // Cache!
        if (true === $this->cacheEnabled()) {
            $this->getCacheService()->update($this->getUuid(), $configuration);
        }

        return $configuration;
    }
public function read($filename)
    {
        // Our identifier -> important :D
        $this->setUuid(md5($filename));

        $configuration = null;

        // Is cache enabled?
        if (true === $this->cacheEnabled()) {
            try {
                $configuration = $this->getCacheService()->read($this->getUuid());
            } catch (Doozr_Cache_Service_Exception $exception) {
                // Intentionally left blank
            }
        }

        // Either not cached or cache disabled ...
        if (null === $configuration) {
            // we read the content in same way as before ...
            $configuration = parent::read($filename);
        }

        // ... but we need to validation here cause our domain
        $configuration = $this->validate($configuration);

        // Error handling
        if (false === $configuration) {
            throw new Doozr_Configuration_Reader_Exception(
                'Configuration could no be parsed. Ensure its valid.'
                /* @todo Ensure Lint on error with exception = details! */
            );
        }

        $this->setDecodedContent($configuration);

        // Cache!
        if (true === $this->cacheEnabled()) {
            $this->getCacheService()->update($this->getUuid(), $configuration);
        }

        return $configuration;
    }
public function read ( $ filename ) { // Our identifier -> important :D $ this -> setUuid ( md5 ( $ filename ) ) ; $ configuration = null ; // Is cache enabled? if ( true === $ this -> cacheEnabled ( ) ) { try { $ configuration = $ this -> getCacheService ( ) -> read ( $ this -> getUuid ( ) ) ; } catch ( Doozr_Cache_Service_Exception $ exception ) { // Intentionally left blank } } // Either not cached or cache disabled ... if ( null === $ configuration ) { // we read the content in same way as before ... $ configuration = parent :: read ( $ filename ) ; } // ... but we need to validation here cause our domain $ configuration = $ this -> validate ( $ configuration ) ; // Error handling if ( false === $ configuration ) { throw new Doozr_Configuration_Reader_Exception ( 'Configuration could no be parsed. Ensure its valid.' /* @todo Ensure Lint on error with exception = details! */ ) ; } $ this -> setDecodedContent ( $ configuration ) ; // Cache! if ( true === $ this -> cacheEnabled ( ) ) { $ this -> getCacheService ( ) -> update ( $ this -> getUuid ( ) , $ configuration ) ; } return $ configuration ; }
Here we proxy the call to parents generic reading and replacing functionality.
We do this to receive the processed result here in place to convert it to a real
object which is served as fluent API.

@param string $filename The filename to read.

@author Benjamin Carl <opensource@clickalicious.de>

@return \stdClass The configuration as object representation

@throws Doozr_Configuration_Reader_Exception
Here we proxy the call to parents generic reading and replacing functionality . We do this to receive the processed result here in place to convert it to a real object which is served as fluent API .