コード例 #1
0
ファイル: cli.php プロジェクト: niden/blog
use Phalcon\CLI\Console as PhConsoleApp;
use Phalcon\DI\FactoryDefault\CLI as PhCliDI;
use Kitsune\Bootstrap as KBootstrap;
/**
 * Using require once because I want to get the specific bootloader class
 * here. The loader will be initialized in my bootstrap class
 */
$path = dirname(dirname(dirname(__FILE__)));
/**
 * Composer and Codeception Coverage
 */
require_once $path . '/vendor/autoload.php';
require_once $path . '/library/Kitsune/Bootstrap.php';
$options = ['cli' => true];
$di_container = new PhCliDI();
$bootstrap = new KBootstrap();
$console_app = $bootstrap->run($di_container, $options);
/**
 * Put the console in the di_container because we need to use it in the
 * main task
 */
$di_container->setShared('console', $console_app);
/**
 * Process the console arguments
 */
$arguments = [];
foreach ($argv as $k => $arg) {
    if ($k == 1) {
        $arguments['task'] = $arg;
    } elseif ($k == 2) {
        $arguments['action'] = $arg;
コード例 #2
0
ファイル: index.php プロジェクト: niden/blog
<?php

/*
 +------------------------------------------------------------------------+
 | Kitsune                                                                |
 +------------------------------------------------------------------------+
 | Copyright (c) 2015 Phalcon Team and contributors                       |
 +------------------------------------------------------------------------+
 | This source file is subject to the New BSD License that is bundled     |
 | with this package in the file docs/LICENSE.txt.                        |
 |                                                                        |
 | If you did not receive a copy of the license and are unable to         |
 | obtain it through the world-wide-web, please send an email             |
 | to license@phalconphp.com so we can send you a copy immediately.       |
 +------------------------------------------------------------------------+
*/
use Phalcon\Di\FactoryDefault as PhDI;
use Kitsune\Bootstrap;
error_reporting(E_ALL);
try {
    require_once '../library/Kitsune/Bootstrap.php';
    $di = new PhDI();
    $bootstrap = new Bootstrap();
    echo $bootstrap->run($di, []);
} catch (\Exception $e) {
    if ($di->has('logger')) {
        $logger = $di->getShared('logger');
        $logger->error($e->getMessage());
        $logger->error('<pre>' . $e->getTraceAsString() . '</pre>');
    }
}
コード例 #3
0
ファイル: index.php プロジェクト: aisuhua/blog-1
<?php

/*
 +------------------------------------------------------------------------+
 | Kitsune                                                                |
 +------------------------------------------------------------------------+
 | Copyright (c) 2015 Phalcon Team and contributors                       |
 +------------------------------------------------------------------------+
 | This source file is subject to the New BSD License that is bundled     |
 | with this package in the file docs/LICENSE.txt.                        |
 |                                                                        |
 | If you did not receive a copy of the license and are unable to         |
 | obtain it through the world-wide-web, please send an email             |
 | to license@phalconphp.com so we can send you a copy immediately.       |
 +------------------------------------------------------------------------+
*/
use Phalcon\Di\FactoryDefault as PhDI;
use Kitsune\Bootstrap;
error_reporting(E_ALL);
try {
    require_once '../library/Kitsune/Bootstrap.php';
    $di = new PhDI();
    echo Bootstrap::run($di, []);
} catch (\Exception $e) {
    if ($di->has('logger')) {
        $logger = $di->getShared('logger');
        $logger->error($e->getMessage());
        $logger->error('<pre>' . $e->getTraceAsString() . '</pre>');
    }
}