mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Updates because new release update checks
This commit is contained in:
@@ -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.
|
||||||
|
Reference in New Issue
Block a user