paths.php

Go to the documentation of this file.
00001 <?php
00002 /* SVN FILE: $Id: paths_8php-source.html 580 2008-07-01 14:45:49Z 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: 580 $
00025  * @modifiedby      $LastChangedBy: gwoo $
00026  * @lastmodified    $Date: 2008-07-01 09:45:49 -0500 (Tue, 01 Jul 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 cake directory.
00043  */
00044     define ('CAKE', CORE_PATH.'cake'.DS);
00045 /**
00046  * Path to the application's directory.
00047  */
00048 if (!defined('APP')) {
00049     define ('APP', ROOT.DS.APP_DIR.DS);
00050 }
00051 /**
00052  * Path to the application's models directory.
00053  */
00054     define ('MODELS', APP.'models'.DS);
00055 /**
00056  * Path to model behaviors directory.
00057  */
00058     define ('BEHAVIORS', MODELS.'behaviors'.DS);
00059 /**
00060  * Path to the application's controllers directory.
00061  */
00062     define ('CONTROLLERS', APP.'controllers'.DS);
00063 /**
00064  * Path to the application's components directory.
00065  */
00066     define ('COMPONENTS', CONTROLLERS.'components'.DS);
00067 /**
00068  * Path to the application's views directory.
00069  */
00070     define ('VIEWS', APP.'views'.DS);
00071 /**
00072  * Path to the application's helpers directory.
00073  */
00074     define ('HELPERS', VIEWS.'helpers'.DS);
00075 /**
00076  * Path to the application's view's layouts directory.
00077  */
00078     define ('LAYOUTS', VIEWS.'layouts'.DS);
00079 /**
00080  * Path to the application's view's elements directory.
00081  * It's supposed to hold pieces of PHP/HTML that are used on multiple pages
00082  * and are not linked to a particular layout (like polls, footers and so on).
00083  */
00084     define ('ELEMENTS', VIEWS.'elements'.DS);
00085 /**
00086  * Path to the configuration files directory.
00087  */
00088 if (!defined('CONFIGS')) {
00089     define ('CONFIGS', APP.'config'.DS);
00090 }
00091 /**
00092  * Path to the libs directory.
00093  */
00094     define ('INFLECTIONS', CAKE.'config'.DS.'inflections'.DS);
00095 /**
00096  * Path to the libs directory.
00097  */
00098     define ('LIBS', CAKE.'libs'.DS);
00099 /**
00100  * Path to the public CSS directory.
00101  */
00102     define ('CSS', WWW_ROOT.'css'.DS);
00103 /**
00104  * Path to the public JavaScript directory.
00105  */
00106     define ('JS', WWW_ROOT.'js'.DS);
00107 /**
00108  * Path to the public images directory.
00109  */
00110     define ('IMAGES', WWW_ROOT.'img'.DS);
00111 /**
00112  * Path to the console libs direcotry.
00113  */
00114     define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS);
00115 /**
00116  * Path to the tests directory.
00117  */
00118 if (!defined('TESTS')) {
00119     define ('TESTS', APP.'tests'.DS);
00120 }
00121 /**
00122  * Path to the core tests directory.
00123  */
00124 if (!defined('CAKE_TESTS')) {
00125     define ('CAKE_TESTS', CAKE.'tests'.DS);
00126 }
00127 /**
00128  * Path to the test suite.
00129  */
00130     define ('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS);
00131 
00132 /**
00133  * Path to the controller test directory.
00134  */
00135     define ('CONTROLLER_TESTS', TESTS.'cases'.DS.'controllers'.DS);
00136 /**
00137  * Path to the components test directory.
00138  */
00139     define ('COMPONENT_TESTS', TESTS.'cases'.DS.'components'.DS);
00140 /**
00141  * Path to the helpers test directory.
00142  */
00143     define ('HELPER_TESTS', TESTS.'cases'.DS.'views'.DS.'helpers'.DS);
00144 /**
00145  * Path to the models' test directory.
00146  */
00147     define ('MODEL_TESTS', TESTS.'cases'.DS.'models'.DS);
00148 /**
00149  * Path to the lib test directory.
00150  */
00151     define ('LIB_TESTS', CAKE_TESTS.'cases'.DS.'lib'.DS);
00152 /**
00153  * Path to the temporary files directory.
00154  */
00155 if (!defined('TMP')) {
00156     define ('TMP', APP.'tmp'.DS);
00157 }
00158 /**
00159  * Path to the logs directory.
00160  */
00161     define ('LOGS', TMP.'logs'.DS);
00162 /**
00163  * Path to the cache files directory. It can be shared between hosts in a multi-server setup.
00164  */
00165     define('CACHE', TMP.'cache'.DS);
00166 /**
00167  * Path to the vendors directory.
00168  */
00169 if (!defined('VENDORS')) {
00170     define ('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS);
00171 }
00172 /**
00173  * Path to the Pear directory
00174  * The purporse is to make it easy porting Pear libs into Cake
00175  * without setting the include_path PHP variable.
00176  */
00177     define ('PEAR', VENDORS.'Pear'.DS);
00178 /**
00179  *  Full url prefix
00180  */
00181 if (!defined('FULL_BASE_URL')) {
00182     $s = null;
00183     if (env('HTTPS')) {
00184         $s ='s';
00185     }
00186 
00187     $httpHost = env('HTTP_HOST');
00188 
00189     if (isset($httpHost)) {
00190         define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost);
00191     }
00192     unset($httpHost, $s);
00193 }
00194 /**
00195  * Web path to the public images directory.
00196  */
00197 if (!defined('IMAGES_URL')) {
00198     define ('IMAGES_URL', 'img/');
00199 }
00200 /**
00201  * Web path to the CSS files directory.
00202  */
00203 if (!defined('CSS_URL')) {
00204     define ('CSS_URL', 'css/');
00205 }
00206 /**
00207  * Web path to the js files directory.
00208  */
00209 if (!defined('JS_URL')) {
00210     define ('JS_URL', 'js/');
00211 }
00212 ?>