3 * The Front Controller for handling every request
5 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
8 * Licensed under The MIT License
9 * For full copyright and license information, please see the LICENSE.txt
10 * Redistributions of files must retain the above copyright notice.
12 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @link http://cakephp.org CakePHP(tm) Project
15 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
17 // for built-in server
18 if (php_sapi_name() === 'cli-server') {
19 $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
21 $url = parse_url(urldecode($_SERVER['REQUEST_URI']));
22 $file = __DIR__ . $url['path'];
23 if (strpos($url['path'], '..') === false && strpos($url['path'], '.') !== false && is_file($file)) {
27 require dirname(__DIR__) . '/vendor/autoload.php';
32 // Bind your application to the server.
33 $server = new Server(new Application(dirname(__DIR__) . '/config'));
35 // Run the request/response through the application
36 // and emit the response.
37 $server->emit($server->run());