Files
fdn2/private/crontab/core.minute.php
T
Riccardo Di Dato fa648c0850 Creato sistema accetazione commenti;
Create pagine per notizie in pending e rifiutate;
Creati componenti grafici per mostrare Notizia, Commento e lista
commenti;
Bugfix e limature su amministrazione
2016-02-29 18:44:22 +01:00

31 lines
1.0 KiB
PHP

#!/usr/bin/php
<?php
/*
Author: Riccardo Di Dato
Creation Date: 12/gen/2016
*/
require_once(dirname(__FILE__). "/../load.php");
$tasks = array("MailSendTask","GenerateAdminActivationMailTask");
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);
}
}
}
?>