Changeset a42ace5079b711cff1c0078740ad0bb7a735e0fc
- Timestamp:
- 01/28/12 18:44:10 (4 months ago)
- Children:
- e2681da508f3815896c5e70ee7e22b7019dc8286
- Parents:
- ee4c2b7fedeac65c7bf3af2de933963981702433
- git-committer:
- Xemle <xemle@phtagr.org> / 2012-01-28T18:44:10Z+0100
- Files:
-
- 5 modified
-
Config/bootstrap.php (modified) (5 diffs)
-
Config/core.php (modified) (14 diffs)
-
Config/routes.php (modified) (3 diffs)
-
webroot/index.php (modified) (5 diffs)
-
webroot/test.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Config/bootstrap.php
re449ecc0 ra42ace5 1 1 <?php 2 2 /** 3 * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php3 * This file is loaded automatically by the app/webroot/index.php file after core.php 4 4 * 5 * This is an application wide file to load any function that is not used within a class6 * define. You can also use this to include or require any files in your application.5 * This file should load/create any application wide configuration settings, such as 6 * Caching, Logging, loading additional configuration files. 7 7 * 8 * PHP versions 4 and 5 8 * You should also use this file to include any files that provide global functions/constants 9 * that your application uses. 10 * 11 * PHP 5 9 12 * 10 13 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 11 * Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)14 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 12 15 * 13 16 * Licensed under The MIT License 14 17 * Redistributions of files must retain the above copyright notice. 15 18 * 16 * @copyright Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)19 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 17 20 * @link http://cakephp.org CakePHP(tm) Project 18 * @package cake 19 * @subpackage cake.app.config 21 * @package app.Config 20 22 * @since CakePHP(tm) v 0.10.8.2117 21 23 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 22 24 */ 23 25 26 // Setup a 'default' cache configuration for use in the application. 27 Cache::config('default', array('engine' => 'File')); 28 24 29 /** 25 30 * The settings below can be used to set additional paths to models, views and controllers. 26 * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)27 31 * 28 32 * App::build(array( 29 * ' plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),30 * ' models' => array('/full/path/to/models/', '/next/full/path/to/models/'),31 * ' views' => array('/full/path/to/views/', '/next/full/path/to/views/'),32 * ' controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),33 * ' datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),34 * ' behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),35 * ' components' => array('/full/path/to/components/', '/next/full/path/to/components/'),36 * ' helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),37 * ' vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),38 * ' shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),33 * 'Plugin' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'), 34 * 'Model' => array('/full/path/to/models/', '/next/full/path/to/models/'), 35 * 'View' => array('/full/path/to/views/', '/next/full/path/to/views/'), 36 * 'Controller' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'), 37 * 'Model/Datasource' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'), 38 * 'Model/Behavior' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'), 39 * 'Controller/Component' => array('/full/path/to/components/', '/next/full/path/to/components/'), 40 * 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'), 41 * 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'), 42 * 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'), 39 43 * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') 40 44 * )); … … 43 47 44 48 /** 45 * As of 1.3, additional rules for the inflector are added below 49 * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other 50 * string is passed to the inflection functions 46 51 * 47 52 * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); … … 51 56 Inflector::rules('plural', array('uninflected' => array('[Bb]rowser'))); 52 57 Inflector::rules('singular', array('uninflected' => array('pos'))); 58 59 /** 60 * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call 61 * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more 62 * advanced ways of loading plugins 63 * 64 * CakePlugin::loadAll(); // Loads all plugins at once 65 * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit 66 * 67 */ 68 69 /** 70 * User storage directory 71 */ 72 if (!defined('USER_DIR')) { 73 define('USER_DIR', APP . 'users' . DS); 74 } 75 76 /** 77 * Configuration directory 78 */ 79 if (!defined('CONFIGS')) { 80 define('CONFIGS', APP . 'Config' . DS); 81 } 53 82 54 83 define('ROLE_NOBODY', 0); … … 125 154 define("LOCATION_COUNTRY", 0x04); 126 155 127 /** Add pear path within vendor path to the include_path */ 156 /** 157 * Add pear path within vendor path to the include_path 158 */ 128 159 if (function_exists('ini_set') && function_exists('ini_get')) { 129 160 $path = ini_get('include_path'); … … 131 162 ini_set('include_path', $vendorPearPath . PATH_SEPARATOR . ini_get('include_path')); 132 163 } 133 //EOF 134 ?> 164 -
Config/core.php
re449ecc0 ra42ace5 5 5 * Use it to configure core behavior of Cake. 6 6 * 7 * PHP versions 4 and57 * PHP 5 8 8 * 9 9 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 10 * Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)10 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 11 11 * 12 12 * Licensed under The MIT License 13 13 * Redistributions of files must retain the above copyright notice. 14 14 * 15 * @copyright Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)15 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 16 16 * @link http://cakephp.org CakePHP(tm) Project 17 * @package cake 18 * @subpackage cake.app.config 17 * @package app.Config 19 18 * @since CakePHP(tm) v 0.2.9 20 19 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) … … 34 33 * In development mode, you need to click the flash message to continue. 35 34 */ 36 Configure::write('debug', 0); 37 38 /** 39 * CakePHP Log Level: 40 * 41 * In case of Production Mode CakePHP gives you the possibility to continue logging errors. 42 * 43 * The following parameters can be used: 44 * Boolean: Set true/false to activate/deactivate logging 45 * Configure::write('log', true); 46 * 47 * Integer: Use built-in PHP constants to set the error level (see error_reporting) 48 * Configure::write('log', E_ERROR | E_WARNING); 49 * Configure::write('log', E_ALL ^ E_NOTICE); 50 */ 51 Configure::write('log', true); 35 Configure::write('debug', 1); 36 37 /** 38 * Configure the Error handler used to handle errors for your application. By default 39 * ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0 40 * and log errors with CakeLog when debug = 0. 41 * 42 * Options: 43 * 44 * - `handler` - callback - The callback to handle errors. You can set this to any callback type, 45 * including anonymous functions. 46 * - `level` - int - The level of errors you are interested in capturing. 47 * - `trace` - boolean - Include stack traces for errors in log files. 48 * 49 * @see ErrorHandler for more information on error handling and configuration. 50 */ 51 Configure::write('Error', array( 52 'handler' => 'ErrorHandler::handleError', 53 'level' => E_ALL & ~E_DEPRECATED, 54 'trace' => true 55 )); 56 57 /** 58 * Configure the Exception handler used for uncaught exceptions. By default, 59 * ErrorHandler::handleException() is used. It will display a HTML page for the exception, and 60 * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0, 61 * framework errors will be coerced into generic HTTP errors. 62 * 63 * Options: 64 * 65 * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type, 66 * including anonymous functions. 67 * - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you 68 * should place the file for that class in app/Lib/Error. This class needs to implement a render method. 69 * - `log` - boolean - Should Exceptions be logged? 70 * 71 * @see ErrorHandler for more information on exception handling and configuration. 72 */ 73 Configure::write('Exception', array( 74 'handler' => 'ErrorHandler::handleException', 75 'renderer' => 'ExceptionRenderer', 76 'log' => true 77 )); 52 78 53 79 /** … … 56 82 Configure::write('App.encoding', 'UTF-8'); 57 83 58 /**84 /** 59 85 * In some php versions escapeshellarg() removes special characters like german 60 86 * umlaut. This bug causes wrong system calls to files like import of media … … 66 92 * http://bugs.php.net/bug.php?id=44564 67 93 */ 68 //setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8");69 94 //setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8"); 95 70 96 /** 71 97 * To configure CakePHP *not* to use mod_rewrite and to … … 96 122 * `manager_index()` and `/manager/controller/index` 97 123 * 98 * [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead]99 */ 124 */ 125 //Configure::write('Routing.prefixes', array('admin')); 100 126 Configure::write('Routing.prefixes', array('admin')); 101 127 … … 110 136 * 111 137 * If set to true, for view caching you must still use the controller 112 * var$cacheAction inside your controllers to define caching settings.113 * You can either set it controller-wide by setting var$cacheAction = true,138 * public $cacheAction inside your controllers to define caching settings. 139 * You can either set it controller-wide by setting public $cacheAction = true, 114 140 * or in each action using $this->cacheAction = true. 115 141 * … … 124 150 125 151 /** 126 * The preferred session handling method. Valid values: 127 * 128 * 'php' Uses settings defined in your php.ini. 129 * 'cake' Saves session files in CakePHP's /tmp directory. 130 * 'database' Uses CakePHP's database sessions. 131 * 132 * To define a custom session handler, save it at /app/config/<name>.php. 133 * Set the value of 'Session.save' to <name> to utilize it in CakePHP. 134 * 135 * To use database sessions, run the app/config/schema/sessions.php schema using 136 * the cake shell command: cake schema run create Sessions 137 * 138 */ 139 Configure::write('Session.save', 'php'); 140 141 /** 142 * The model name to be used for the session model. 143 * 144 * 'Session.save' must be set to 'database' in order to utilize this constant. 145 * 146 * The model name set here should *not* be used elsewhere in your application. 147 */ 148 //Configure::write('Session.model', 'Session'); 149 150 /** 151 * The name of the table used to store CakePHP database sessions. 152 * 153 * 'Session.save' must be set to 'database' in order to utilize this constant. 154 * 155 * The table name set here should *not* include any table prefix defined elsewhere. 156 * 157 * Please note that if you set a value for Session.model (above), any value set for 158 * Session.table will be ignored. 159 * 160 * [Note: Session.table is deprecated as of CakePHP 1.3] 161 */ 162 //Configure::write('Session.table', 'cake_sessions'); 163 164 /** 165 * The DATABASE_CONFIG::$var to use for database session handling. 166 * 167 * 'Session.save' must be set to 'database' in order to utilize this constant. 168 */ 169 //Configure::write('Session.database', 'default'); 170 171 /** 172 * The name of CakePHP's session cookie. 173 * 174 * Note the guidelines for Session names states: "The session name references 175 * the session id in cookies and URLs. It should contain only alphanumeric 176 * characters." 177 * @link http://php.net/session_name 178 */ 179 Configure::write('Session.cookie', 'CAKEPHP'); 180 181 /** 182 * Session time out time (in seconds). 183 * Actual value depends on 'Security.level' setting. 184 */ 185 Configure::write('Session.timeout', '120'); 186 187 /** 188 * If set to false, sessions are not automatically started. 189 */ 190 Configure::write('Session.start', true); 191 192 /** 193 * When set to false, HTTP_USER_AGENT will not be checked 194 * in the session 195 */ 196 Configure::write('Session.checkAgent', true); 197 198 /** 199 * The level of CakePHP security. The session timeout time defined 200 * in 'Session.timeout' is multiplied according to the settings here. 201 * Valid values: 202 * 203 * 'high' Session timeout in 'Session.timeout' x 10 204 * 'medium' Session timeout in 'Session.timeout' x 5040 205 * 'low' Session timeout in 'Session.timeout' x 2628000 206 * 207 * CakePHP session IDs are also regenerated between requests if 208 * 'Security.level' is set to 'high'. 152 * Configuration of phTagr's logger 153 */ 154 Configure::write('Logger.enable', true); 155 Configure::write('Logger.level', 1); 156 Configure::write('Logger.file', TMP.'logs'.DS.'logger.log'); 157 158 /** 159 * Session configuration. 160 * 161 * Contains an array of settings to use for session configuration. The defaults key is 162 * used to define a default preset to use for sessions, any settings declared here will override 163 * the settings of the default config. 164 * 165 * ## Options 166 * 167 * - `Session.cookie` - The name of the cookie to use. Defaults to 'CAKEPHP' 168 * - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP 169 * - `Session.cookieTimeout` - The number of minutes you want session cookies to live for. 170 * - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the 171 * value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX 172 * - `Session.defaults` - The default configuration set to use as a basis for your session. 173 * There are four builtins: php, cake, cache, database. 174 * - `Session.handler` - Can be used to enable a custom session handler. Expects an array of of callables, 175 * that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler` 176 * to the ini array. 177 * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and 178 * sessionids that change frequently. See CakeSession::$requestCountdown. 179 * - `Session.ini` - An associative array of additional ini values to set. 180 * 181 * The built in defaults are: 182 * 183 * - 'php' - Uses settings defined in your php.ini. 184 * - 'cake' - Saves session files in CakePHP's /tmp directory. 185 * - 'database' - Uses CakePHP's database sessions. 186 * - 'cache' - Use the Cache class to save sessions. 187 * 188 * To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php. 189 * Make sure the class implements `CakeSessionHandlerInterface` and set Session.handler to <name> 190 * 191 * To use database sessions, run the app/Config/Schema/sessions.php schema using 192 * the cake shell command: cake schema create Sessions 193 * 194 */ 195 Configure::write('Session', array( 196 'defaults' => 'php' 197 )); 198 199 /** 200 * The level of CakePHP security. 209 201 */ 210 202 Configure::write('Security.level', 'medium'); … … 225 217 * useful for invalidating browser caches. 226 218 * 227 * Set to `true` to apply timestamps , when debug = 0, or set to 'force' to always enable228 * timestamping .219 * Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable 220 * timestamping regardless of debug value. 229 221 */ 230 222 //Configure::write('Asset.timestamp', true); 223 231 224 /** 232 225 * Compress CSS output by removing comments, whitespace, repeating tags, etc. … … 237 230 */ 238 231 //Configure::write('Asset.filter.css', 'css.php'); 239 /**240 * Configuration for PHamlP. See http://code.google.com/p/phamlp/ for details.241 */242 Configure::write('Asset.filter.css', 'sass.php');243 Configure::write('Sass.cache_location', TMP . DS . 'cache' . DS . 'sass');244 //Configure::write('Sass.style', 'compressed');245 Configure::write('Sass.extensions', array('Compass' => array('fonts_path' => '../fonts')));246 232 247 233 /** … … 254 240 255 241 /** 242 * Configuration for PHamlP. See http://code.google.com/p/phamlp/ for details. 243 */ 244 Configure::write('Asset.filter.css', 'sass.php'); 245 Configure::write('Sass.cache_location', TMP . DS . 'cache' . DS . 'sass'); 246 //Configure::write('Sass.style', 'compressed'); 247 Configure::write('Sass.extensions', array('Compass' => array('fonts_path' => '../fonts'))); 248 249 /** 256 250 * The classname and database used in CakePHP's 257 251 * access control lists. … … 260 254 Configure::write('Acl.database', 'default'); 261 255 262 /** 256 /** 263 257 * Set here your external SMTP server configuration if your local machine does 264 258 * not have an SMPT server. If SMTP.host is not set PHP's function mail() is … … 301 295 * )); 302 296 * 303 *304 297 * APC (http://pecl.php.net/package/APC) 305 298 * … … 317 310 * 'duration'=> 3600, //[optional] 318 311 * 'probability'=> 100, //[optional] 319 * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string312 * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 320 313 * 'user' => 'user', //user from xcache.admin.user settings 321 * 'password' => 'password', //plaintext password (xcache.admin.pass) 322 * )); 323 * 324 * 325 * Memcache (http://www.danga.com/memcached/) 314 * 'password' => 'password', //plaintext password (xcache.admin.pass) 315 * )); 316 * 317 * Memcache (http://memcached.org/) 326 318 * 327 319 * Cache::config('default', array( … … 333 325 * '127.0.0.1:11211' // localhost, default port 11211 334 326 * ), //[optional] 327 * 'persistent' => true, // [optional] set this to false for non-persistent connections 335 328 * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) 336 329 * )); 337 330 * 338 */ 339 Cache::config('default', array('engine' => 'File')); 340 341 /** 342 * Configure the Logger settings 343 */ 344 Configure::write('Logger.enable', true); 345 Configure::write('Logger.level', 1); 346 Configure::write('Logger.file', TMP.'logs'.DS.'logger.log'); 347 348 /** 349 * Define the path to the user directory where the uploaded media and the cache 350 * files of preview are stored 351 */ 352 if (!defined('USER_DIR')) { 353 //define('USER_DIR', 'DIRECTORY NAME OF USERS DATA'); 354 define('USER_DIR', APP.'users'.DS); 355 } 356 ?> 331 * Wincache (http://php.net/wincache) 332 * 333 * Cache::config('default', array( 334 * 'engine' => 'Wincache', //[required] 335 * 'duration'=> 3600, //[optional] 336 * 'probability'=> 100, //[optional] 337 * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 338 * )); 339 */ 340 341 /** 342 * Pick the caching engine to use. If APC is enabled use it. 343 * If running via cli - apc is disabled by default. ensure it's available and enabled in this case 344 * 345 */ 346 $engine = 'File'; 347 if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { 348 $engine = 'Apc'; 349 } 350 351 // In development mode, caches should expire quickly. 352 $duration = '+999 days'; 353 if (Configure::read('debug') >= 1) { 354 $duration = '+10 seconds'; 355 } 356 357 /** 358 * Configure the cache used for general framework caching. Path information, 359 * object listings, and translation cache files are stored with this configuration. 360 */ 361 Cache::config('_cake_core_', array( 362 'engine' => $engine, 363 'prefix' => 'cake_core_', 364 'path' => CACHE . 'persistent' . DS, 365 'serialize' => ($engine === 'File'), 366 'duration' => $duration 367 )); 368 369 /** 370 * Configure the cache for model and datasource caches. This cache configuration 371 * is used to store schema descriptions, and table listings in connections. 372 */ 373 Cache::config('_cake_model_', array( 374 'engine' => $engine, 375 'prefix' => 'cake_model_', 376 'path' => CACHE . 'models' . DS, 377 'serialize' => ($engine === 'File'), 378 'duration' => $duration 379 )); -
Config/routes.php
re449ecc0 ra42ace5 7 7 * different urls to chosen controllers and their actions (functions). 8 8 * 9 * PHP versions 4 and59 * PHP 5 10 10 * 11 11 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 12 * Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)12 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 13 13 * 14 14 * Licensed under The MIT License 15 15 * Redistributions of files must retain the above copyright notice. 16 16 * 17 * @copyright Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)17 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 18 18 * @link http://cakephp.org CakePHP(tm) Project 19 * @package cake 20 * @subpackage cake.app.config 19 * @package app.Config 21 20 * @since CakePHP(tm) v 0.2.9 22 21 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) … … 25 24 * Here, we are connecting '/' (base path) to controller called 'Pages', 26 25 * its action called 'display', and we pass a param to select the view file 27 * to use (in this case, /app/ views/pages/home.ctp)...26 * to use (in this case, /app/View/Pages/home.ctp)... 28 27 */ 29 //Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));28 Router::connect('/', array('controller' => 'home', 'action' => 'index')); 30 29 /** 31 30 * ...and connect the rest of 'Pages' controller's urls. … … 34 33 35 34 /** 36 * Routes for phTagr 35 * Load all plugin routes. See the CakePlugin documentation on 36 * how to customize the loading of plugin routes. 37 37 */ 38 Router::connect('/', array('controller' => 'home', 'action' => 'index')); 39 Router::connect('/webdav/*', array('controller' => 'webdav', 'action' => 'index')); 40 ?> 38 CakePlugin::routes(); 39 40 /** 41 * Load the CakePHP default routes. Remove this if you do not want to use 42 * the built-in default routes. 43 */ 44 require CAKE . 'Config' . DS . 'routes.php'; -
webroot/index.php
r7b6c458 ra42ace5 5 5 * The Front Controller for handling every request 6 6 * 7 * PHP versions 4 and57 * PHP 5 8 8 * 9 9 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 10 * Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)10 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 11 11 * 12 12 * Licensed under The MIT License 13 13 * Redistributions of files must retain the above copyright notice. 14 14 * 15 * @copyright Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)15 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 16 16 * @link http://cakephp.org CakePHP(tm) Project 17 * @package cake 18 * @subpackage cake.app.webroot 17 * @package app.webroot 19 18 * @since CakePHP(tm) v 0.2.9 20 19 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) … … 46 45 define('APP_DIR', basename(dirname(dirname(__FILE__)))); 47 46 } 47 48 /** 49 * phTagr uses not CakePHP's standard directory structure 50 * 51 */ 48 52 if (!defined('APP')) { 49 53 define('APP', ROOT . DS); … … 52 56 * The absolute path to the "cake" directory, WITHOUT a trailing DS. 53 57 * 58 * Un-comment this line to specify a fixed path to CakePHP. 59 * This should point at the directory containing `Cake`. 60 * 61 * For ease of development CakePHP uses PHP's include_path. If you 62 * cannot modify your include_path set this value. 63 * 64 * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php 54 65 */ 55 if (!defined('CAKE_CORE_INCLUDE_PATH')) {56 define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cakephp'); 57 }66 //define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); 67 // CakePHP is in phTagr's directory 'cakephp' 68 define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cakephp' . DS . 'lib'); 58 69 59 70 /** … … 68 79 define('WWW_ROOT', dirname(__FILE__) . DS); 69 80 } 70 if (!defined('CORE_PATH')) { 71 if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) { 72 define('APP_PATH', null); 73 define('CORE_PATH', ROOT . DS . 'cakephp' . DS); 74 } else { 75 define('APP_PATH', ROOT . DS . APP_DIR . DS); 76 define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); 77 } 78 } 81 82 /** 83 * Fast media delivery without CakePHP 84 */ 79 85 if (isset($_GET['url']) && preg_match('/media\/\w+\/\d+/', $_GET['url'])) { 80 86 require APP . DS . 'fast_file_responder.php'; … … 88 94 } 89 95 } 90 if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) { 96 97 if (!defined('CAKE_CORE_INCLUDE_PATH')) { 98 if (function_exists('ini_set')) { 99 ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); 100 } 101 if (!include('Cake' . DS . 'bootstrap.php')) { 102 $failed = true; 103 } 104 } else { 105 if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { 106 $failed = true; 107 } 108 } 109 if (!empty($failed)) { 91 110 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); 92 111 } 93 if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') { 112 113 if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') { 94 114 return; 95 } else {96 $Dispatcher = new Dispatcher();97 $Dispatcher->dispatch();98 115 } 99 ?> 116 117 App::uses('Dispatcher', 'Routing'); 118 119 $Dispatcher = new Dispatcher(); 120 $Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding')))); -
webroot/test.php
r7b6c458 ra42ace5 3 3 * Web Access Frontend for TestSuite 4 4 * 5 * PHP versions 4 and55 * PHP 5 6 6 * 7 7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing> 8 * Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 9 9 * 10 * Licensed under The Open Group Test SuiteLicense11 * Redistributions of files must retain the above copyright notice.10 * Licensed under The MIT License 11 * Redistributions of files must retain the above copyright notice 12 12 * 13 * @copyright Copyright 2005-201 0, Cake Software Foundation, Inc. (http://cakefoundation.org)13 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 14 14 * @link http://book.cakephp.org/view/1196/Testing 15 * @package cake 16 * @subpackage cake.app.webroot 15 * @package app.webroot 17 16 * @since CakePHP(tm) v 1.2.0.4433 18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License17 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 19 18 */ 20 19 set_time_limit(0); … … 46 45 define('APP_DIR', basename(dirname(dirname(__FILE__)))); 47 46 } 47 /** 48 * phTagr uses not CakePHP's standard directory structure 49 * 50 */ 48 51 if (!defined('APP')) { 49 52 define('APP', ROOT . DS); 50 53 } 54 51 55 /** 52 * The absolute path to the " cake" directory, WITHOUT a trailing DS.56 * The absolute path to the "Cake" directory, WITHOUT a trailing DS. 53 57 * 58 * For ease of development CakePHP uses PHP's include_path. If you 59 * need to cannot modify your include_path, you can set this path. 60 * 61 * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php 54 62 */ 55 if (!defined('CAKE_CORE_INCLUDE_PATH')) {56 define('CAKE_CORE_INCLUDE_PATH', ROOT);57 }63 //define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); 64 // CakePHP is in phTagr's directory 'cakephp' 65 define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cakephp' . DS . 'lib'); 58 66 59 67 /** … … 68 76 define('WWW_ROOT', dirname(__FILE__) . DS); 69 77 } 70 if (!defined('CORE_PATH')) { 71 if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) { 72 define('APP_PATH', null); 73 define('CORE_PATH', ROOT . DS . 'cakephp' . DS); 74 } else { 75 define('APP_PATH', ROOT . DS . APP_DIR . DS); 76 define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); 78 79 if (!defined('CAKE_CORE_INCLUDE_PATH')) { 80 if (function_exists('ini_set')) { 81 ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); 82 } 83 if (!include('Cake' . DS . 'bootstrap.php')) { 84 $failed = true; 85 } 86 } else { 87 if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { 88 $failed = true; 77 89 } 78 90 } 79 if (! include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {91 if (!empty($failed)) { 80 92 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); 81 93 } 82 94 83 $corePath = App::core('cake'); 84 if (isset($corePath[0])) { 85 define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); 86 } else { 87 define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH); 95 if (Configure::read('debug') < 1) { 96 die(__d('cake_dev', 'Debug setting does not allow access to this url.')); 88 97 } 89 98 90 if (Configure::read('debug') < 1) { 91 die(__('Debug setting does not allow access to this url.', true)); 92 } 99 require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php'; 93 100 94 require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php'; 95 96 $Dispatcher = new CakeTestSuiteDispatcher(); 97 $Dispatcher->dispatch(); 98 ?> 101 CakeTestSuiteDispatcher::run();
