コード例 #1
0
ファイル: job-runner.php プロジェクト: vbuilder/scheduler
    }
    protected function jobFinished($jobScript, $stdoutHandle, $stderrHandle)
    {
        $output = stream_get_contents($stdoutHandle);
        if ($output != "") {
            echo "\n\n{$output}\nJob finished\n";
        } else {
            echo " Finished\n";
        }
        // Call parent
        return call_user_func_array(array('parent', __FUNCTION__), func_get_args());
    }
    protected function jobFailed($jobScript, $stdoutHandle, $stderrHandle)
    {
        $output = stream_get_contents($stdoutHandle);
        if ($output != "") {
            echo "\n\n{$output}\n!!! Job FAILED\n";
        } else {
            echo " Failed\n";
        }
        // Log error (and notify by e-mail if set)
        Nette\Diagnostics\Debugger::log('Job ' . $jobScript . ' failed', 'error');
        // Call parent
        return call_user_func_array(array('parent', __FUNCTION__), func_get_args());
    }
}
// -----------------------------------------------------------------------------
$runner = new Runner($container->getService('scheduler.jobStorage'));
echo "\n";
$runner->runAll();
echo "\n";