index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * The Front Controller for handling every request
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  7. *
  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.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  13. * @link https://cakephp.org CakePHP(tm) Project
  14. * @since 0.2.9
  15. * @license MIT License (https://opensource.org/licenses/mit-license.php)
  16. */
  17. // For built-in server
  18. // if (PHP_SAPI === 'cli-server') {
  19. // $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
  20. // $url = parse_url(urldecode($_SERVER['REQUEST_URI']));
  21. // $file = __DIR__ . $url['path'];
  22. // if (strpos($url['path'], '..') === false && strpos($url['path'], '.') !== false && is_file($file)) {
  23. // return false;
  24. // }
  25. // }
  26. require dirname(__DIR__) . '/vendor/autoload.php';
  27. use App\Application;
  28. use Cake\Http\Server;
  29. // Bind your application to the server.
  30. $server = new Server(new Application(dirname(__DIR__) . '/config'));
  31. // Run the request/response through the application and emit the response.
  32. $server->emit($server->run());