示例#1
0
if (NULL !== $libPath) {
    if (!$libVersion) {
        $libVersion = 'latest';
    }
    $autoloader->setZfPath($libPath, $libVersion);
    $lib = $autoloader->getZfPath();
}
define('LIB_PATH', $lib);
/** END::SGDOCE stuff * */
$main = \Robot\Main::getInstance();
try {
    register_shutdown_function(array($main, 'shutdown'));
    $main->argsManipulator();
    /** BEGIN::SGDOCE stuff * */
    require_once 'Core/Application.php';
    // Create application, bootstrap, and run
    $application = new Core_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
    $application->bootstrap();
    /** END::SGDOCE stuff * */
    $main->bootstrap()->run();
} catch (Exception $exception) {
    if ($main instanceof Robot\Main) {
        $main->setExpection($exception);
        exit(1);
    }
    if ($exception instanceof Zend_Console_Getopt_Exception) {
        exit($exception->getMessage() . PHP_EOL . $exception->getUsageMessage());
    }
    exit($exception->getMessage());
}
exit(0);
示例#2
0
$libVersion = getenv('LIB_VERSION') ? getenv('LIB_VERSION') : NULL;
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$lib = APPLICATION_PATH . '/../library';
if (NULL !== $libPath) {
    if (!$libVersion) {
        $libVersion = 'latest';
    }
    $autoloader->setZfPath($libPath, $libVersion);
    $lib = $autoloader->getZfPath();
}
define('LIB_PATH', $lib);
require_once 'Core/Application.php';
// Create application, bootstrap, and run
$application = new Core_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap()->run();
function dump($obj, $exit = TRUE, $outputRaw = TRUE)
{
    $trace = array();
    $backtrace = debug_backtrace();
    $totalCall = sizeof($backtrace);
    for ($i = 0; $i < $totalCall; $i++) {
        if (!$i) {
            $trace[$i] = ' +';
        } elseif ($i + 1 == $totalCall) {
            $trace[$i] = ' \\';
        } else {
            $trace[$i] = ' |';
        }
        $trace[$i] .= str_repeat('-', $totalCall - $i);
        $trace[$i] .= "> {$backtrace[$i]['file']}::{$backtrace[$i]['line']}\n";