2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Basic Cake functionality.
|
|
|
|
*
|
2009-05-01 14:05:46 -07:00
|
|
|
* Handles loading of core files needed on every request
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2010-10-03 12:38:58 -04:00
|
|
|
* PHP 5
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-05-01 14:05:46 -07:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2011-05-29 17:31:39 -04:00
|
|
|
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2011-05-29 17:31:39 -04:00
|
|
|
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2010-01-26 17:03:03 -05:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2011-07-26 01:46:14 -04:30
|
|
|
* @package Cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 0.2.9
|
2009-05-01 14:05:46 -07:00
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2009-07-31 11:48:30 -04:00
|
|
|
if (!defined('E_DEPRECATED')) {
|
2009-08-01 08:36:57 -04:00
|
|
|
define('E_DEPRECATED', 8192);
|
2009-07-31 11:48:30 -04:00
|
|
|
}
|
2009-08-01 08:36:57 -04:00
|
|
|
error_reporting(E_ALL & ~E_DEPRECATED);
|
|
|
|
|
2011-07-28 13:44:07 -04:00
|
|
|
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
|
|
|
define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(__FILE__)));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!defined('CORE_PATH')) {
|
|
|
|
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!defined('WEBROOT_DIR')) {
|
|
|
|
define('WEBROOT_DIR', 'webroot');
|
|
|
|
}
|
2010-12-03 19:48:44 -04:30
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the cake directory.
|
|
|
|
*/
|
2010-12-07 01:26:10 -04:30
|
|
|
define('CAKE', CORE_PATH . 'Cake' . DS);
|
2010-12-03 19:48:44 -04:30
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the application's directory.
|
|
|
|
*/
|
|
|
|
if (!defined('APP')) {
|
|
|
|
define('APP', ROOT.DS.APP_DIR.DS);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the application's libs directory.
|
|
|
|
*/
|
2011-04-17 12:37:00 +02:00
|
|
|
define('APPLIBS', APP.'Lib'.DS);
|
2010-12-03 19:48:44 -04:30
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the public CSS directory.
|
|
|
|
*/
|
|
|
|
define('CSS', WWW_ROOT.'css'.DS);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the public JavaScript directory.
|
|
|
|
*/
|
|
|
|
define('JS', WWW_ROOT.'js'.DS);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the public images directory.
|
|
|
|
*/
|
|
|
|
define('IMAGES', WWW_ROOT.'img'.DS);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the tests directory.
|
|
|
|
*/
|
|
|
|
if (!defined('TESTS')) {
|
2011-05-13 01:53:49 -04:30
|
|
|
define('TESTS', APP.'Test'.DS);
|
2010-12-03 19:48:44 -04:30
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the temporary files directory.
|
|
|
|
*/
|
|
|
|
if (!defined('TMP')) {
|
|
|
|
define('TMP', APP.'tmp'.DS);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the logs directory.
|
|
|
|
*/
|
|
|
|
define('LOGS', TMP.'logs'.DS);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the cache files directory. It can be shared between hosts in a multi-server setup.
|
|
|
|
*/
|
|
|
|
define('CACHE', TMP.'cache'.DS);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path to the vendors directory.
|
|
|
|
*/
|
|
|
|
if (!defined('VENDORS')) {
|
2011-03-09 22:11:13 -04:30
|
|
|
define('VENDORS', ROOT . DS . 'vendors' . DS);
|
2010-12-03 19:48:44 -04:30
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Web path to the public images directory.
|
|
|
|
*/
|
|
|
|
if (!defined('IMAGES_URL')) {
|
|
|
|
define('IMAGES_URL', 'img/');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Web path to the CSS files directory.
|
|
|
|
*/
|
|
|
|
if (!defined('CSS_URL')) {
|
|
|
|
define('CSS_URL', 'css/');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Web path to the js files directory.
|
|
|
|
*/
|
|
|
|
if (!defined('JS_URL')) {
|
|
|
|
define('JS_URL', 'js/');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-17 12:35:21 +02:00
|
|
|
require CAKE . 'basics.php';
|
|
|
|
require CAKE . 'Core' . DS .'App.php';
|
|
|
|
require CAKE . 'Error' . DS . 'exceptions.php';
|
2010-12-03 20:53:47 -04:30
|
|
|
|
2010-12-05 10:54:42 -04:30
|
|
|
spl_autoload_register(array('App', 'load'));
|
|
|
|
|
2010-12-04 02:16:51 -04:30
|
|
|
App::uses('ErrorHandler', 'Error');
|
2010-12-03 20:53:47 -04:30
|
|
|
App::uses('Configure', 'Core');
|
|
|
|
App::uses('Cache', 'Cache');
|
2010-12-04 02:34:30 -04:30
|
|
|
App::uses('Object', 'Core');
|
2011-07-15 20:44:39 -04:30
|
|
|
App::$bootstrapping = true;
|
2010-12-03 19:48:44 -04:30
|
|
|
|
2010-12-03 20:53:47 -04:30
|
|
|
Configure::bootstrap(isset($boot) ? $boot : true);
|
2010-12-03 19:48:44 -04:30
|
|
|
|
|
|
|
/**
|
|
|
|
* Full url prefix
|
|
|
|
*/
|
|
|
|
if (!defined('FULL_BASE_URL')) {
|
|
|
|
$s = null;
|
|
|
|
if (env('HTTPS')) {
|
|
|
|
$s ='s';
|
|
|
|
}
|
2010-09-01 20:29:55 -04:00
|
|
|
|
2010-12-03 19:48:44 -04:30
|
|
|
$httpHost = env('HTTP_HOST');
|
2010-09-02 17:00:52 -04:00
|
|
|
|
2010-12-03 19:48:44 -04:30
|
|
|
if (isset($httpHost)) {
|
|
|
|
define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost);
|
|
|
|
}
|
|
|
|
unset($httpHost, $s);
|
2011-01-02 02:00:03 -04:30
|
|
|
}
|