Changeset 1714

Show
Ignore:
Timestamp:
07/16/08 18:26:30 (3 months ago)
Author:
mikey
Message:

implement enhancement #148: do not cache xincluded parts in dev and stage mode

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework/trunk/src/main/php/net/stubbles/xml/stubXMLXIncludeStreamWrapper.php

    r1623 r1714  
    77 * @subpackage  xml 
    88 */ 
    9 stubClassLoader::load('net::stubbles::lang::stubRegistry', 
     9stubClassLoader::load('net::stubbles::lang::stubMode', 
     10                      'net::stubbles::lang::stubRegistry', 
    1011                      'net::stubbles::lang::exceptions::stubFileNotFoundException', 
    1112                      'net::stubbles::lang::exceptions::stubIOException', 
     
    7778    public static function register() 
    7879    { 
    79         if (true == self::$registered) { 
     80        if (true === self::$registered) { 
    8081            return; 
    8182        } 
    8283 
    83         if (stream_wrapper_register('xinc', __CLASS__) == false) { 
     84        if (stream_wrapper_register('xinc', __CLASS__) === false) { 
    8485            throw new stubXMLException('A handler has already been registered for the xinc protocol.'); 
    8586        } 
     
    107108    { 
    108109        self::$cachePath = $cachePath . '/xml/xinc'; 
    109         if (file_exists($cachePath) == false) { 
     110        if (file_exists($cachePath) === false) { 
    110111            if (!@mkdir($cachePath, stubRegistry::getConfig('net.stubbles.filemode', 0700), true)) { 
    111112                throw new stubIOException("Can not create cache directory " . $cachePath . '.'); 
     
    137138    { 
    138139        $this->parsePath($path); 
    139         if (file_exists($this->cachedFileName) == false || $this->needsRefresh() == true) { 
     140        if (file_exists($this->cachedFileName) === false || $this->needsRefresh() === true) { 
    140141            $this->processFile(); 
    141142        } 
     
    157158    protected function needsRefresh() 
    158159    { 
     160        if (stubMode::$CURRENT->isCacheEnabled() === false) { 
     161            return true; 
     162        } 
     163         
    159164        if (filemtime($this->cachedFileName) > filemtime($this->fileName))  { 
    160165            return false;