modifs.mineures sans commentaires
This commit is contained in:
parent
333ddca4f5
commit
789642ce5f
|
@ -11,7 +11,6 @@ class SteamTrainApp extends Application {
|
|||
const USE_LOGFILE = true;
|
||||
const USE_RUNFILE = true;
|
||||
const USE_RUNLOCK = true;
|
||||
const USE_SIGNAL_HANDLER = true;
|
||||
|
||||
const ARGS = [
|
||||
"purpose" => self::TITLE,
|
||||
|
@ -22,14 +21,17 @@ EOT,
|
|||
["-c", "--count", "args" => 1,
|
||||
"help" => "spécifier le nombre d'étapes",
|
||||
],
|
||||
["-s", "--use-signal-handler", "value" => true,
|
||||
["-s", "--install-signal-handler", "value" => true,
|
||||
"help" => "installer un gestionnaire de signaux",
|
||||
],
|
||||
];
|
||||
|
||||
protected $count = 100;
|
||||
|
||||
protected bool $installSignalHandler = false;
|
||||
|
||||
function main() {
|
||||
if ($this->installSignalHandler) app2::install_signal_handler();
|
||||
$count = intval($this->count);
|
||||
app2::action("Running train...", $count);
|
||||
for ($i = 1; $i <= $count; $i++) {
|
||||
|
|
|
@ -80,7 +80,7 @@ abstract class Application {
|
|||
const USE_RUNLOCK = false;
|
||||
|
||||
/** @var bool faut-il installer le gestionnaire de signaux? */
|
||||
const USE_SIGNAL_HANDLER = false;
|
||||
const INSTALL_SIGNAL_HANDLER = false;
|
||||
|
||||
static function _manage_runfile(int $argc, array $argv, RunFile $runfile): void {
|
||||
if ($argc <= 1 || $argv[1] !== "//") return;
|
||||
|
@ -125,7 +125,7 @@ abstract class Application {
|
|||
}
|
||||
};
|
||||
register_shutdown_function($shutdown);
|
||||
app2::install_signal_handler(static::USE_SIGNAL_HANDLER);
|
||||
app2::install_signal_handler(static::INSTALL_SIGNAL_HANDLER);
|
||||
try {
|
||||
static::_initialize_app();
|
||||
$useRunfile = static::USE_RUNFILE;
|
||||
|
|
Loading…
Reference in New Issue