示例#1
0
<?php

/*
 * This file is part of the Indigo Service application.
 *
 * (c) Indigo Development Team
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
defined('APP_ROOT') or define('APP_ROOT', realpath(__DIR__ . '/../'));
putenv('APP_ROOT=' . APP_ROOT);
defined('APP_ENV') or define('APP_ENV', getenv('APP_ENV') ?: 'development');
require APP_ROOT . '/vendor/autoload.php';
$app = (require APP_ROOT . '/app/bootstrap.php');
$app = $app['stack']->resolve($app);
Stack\run($app);
示例#2
0
<?php

/*
 * This file is part of the Jirro package.
 *
 * (c) Rendy Eko Prastiyo <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Symfony\Component\HttpFoundation\Request;
use Jirro\Component\Kernel\ApplicationFactory;
require_once __DIR__ . '/../bootstrap.php';
$application = $applicationFactory->createApplication(ApplicationFactory::TYPE_HTTP, $config);
$request = Request::createFromGlobals();
Request::setTrustedProxies(['127.0.0.1']);
Stack\run($application, $request);
<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server')) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check ' . basename(__FILE__) . ' for more information.');
}
$loader = (require_once __DIR__ . '/../app/bootstrap.php.cache');
Debug::enable();
require_once __DIR__ . '/../app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
Stack\run($kernel);
示例#4
0
<?php

/**
 * @copyright   2014 Mautic Contributors. All rights reserved
 * @author      Mautic
 *
 * @link        http://mautic.org
 *
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
define('MAUTIC_ROOT_DIR', __DIR__);
// Fix for hosts that do not have date.timezone set, it will be reset based on users settings
date_default_timezone_set('UTC');
use Mautic\Middleware\MiddlewareBuilder;
use Symfony\Component\ClassLoader\ApcClassLoader;
$loader = (require_once __DIR__ . '/app/autoload.php');
/**
 * Use APC for autoloading to improve performance. Change 'sf2' to a unique prefix
 * in order to prevent cache key conflicts with other applications also using APC.
 */
//$apcLoader = new ApcClassLoader('sf2', $loader);
//$loader->unregister();
//$apcLoader->register(true);
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
Stack\run((new MiddlewareBuilder('prod'))->resolve($kernel));