Example #1
0
    exit(0);
}
// Set library directory to php.ini include_path
$baseDir = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
$includePath = get_include_path();
$libPath = $baseDir . DIRECTORY_SEPARATOR . 'library';
if (!is_dir($libPath)) {
    echo 'Core library could not find in this system.' . PHP_EOL;
    exit(0);
}
// If library directory  already set in include_path, do not set.
if (!preg_match('"' . $libPath . '"', $includePath, $match)) {
    set_include_path($includePath . PATH_SEPARATOR . $libPath);
}
// Add app directory
$includePath = get_include_path();
$appPath = $baseDir . DIRECTORY_SEPARATOR . 'app';
if (!is_dir($appPath)) {
    echo 'App directory could not find in this system.' . PHP_EOL;
    exit(0);
}
// If app directory already set in include_path, do not set.
if (!preg_match('"' . $appPath . '"', $includePath, $match)) {
    set_include_path($includePath . PATH_SEPARATOR . $appPath);
}
/**
 * @see Gene_Base
 */
require_once 'Gene/Base.php';
Gene_Base::run($appPath);