Changeset 348
- Timestamp:
- 03/07/07 16:17:42 (1 year ago)
- Files:
-
- trunk/docroot/xml.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/xml/stubXMLXIncludeStreamWrapper.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docroot/xml.php
r342 r348 23 23 public static function main() 24 24 { 25 $directory = new DirectoryIterator(stubConfig::getCachePath() . '/xml');26 foreach ($directory as $file) {27 if ($file->isDot() == true || $file->getFilename() == '.svn') {28 continue;29 }30 31 unlink($file->getPathname());32 }33 34 25 $request = new stubWebRequest(); 35 26 $session = new stubPHPSession('stubSID'); trunk/src/main/php/net/stubbles/xml/stubXMLXIncludeStreamWrapper.php
r347 r348 134 134 } 135 135 136 if (file_exists($this->cachedFileName) == false ) {136 if (file_exists($this->cachedFileName) == false || $this->needsRefresh() == true) { 137 137 $this->processFile(); 138 138 } … … 144 144 145 145 $this->fp = $fp; 146 return true; 147 } 148 149 /** 150 * check whether the cached file needs to be refreshed 151 * 152 * @return bool 153 */ 154 protected function needsRefresh() 155 { 156 if (filemtime($this->cachedFileName) > filemtime($this->fileName)) { 157 return false; 158 } 159 146 160 return true; 147 161 }
