'Displays usage information.', 'all' => 'Execute toutes les actions (cron).', 'type=w' => 'Supprime uniquement les fichiers indiqués.', )); $opts->parse(); $optionsNb = count($opts->getOptions()); } catch (Zend_Console_Getopt_Exception $e) { $displayUsage = true; } // --- Aide / Options if ($optionsNb == 0 || isset($opts->help)) { $displayUsage = true; } // --- Usage if ($displayUsage) { echo $opts->getUsageMessage(); ?> Types de fichier disponibles : all || $opts->type) { foreach ($typesFichier as $dir) { if ($opts->all || $opts->type==$dir ){ removeFileInDir(LOG_PATH.'/'.$dir); } } } function removeFileInDir($dir) { if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { unlink($dir . $file); } closedir($dh); } } }