#!/usr/bin/php "Aide.", ) ); $opts->parse(); } catch (Zend_Console_Getopt_Exception $e) { echo $e->getUsageMessage(); exit; } //Usage if(isset($opts->help)) { echo $opts->getUsageMessage(); exit; } $dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases'); $db = Zend_Db::factory($dbConfig); $commandesM = new Application_Model_Commandes($db); $sql = $commandesM->select() ->where('idProfil != ?', 0) ->where("dateStart != '0000-00-00 00:00:00'") ->where("dateStop = '0000-00-00 00:00:00'"); $result = $commandesM->fetchAll($sql); if (count($result->toArray())>0){ exit; } //Si pas de traitement en cours alors on lance $sql = $commandesM->select() ->where('idProfil != ?', 0) ->where("dateStop = '0000-00-00 00:00:00'"); $result = $commandesM->fetchAll($sql, 'dateAdded ASC', 1); exec(realpath(dirname(__FILE__))."/enrichisement.php --id ".$result->id." &");