mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #7508 from ravage84/2.7-index
Minor improvements to the front controller
This commit is contained in:
commit
19ad6dcef2
2 changed files with 15 additions and 14 deletions
|
@ -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 @@ if (!defined('WWW_ROOT')) {
|
|||
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 (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
|||
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 @@ if (!defined('WWW_ROOT')) {
|
|||
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 (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue