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()
{
if (isset($this->smarty)) {
$this->cleanDir($this->smarty->getCacheDir());
} elseif (isset($this->smartyBC)) {
$this->cleanDir($this->smartyBC->getCacheDir());
$smarty = $this->getSmartyObj();
if (isset($smarty)) {
$dir = $smarty->getCacheDir();
$this->cleanDir($dir);
if (method_exists($smarty, '_isNewRelease')) {
$smarty->_isNewRelease($dir);
}
}
}
@@ -297,7 +300,7 @@ KEY `expire` (`expire`)
$di = new RecursiveDirectoryIterator($dir);
$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($ri as $file) {
if (substr(basename($file->getPathname()), 0, 1) == '.') {
if (substr(basename($file->getPathname()), 0, 1) === '.' || substr((string)$file,-4) === '.txt') {
continue;
}
// directory ?
@@ -618,6 +621,14 @@ KEY `expire` (`expire`)
$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
* This method is called after a test is executed.