<?php
namespace nur\sery\tools;

use nur\sery\output\msg;
use nur\sery\wip\app\app2;
use nur\sery\wip\app\cli\Application;

class SteamTrainApp extends Application {
  const PROJDIR = __DIR__.'/../..';
  const TITLE = "Train à vapeur";
  const USE_LOGFILE = true;
  const USE_RUNFILE = true;
  const USE_RUNLOCK = true;
  const USE_SIGNAL_HANDLER = true;

  const ARGS = [
    "purpose" => self::TITLE,
    "description" => <<<EOT
Cette application peut être utilisée pour tester le lancement des tâches de fond
EOT,
  ];

  function main() {
    $count = 100;
    app2::action("Running train...", $count);
    for ($i = 1; $i <= $count; $i++) {
      msg::print("Tchou-tchou! x $i");
      app2::step();
      sleep(1);
    }
  }
}
