2011-11-26 10:45:31 +01:00
< ? php
/**
* Index
*
* The Front Controller for handling every request
*
2012-03-15 15:06:45 +01:00
* PHP 5
2011-11-26 10:45:31 +01:00
*
* CakePHP ( tm ) : Rapid Development Framework ( http :// cakephp . org )
2012-09-25 15:41:58 +02:00
* Copyright 2005 - 2012 , Cake Software Foundation , Inc . ( http :// cakefoundation . org )
2011-11-26 10:45:31 +01:00
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice .
*
2012-09-25 15:41:58 +02:00
* @ copyright Copyright 2005 - 2012 , Cake Software Foundation , Inc . ( http :// cakefoundation . org )
2011-11-26 10:45:31 +01:00
* @ link http :// cakephp . org CakePHP ( tm ) Project
2012-03-15 15:06:45 +01:00
* @ package app . webroot
2011-11-26 10:45:31 +01:00
* @ since CakePHP ( tm ) v 0.2 . 9
* @ license MIT License ( http :// www . opensource . org / licenses / mit - license . php )
*/
/**
* Use the DS to separate the directories in other defines
*/
2012-09-25 15:41:58 +02:00
if ( ! defined ( 'DS' )) {
define ( 'DS' , DIRECTORY_SEPARATOR );
}
2011-11-26 10:45:31 +01:00
/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed .
* When using custom settings be sure to use the DS and do not add a trailing DS .
*/
/**
* The full path to the directory which holds " app " , WITHOUT a trailing DS .
*/
2012-09-25 15:41:58 +02:00
if ( ! defined ( 'ROOT' )) {
2021-11-20 16:37:59 +01:00
define ( 'ROOT' , dirname ( __DIR__ , 2 ));
2012-09-25 15:41:58 +02:00
}
2011-11-26 10:45:31 +01:00
/**
* The actual directory name for the " app " .
*/
2012-09-25 15:41:58 +02:00
if ( ! defined ( 'APP_DIR' )) {
2021-11-20 16:37:59 +01:00
define ( 'APP_DIR' , basename ( dirname ( __DIR__ )));
2012-09-25 15:41:58 +02:00
}
2012-03-15 15:06:45 +01:00
2011-11-26 10:45:31 +01:00
/**
2021-06-12 19:31:19 +02:00
* This auto - detects CakePHP as a composer installed library .
* You may remove this if you are not planning to use composer ( not recommended , though ) .
2011-11-26 10:45:31 +01:00
*/
2021-06-12 19:31:19 +02:00
$vendorPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib' ;
$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php' ;
if ( ! defined ( 'CAKE_CORE_INCLUDE_PATH' ) && file_exists ( $vendorPath . DS . $dispatcher )) {
define ( 'CAKE_CORE_INCLUDE_PATH' , $vendorPath );
} else {
/**
* The absolute path to the " cake " directory , WITHOUT a trailing DS .
*
* Un - comment this line to specify a fixed path to CakePHP .
* This should point at the directory containing `Cake` .
*
* For ease of development CakePHP uses PHP ' s include_path . If you
* cannot modify your include_path set this value .
*
* Leaving this constant undefined will result in it being defined in Cake / bootstrap . php
*/
define ( 'CAKE_CORE_INCLUDE_PATH' , ROOT . DS . APP_DIR . DS . 'Lib' . DS . 'cakephp' . DS . 'lib' );
}
2011-11-26 10:45:31 +01:00
/**
* Editing below this line should NOT be necessary .
* Change at your own risk .
*/
2012-09-25 15:41:58 +02:00
if ( ! defined ( 'WEBROOT_DIR' )) {
2021-11-20 16:37:59 +01:00
define ( 'WEBROOT_DIR' , basename ( __DIR__ ));
2012-09-25 15:41:58 +02:00
}
if ( ! defined ( 'WWW_ROOT' )) {
2021-11-20 16:37:59 +01:00
define ( 'WWW_ROOT' , __DIR__ . DS );
2012-09-25 15:41:58 +02:00
}
2012-03-15 15:06:45 +01:00
2012-09-25 15:41:58 +02:00
if ( ! defined ( 'CAKE_CORE_INCLUDE_PATH' )) {
if ( function_exists ( 'ini_set' )) {
ini_set ( 'include_path' , ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get ( 'include_path' ));
2011-11-26 10:45:31 +01:00
}
2012-09-25 15:41:58 +02:00
if ( ! include ( 'Cake' . DS . 'bootstrap.php' )) {
$failed = true ;
2011-11-26 10:45:31 +01:00
}
2012-09-25 15:41:58 +02:00
} else {
if ( ! include ( CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php' )) {
$failed = true ;
2011-11-26 10:45:31 +01:00
}
2012-09-25 15:41:58 +02:00
}
if ( ! empty ( $failed )) {
2021-06-12 19:31:19 +02:00
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 );
2012-09-25 15:41:58 +02:00
}
2012-03-15 15:06:45 +01:00
2023-11-24 13:47:59 +01:00
require_once dirname ( __DIR__ ) . '/Model/Attribute.php' ; // FIXME workaround bug where Vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php is loaded instead
2012-09-25 15:41:58 +02:00
App :: uses ( 'Dispatcher' , 'Routing' );
2012-03-15 15:06:45 +01:00
2012-09-25 15:41:58 +02:00
$Dispatcher = new Dispatcher ();
$Dispatcher -> dispatch ( new CakeRequest (), new CakeResponse ( array ( 'charset' => Configure :: read ( 'App.encoding' ))));