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_LOGFILE = true;
|
||||||
const USE_RUNFILE = true;
|
const USE_RUNFILE = true;
|
||||||
const USE_RUNLOCK = true;
|
const USE_RUNLOCK = true;
|
||||||
const USE_SIGNAL_HANDLER = true;
|
|
||||||
|
|
||||||
const ARGS = [
|
const ARGS = [
|
||||||
"purpose" => self::TITLE,
|
"purpose" => self::TITLE,
|
||||||
|
@ -22,14 +21,17 @@ EOT,
|
||||||
["-c", "--count", "args" => 1,
|
["-c", "--count", "args" => 1,
|
||||||
"help" => "spécifier le nombre d'étapes",
|
"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",
|
"help" => "installer un gestionnaire de signaux",
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $count = 100;
|
protected $count = 100;
|
||||||
|
|
||||||
|
protected bool $installSignalHandler = false;
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
if ($this->installSignalHandler) app2::install_signal_handler();
|
||||||
$count = intval($this->count);
|
$count = intval($this->count);
|
||||||
app2::action("Running train...", $count);
|
app2::action("Running train...", $count);
|
||||||
for ($i = 1; $i <= $count; $i++) {
|
for ($i = 1; $i <= $count; $i++) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ abstract class Application {
|
||||||
const USE_RUNLOCK = false;
|
const USE_RUNLOCK = false;
|
||||||
|
|
||||||
/** @var bool faut-il installer le gestionnaire de signaux? */
|
/** @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 {
|
static function _manage_runfile(int $argc, array $argv, RunFile $runfile): void {
|
||||||
if ($argc <= 1 || $argv[1] !== "//") return;
|
if ($argc <= 1 || $argv[1] !== "//") return;
|
||||||
|
@ -125,7 +125,7 @@ abstract class Application {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
register_shutdown_function($shutdown);
|
register_shutdown_function($shutdown);
|
||||||
app2::install_signal_handler(static::USE_SIGNAL_HANDLER);
|
app2::install_signal_handler(static::INSTALL_SIGNAL_HANDLER);
|
||||||
try {
|
try {
|
||||||
static::_initialize_app();
|
static::_initialize_app();
|
||||||
$useRunfile = static::USE_RUNFILE;
|
$useRunfile = static::USE_RUNFILE;
|
||||||
|
|
Loading…
Reference in New Issue