game/htdocs/taches.php

34 lines
1.0 KiB
PHP

<?php
if(!defined('INDEX')) define('INDEX', 1);
if(!defined('CRON')) define('CRON', 1);
ob_start();
print 'Début des taches cron ; il est : '.date('d/m/Y H:i:s');
set_time_limit(0);
ignore_user_abort(true);
$onyx = @file_get_contents('./.onyx') or die("Configuration introuvable.");
define("_FCORE",trim($onyx));
require_once(_FCORE."kernel.php");
require_once(_FCORE."../game/function.php");
require_once(_FCORE."../game/tables.php");
require_once(_FCORE."../game/vars.php");
$bdd = new bdd();
if (date('a') == 'am') {
include(_FCORE."../game/cron/suppr_joueurs.php");
include(_FCORE."../game/cron/inactifs.php");
include(_FCORE."../game/cron/bourse.php");
}
else print '<br />Heure PM : on passe les taches matinales';
include(_FCORE."../game/cron/sauvebdd.php");
include(_FCORE."../game/cron/classement.php");
print '<br />Fin des taches cron ; il est : '.date('d/m/Y H:i:s');
$out = ob_get_contents();
$fichier = fopen(_FCORE."logs/".strftime('%d-%m-%Y-%H-cron').".xlog",'a+');
fwrite($fichier, str_replace('<br />', "\n", $out));
fclose($fichier);
?>