示例#1
0
<?php

// an example of a CLI app.
// make sure we are running from cli.
if (!is_resource(STDIN)) {
    // exit with an error message for the web browser.
    die('<h1>Please run this from CLI.</h1><h2>Does not work in browser.</h2>');
}
// include glu
include __DIR__ . '/../../common.php';
// kick it off, reading from STDIN
Gaia\GLU::instance(array('STDIN' => STDIN))->dispatch(__DIR__ . '/app/main.php');
// EOF
示例#2
0
<?php

// This demo shows how you can nest glus.
// in other words, one glu can instantiate an dispatch another.
// which allows you to create a complex nested and encapsulated
// components.
// include the autoload.
include __DIR__ . '/../../common.php';
// run main.
Gaia\GLU::instance()->dispatch(__DIR__ . '/lib/main.php');
// all done.