1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-29 04:55:02 +03:00
ifhub.club/application/utilities/cron/template.php
Mzhelskiy Maxim 3c15ecd05c fix cron
2014-06-11 17:52:44 +07:00

43 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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
*
---------------------------------------------------------
*/
require_once(dirname(dirname(dirname(__DIR__))).'/bootstrap/start.php');
class CronTemplateCacheClean extends Cron {
/**
* Находим все кеш-файлы js и css и удаляем их с сервера
*/
public function Client() {
/**
* Выбираем все файлы кеша
*/
$aFiles = glob(Config::Get('path.smarty.cache'). DIRECTORY_SEPARATOR ."*\*.{css,js}", GLOB_BRACE);
if (!$aFiles) $aFiles=array();
$this->Log("Cache files count: ".count($aFiles));
foreach ($aFiles as $sFilePath) {
@unlink($sFilePath);
}
}
}
/**
* Создаем объект крон-процесса
*/
$app=new CronTemplateCacheClean();
print $app->Exec();