Skip to content
Permalink
Browse files

Minor improvements to the front controller

  • Loading branch information...
ravage84 committed Oct 4, 2015
1 parent 6819564 commit 86da57d2be98ff2b4798b63ea2b837d41a4b2b82
Showing with 15 additions and 14 deletions.
  1. +3 −7 app/webroot/index.php
  2. +12 −7 lib/Cake/Console/Templates/skel/webroot/index.php
@@ -1,7 +1,5 @@
<?php
/**
* Index
*
* The Front Controller for handling every request
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
@@ -82,7 +80,7 @@
define('WWW_ROOT', dirname(__FILE__) . DS);
}
// for built-in server
// For the built-in server
if (PHP_SAPI === 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
return false;
@@ -97,10 +95,8 @@
if (!include 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
} else {
if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
} elseif (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
if (!empty($failed)) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
@@ -1,12 +1,19 @@
<?php
/**
* Index
*
* The Front Controller for handling every request
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.webroot
* @since CakePHP(tm) v 0.2.9
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
@@ -73,7 +80,7 @@
define('WWW_ROOT', dirname(__FILE__) . DS);
}
// for built-in server
// For the built-in server
if (PHP_SAPI === 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) {
return false;
@@ -88,10 +95,8 @@
if (!include 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
} else {
if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
} elseif (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') {
$failed = true;
}
if (!empty($failed)) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);

0 comments on commit 86da57d

Please sign in to comment.
You can’t perform that action at this time.