Exemplo n.º 1
0
<?php

use Symfony\Component\HttpFoundation\Request;
$loader = (require __DIR__ . '/../app/autoload.php');
require_once __DIR__ . '/../app/MicroKernel.php';
$app = new MicroKernel('prod', true);
$app->loadClassCache();
$app->handle(Request::createFromGlobals())->send();
Exemplo n.º 2
0
<?php

use Symfony\Component\HttpFoundation\Request;
$loader = (require __DIR__ . '/../config/autoload.php');
require_once __DIR__ . '/../MicroKernel.php';
$kernel = new MicroKernel('prod', false);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Exemplo n.º 3
0
<?php

// Save the project root directory as a global constant.
define('ROOT_PATH', __DIR__);
/*
 * Create a global constant used to get the filesystem path to the
 * application configuration directory.
 */
define('CFG_PATH', realpath(ROOT_PATH . '/application/config'));
/*
 * Create a global constant used to get the filesystem path to the
 * application public web root directory.
 *
 * Can be used to handle file uploads for example.
 */
define('WWW_PATH', realpath(ROOT_PATH . '/application/www'));
require_once 'library/Configuration.class.php';
require_once 'library/Database.class.php';
require_once 'library/FlashBag.class.php';
require_once 'library/Form.class.php';
require_once 'library/FrontController.class.php';
require_once 'library/MicroKernel.class.php';
require_once 'library/Http.class.php';
require_once 'library/InterceptingFilter.interface.php';
$microKernel = new MicroKernel();
$microKernel->bootstrap()->run(new FrontController());
Exemplo n.º 4
0
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#checking-symfony-application-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.');
}
/**
 * @var Composer\Autoload\ClassLoader $loader
 */
$loader = (require __DIR__ . '/../app/autoload.php');
require_once __DIR__ . '/../app/MicroKernel.php';
Debug::enable();
$app = new MicroKernel('dev', true);
$app->loadClassCache();
$request = Request::createFromGlobals();
$response = $app->handle($request);
$response->send();
$app->terminate($request, $response);
//$kernel = new AppKernel('dev', true);
//$kernel->loadClassCache();
//$request = Request::createFromGlobals();
//$response = $kernel->handle($request);
//$response->send();
//$kernel->terminate($request, $response);
Exemplo n.º 5
0
<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
$loader = (require __DIR__ . '/../config/autoload.php');
require_once __DIR__ . '/../MicroKernel.php';
Debug::enable();
$kernel = new MicroKernel('dev', true);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);