Files
fdn2/private/crontab/core.hourly.php
T
Riccardo Di Dato b015b44ec7 Aggiunti warning mail per commenti
Aggiunte nuove mail al mail helper
Correzioni grafiche alle pagine di cancellazione in amministrazione
Modificata pagina di validazione commento
2016-03-17 23:00:26 +01:00

40 lines
1.7 KiB
PHP

#!/usr/bin/php
<?php
require_once(dirname(__FILE__). "/../load.php");
$tasks = array("NewsletterCheckTask","DeleteOldPasswordResetRequestsTask", "UpdateMeteoCacheTask", "GenerateCommentiWarningMailTask");
if (sizeof($tasks)>0){
foreach ($tasks as $taskName){
try {
if ($taskName::isActive()){
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
$taskName::execute();
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
}
}catch (CoreException $ex){
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
}
catch (Exception $ex){
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
}
}
}
// try {
// SystemController::executeTask("RefreshApiCache.php");
// }
// catch (UNHADBException $unex){
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
// }
// catch (Exception $ex){
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
// }
?>