PHPDaemon\Examples\ExampleGibsonRequest::run PHP Method

run() public method

Called when request iterated.
public run ( ) : integer
return integer Status.
    public function run()
    {
        try {
            $this->header('Content-Type: text/html');
        } catch (\Exception $e) {
        }
        ?>
        <!DOCTYPE html>
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <title>Example with Gibson</title>
        </head>
        <body>
        <?php 
        if ($r = $this->job->getResult('testquery')) {
            echo '<h1>It works! Be happy! ;-)</h1>Result of query: <pre>';
            var_dump($r);
            echo '</pre>';
        } else {
            echo '<h1>Something went wrong! We have no result...</h1>';
        }
        echo '<br />Request (http) took: ' . round(microtime(true) - $this->attrs->server['REQUEST_TIME_FLOAT'], 6);
        ?>
        </body>
        </html>
        <?php 
    }
ExampleGibsonRequest