PHP code example of xtompie / monitor
1. Go to this page and download the library: Download xtompie/monitor library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xtompie / monitor example snippets
use Xtompie\Monitor\Monitor;
$monitor = new Monitor(name: 'import', stdout: true, frequency: 1);
foreach (input() as $input) {
$imported = import($input);
$imported ? $monitor->up('done') : $monitor->up('skip');
}
$monitor->show();
use Xtompie\Monitor\Monitor;
class ImportMonitor extends Monitor
{
public function done(): void
{
$this->up('done');
}
public function skip(): void
{
$this->up('skip');
}
}