issue #0001977 : Suppression de toutes les tables temporaires le samedi matin
This commit is contained in:
parent
05281784e5
commit
53087a74f3
@ -110,23 +110,37 @@ $tabQueries = array(
|
||||
/**
|
||||
* Liste des déclencheurs
|
||||
*/
|
||||
if ($opts->list) {
|
||||
foreach($tabQueries as $key=>$querie)
|
||||
if ( $opts->list ) {
|
||||
foreach ( $tabQueries as $key => $query) {
|
||||
echo "\t- $key".PHP_EOL;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all temporary table
|
||||
*/
|
||||
$day = date('N');
|
||||
if ( $opts->tout && $day == 6) {
|
||||
foreach ( $tabQueries as $key => $query) {
|
||||
try {
|
||||
$db->query("DROP TABLE IF EXISTS $key;");
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Force declencheur
|
||||
*/
|
||||
if ($opts->declencheur) {
|
||||
|
||||
if ( $opts->declencheur ) {
|
||||
if ( in_array($opts->declencheur, array_keys($tabQueries)) ) {
|
||||
$tabQueries = array($opts->declencheur => $tabQueries[$opts->declencheur]);
|
||||
} else {
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
Loading…
Reference in New Issue
Block a user