hourly.php 889 Bytes
Newer Older
Ayolo's avatar
Ayolo committed
1
<?php
Ayolo's avatar
Ayolo committed
2
$_SERVER['SCRIPT_FILENAME']="/var/www/ae/www/ae2/phpcron";
Ayolo's avatar
bleh  
Ayolo committed
3

Ayolo's avatar
Ayolo committed
4 5 6
/*
 * hourly
 */
Ayolo's avatar
Ayolo committed
7
$topdir=$_SERVER['SCRIPT_FILENAME']."/../";
Ayolo's avatar
Ayolo committed
8 9 10 11 12 13
define('MAGPIE_CACHE_DIR', '/var/www/ae/www/var/cache/planet/');
define('MAGPIE_CACHE_ON', true);
define('MAGPIE_CACHE_AGE', 50*60); //50minutes pour etre certain d'avoir un truc à jour :)
define('MAGPIE_OUTPUT_ENCODING', "UTF-8");
define('MAX_NUM',20);
define('MAX_SUM_LENGHT',200);
Feu's avatar
Feu committed
14 15

require_once($topdir. "include/site.inc.php");
BenC's avatar
BenC committed
16
/*require_once($topdir. "include/lib/magpierss/rss_fetch.inc.php");*/
Ayolo's avatar
Ayolo committed
17

Feu's avatar
Feu committed
18 19 20

$site = new site ();

Feu's avatar
Feu committed
21 22
// Tâche 1 [planet] : mettre à jour le cache

Feu's avatar
Feu committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36
// Tâche 2 [galaxy] : màj, et cycles


require_once($topdir. "include/galaxy.inc.php");

$galaxy = new galaxy($site->db,$site->dbrw);

$galaxy->update();

for($i=0;$i<45;$i++) // Environs 1100 cycles/jours
  $galaxy->cycle();

$galaxy->mini_render($topdir."var/mini_galaxy.png");

Feu's avatar
Feu committed
37

Ayolo's avatar
Ayolo committed
38
?>