[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Agora1-4/ecrire/cron/ -> refresh_syndicate.php (source)

   1  <?php
   2  /*****************************************************
   3  * This file is part of Agora, web based content management system.
   4  *
   5  * Agora is free software; you can redistribute it and/or modify
   6  * it under the terms of the GNU General Public License as published by
   7  * the Free Software Foundation; version 2 of the License.
   8  *
   9  * Agora is distributed in the hope that it will be useful,
  10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  * GNU General Public License for more details (file "COPYING").
  13  *
  14  * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière.
  15  * List of authors detailed in "copyright_fr.html" file.
  16  * E-mail : agora@sig.premier-ministre.gouv.fr
  17  * Web site : http://www.agora.gouv.fr
  18  *****************************************************/
  19  // ce fichier est appele via la ligne de commande et rafraichi tous les sites syndiqués
  20  // $Id$
  21  
  22  require_once("PEAR.php");
  23  
  24  require_once(dirname(__FILE__). "/../include/bd/inc_syndic_factory.php");
  25  $syndicObjMetier = &recuperer_instance_syndic();
  26  
  27  require_once(dirname(__FILE__). "/../inc_sites.php");
  28  
  29  require_once(dirname(__FILE__). "/../inc_version.php");
  30  require_once(dirname(__FILE__). "/../inc_filtres.php");
  31  
  32  // SUS
  33  $allSyndics = $syndicObjMetier->getAllForSyndicationAndStatutAndIntervalHour('sus', 'publie', 0);
  34  
  35  if (PEAR::isError($allSyndics)) {
  36      echo $allSyndics->getMessage();
  37      PEAR::raiseError(
  38          "[ refesh_syndicate : getAllForSyndicationAndStatutAndIntervalHour()] " . $allSyndics->getMessage(). "",
  39          PEAR_LOG_ERR,
  40          null,
  41          null,
  42          null,
  43          null,
  44          false);
  45  }
  46  else {
  47      // syndicate
  48      while (list(, $syndicMetier) = each($allSyndics)) {
  49          $id_syndic = $syndicMetier->getSyndicId();
  50          //echo 'syndication de '.$id_syndic;
  51          syndic_a_jour($id_syndic);
  52      }
  53  }
  54  
  55  // OUI
  56  $allSyndics = $syndicObjMetier->getAllForSyndicationAndStatutAndIntervalHour('oui', 'publie', 0);
  57  
  58  if (PEAR::isError($allSyndics)) {
  59      echo $allSyndics->getMessage();
  60      PEAR::raiseError(
  61          "[ refesh_syndicate : getAllForSyndicationAndStatutAndIntervalHour()] " . $allSyndics->getMessage(). "",
  62          PEAR_LOG_ERR,
  63          null,
  64          null,
  65          null,
  66          null,
  67          false);
  68  }
  69  else {
  70      while (list(, $syndicMetier) = each($allSyndics)) {
  71          $id_syndic = $syndicMetier->getSyndicId();
  72          //echo 'syndication de '.$id_syndic;
  73          syndic_a_jour($id_syndic, 'sus');
  74      }
  75  }
  76  ?>


Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7