paths.php
Go to the documentation of this file.00001 <?php 00002 /* SVN FILE: $Id: paths_8php-source.html 675 2008-12-26 00:27:14Z gwoo $ */ 00003 /** 00004 * Short description for file. 00005 * 00006 * In this file you set paths to different directories used by Cake. 00007 * 00008 * PHP versions 4 and 5 00009 * 00010 * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> 00011 * Copyright 2005-2008, Cake Software Foundation, Inc. 00012 * 1785 E. Sahara Avenue, Suite 490-204 00013 * Las Vegas, Nevada 89104 00014 * 00015 * Licensed under The MIT License 00016 * Redistributions of files must retain the above copyright notice. 00017 * 00018 * @filesource 00019 * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. 00020 * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project 00021 * @package cake 00022 * @subpackage cake.cake.app.config 00023 * @since CakePHP(tm) v 0.2.9 00024 * @version $Revision: 675 $ 00025 * @modifiedby $LastChangedBy: gwoo $ 00026 * @lastmodified $Date: 2008-12-25 16:27:14 -0800 (Thu, 25 Dec 2008) $ 00027 * @license http://www.opensource.org/licenses/mit-license.php The MIT License 00028 */ 00029 /** 00030 * If the index.php file is used instead of an .htaccess file 00031 * or if the user can not set the web root to use the public 00032 * directory we will define ROOT there, otherwise we set it 00033 * here. 00034 */ 00035 if (!defined('ROOT')) { 00036 define ('ROOT', '../'); 00037 } 00038 if (!defined('WEBROOT_DIR')) { 00039 define ('WEBROOT_DIR', 'webroot'); 00040 } 00041 /** 00042 * Path to the application's directory. 00043 */ 00044 define ('CAKE', CORE_PATH.'cake'.DS); 00045 /** 00046 * Path to the application's directory. 00047 */ 00048 define ('APP', ROOT.DS.APP_DIR.DS); 00049 /** 00050 * Path to the application's models directory. 00051 */ 00052 define ('MODELS', APP.'models'.DS); 00053 /** 00054 * Path to the application's controllers directory. 00055 */ 00056 define ('CONTROLLERS', APP.'controllers'.DS); 00057 /** 00058 * Path to the application's controllers directory. 00059 */ 00060 define ('COMPONENTS', CONTROLLERS.'components'.DS); 00061 /** 00062 * Path to the application's views directory. 00063 */ 00064 define ('VIEWS', APP.'views'.DS); 00065 /** 00066 * Path to the application's helpers directory. 00067 */ 00068 define ('HELPERS', VIEWS.'helpers'.DS); 00069 /** 00070 * Path to the application's view's layouts directory. 00071 */ 00072 define ('LAYOUTS', VIEWS.'layouts'.DS); 00073 /** 00074 * Path to the application's view's elements directory. 00075 * It's supposed to hold pieces of PHP/HTML that are used on multiple pages 00076 * and are not linked to a particular layout (like polls, footers and so on). 00077 */ 00078 define ('ELEMENTS', VIEWS.'elements'.DS); 00079 /** 00080 * Path to the configuration files directory. 00081 */ 00082 define ('CONFIGS', APP.'config'.DS); 00083 /** 00084 * Path to the libs directory. 00085 */ 00086 define ('INFLECTIONS', CAKE.'config'.DS.'inflections'.DS); 00087 /** 00088 * Path to the libs directory. 00089 */ 00090 define ('LIBS', CAKE.'libs'.DS); 00091 /** 00092 * Path to the public directory. 00093 */ 00094 define ('CSS', WWW_ROOT.'css'.DS); 00095 /** 00096 * Path to the public directory. 00097 */ 00098 define ('JS', WWW_ROOT.'js'.DS); 00099 /** 00100 * Path to the scripts direcotry. 00101 */ 00102 define('SCRIPTS', CAKE.'scripts'.DS); 00103 /** 00104 * Path to the tests directory. 00105 */ 00106 define ('TESTS', APP.'tests'.DS); 00107 /** 00108 * Path to the controller test directory. 00109 */ 00110 define ('CONTROLLER_TESTS', TESTS.'cases'.DS.'controllers'.DS); 00111 /** 00112 * Path to the components test directory. 00113 */ 00114 define ('COMPONENT_TESTS', TESTS.'cases'.DS.'components'.DS); 00115 /** 00116 * Path to the helpers test directory. 00117 */ 00118 define ('HELPER_TESTS', TESTS.'cases'.DS.'views'.DS.'helpers'.DS); 00119 /** 00120 * Path to the models' test directory. 00121 */ 00122 define ('MODEL_TESTS', TESTS.'cases'.DS.'models'.DS); 00123 /** 00124 * Path to the lib test directory. 00125 */ 00126 define ('LIB_TESTS', TESTS.'lib'.DS); 00127 /** 00128 * Path to the temporary files directory. 00129 */ 00130 define ('TMP', APP.'tmp'.DS); 00131 /** 00132 * Path to the logs directory. 00133 */ 00134 define ('LOGS', TMP.'logs'.DS); 00135 /** 00136 * Path to the cache files directory. It can be shared between hosts in a multi-server setup. 00137 */ 00138 define('CACHE', TMP.'cache'.DS); 00139 /** 00140 * Path to the vendors directory. 00141 */ 00142 define ('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS); 00143 /** 00144 * Path to the Pear directory 00145 * The purporse is to make it easy porting Pear libs into Cake 00146 * without setting the include_path PHP variable. 00147 */ 00148 define ('PEAR', VENDORS.'Pear'.DS); 00149 /** 00150 * Full url prefix 00151 */ 00152 $s = null; 00153 if (env('HTTPS')) { 00154 $s ='s'; 00155 } 00156 00157 $httpHost = env('HTTP_HOST'); 00158 00159 if (isset($httpHost)) { 00160 define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost); 00161 } 00162 unset($httpHost, $s); 00163 /** 00164 * Web path to the public images directory. 00165 */ 00166 define ('IMAGES_URL', 'img/'); 00167 /** 00168 * Web path to the CSS files directory. 00169 */ 00170 define ('CSS_URL', 'css/'); 00171 /** 00172 * Web path to the js files directory. 00173 */ 00174 define ('JS_URL', 'js/'); 00175 ?>