Updates because new release update checks

This commit is contained in:
uwetews
2016-09-19 07:36:20 +02:00
parent 30f7c15d01
commit 268368f2a4
3 changed files with 16 additions and 5 deletions

View File

@@ -280,10 +280,13 @@ KEY `expire` (`expire`)
*/ */
public function cleanCacheDir() public function cleanCacheDir()
{ {
if (isset($this->smarty)) { $smarty = $this->getSmartyObj();
$this->cleanDir($this->smarty->getCacheDir()); if (isset($smarty)) {
} elseif (isset($this->smartyBC)) { $dir = $smarty->getCacheDir();
$this->cleanDir($this->smartyBC->getCacheDir()); $this->cleanDir($dir);
if (method_exists($smarty, '_isNewRelease')) {
$smarty->_isNewRelease($dir);
}
} }
} }
@@ -297,7 +300,7 @@ KEY `expire` (`expire`)
$di = new RecursiveDirectoryIterator($dir); $di = new RecursiveDirectoryIterator($dir);
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST); $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($ri as $file) { foreach ($ri as $file) {
if (substr(basename($file->getPathname()), 0, 1) == '.') { if (substr(basename($file->getPathname()), 0, 1) === '.' || substr((string)$file,-4) === '.txt') {
continue; continue;
} }
// directory ? // directory ?
@@ -618,6 +621,14 @@ KEY `expire` (`expire`)
$source); $source);
} }
/**
* Gat Smarty object
* @return null|\Smarty|\SmartyBC
*/
public function getSmartyObj(){
return isset($this->smarty) ? $this->smarty : isset($this->smartyBC) ? $this->smartyBC : null;
}
/** /**
* Tears down the fixture * Tears down the fixture
* This method is called after a test is executed. * This method is called after a test is executed.