2009-10-08 16:32:31 +03:00
|
|
|
|
<?php
|
|
|
|
|
/*-------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* LiveStreet Engine Social Networking
|
|
|
|
|
* Copyright © 2008 Mzhelskiy Maxim
|
|
|
|
|
*
|
|
|
|
|
*--------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* Official site: www.livestreet.ru
|
|
|
|
|
* Contact e-mail: rus.engine@gmail.com
|
|
|
|
|
*
|
|
|
|
|
* GNU General Public License, version 2:
|
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
|
*
|
|
|
|
|
---------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2014-06-11 13:52:44 +03:00
|
|
|
|
require_once(dirname(dirname(dirname(__DIR__))).'/bootstrap/start.php');
|
2009-10-08 16:32:31 +03:00
|
|
|
|
|
2014-06-11 13:52:44 +03:00
|
|
|
|
class CronTemplateCacheClean extends Cron {
|
2009-10-08 16:32:31 +03:00
|
|
|
|
/**
|
|
|
|
|
* Находим все кеш-файлы js и css и удаляем их с сервера
|
|
|
|
|
*/
|
|
|
|
|
public function Client() {
|
|
|
|
|
/**
|
|
|
|
|
* Выбираем все файлы кеша
|
|
|
|
|
*/
|
2011-04-27 10:44:28 +03:00
|
|
|
|
$aFiles = glob(Config::Get('path.smarty.cache'). DIRECTORY_SEPARATOR ."*\*.{css,js}", GLOB_BRACE);
|
2010-04-17 18:12:10 +03:00
|
|
|
|
if (!$aFiles) $aFiles=array();
|
2009-10-08 16:32:31 +03:00
|
|
|
|
|
2011-04-27 10:44:28 +03:00
|
|
|
|
$this->Log("Cache files count: ".count($aFiles));
|
2009-10-08 16:32:31 +03:00
|
|
|
|
|
|
|
|
|
foreach ($aFiles as $sFilePath) {
|
|
|
|
|
@unlink($sFilePath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Создаем объект крон-процесса
|
|
|
|
|
*/
|
2014-06-11 13:52:44 +03:00
|
|
|
|
$app=new CronTemplateCacheClean();
|
2014-05-28 08:37:30 +03:00
|
|
|
|
print $app->Exec();
|