Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (34 sloc) 935 Bytes
#!/usr/bin/env php
// This wrapper prepares an environment, similar to running
// the example on a real web server.
$EXAMPLES_DIR = realpath(dirname(__FILE__) . '/../examples');
if (count($argv) <= 1) {
print "Error: Missing name of the example to run.\n";
} else {
$THIS_SCRIPT = array_shift($argv);
$EXAMPLE_FILE = array_shift($argv);
// Catch more errors
error_reporting( E_ALL | E_STRICT );
// Set time zone to UTC for running tests
// Change to the examples directory
// Check that the example exists
if (!file_exists($EXAMPLE_FILE)) {
print "Error: example does not exist: $EXAMPLE_FILE\n";
// Setup the $_GET variable based on command-line arguments
implode('&', $argv),
// Copy the GET parameters into the REQUEST variable
// Run the example
require $EXAMPLE_FILE;
Something went wrong with that request. Please try again.