Exemplo n.º 1
0
 protected function RunMainLoop()
 {
     $this->console->Clear();
     $this->errorsOnly = $this->console->HasArg('m');
     $this->resolveIps = $this->console->HasArg('r');
     $this->interval = ($this->console->HasArg('-delay') ? $this->console->GetArg('-delay', 100) : $this->console->GetArg('d', 100)) * 1000;
     $this->monitors = $this->CreateMonitors();
     while ($this->enabled) {
         // check for file changes
         foreach ($this->monitors as $monitor) {
             if ($monitor->HasChanges()) {
                 $monitor->Display($this->console, $this->resolveIps, $this->errorsOnly);
             }
         }
         // did user decide to quit?
         /*if (non_block_read() == 'q') {
                    exit();
         		}*/
         // give the cpu some time to breath
         usleep($this->interval);
     }
 }
Exemplo n.º 2
0
 protected function GetIntervalFromCli()
 {
     return intval(($this->console->HasArg('-delay') ? $this->console->GetArg('-delay', 100) : $this->console->GetArg('d', 100)) * 1000);
 }
Exemplo n.º 3
0
<?php

// ensure we have booted up
if (!defined('VERSION')) {
    require_once 'boot.php';
}
// wrap the console
$con = new Console();
// do error handling
$err = new ErrorHandler($con);
$err->Attach();
// load configuration
$cfg = new Config(glob($con->GetArg('i', __DIR__ . '/httpdmon.d/*.php')));
// run application
$app = new HttpdMon($cfg, $con);
$app->Run();