Changeset a42ace5079b711cff1c0078740ad0bb7a735e0fc

Show
Ignore:
Timestamp:
01/28/12 18:44:10 (4 months ago)
Author:
Xemle <xemle@phtagr.org>
Children:
e2681da508f3815896c5e70ee7e22b7019dc8286
Parents:
ee4c2b7fedeac65c7bf3af2de933963981702433
git-committer:
Xemle <xemle@phtagr.org> / 2012-01-28T18:44:10Z+0100
Message:

Migrate basic configuration files to CakePHP 2.0

Files:
5 modified

Legend:

Unmodified
Added
Removed
  • Config/bootstrap.php

    re449ecc0 ra42ace5  
    11<?php 
    22/** 
    3  * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php 
     3 * This file is loaded automatically by the app/webroot/index.php file after core.php 
    44 * 
    5  * This is an application wide file to load any function that is not used within a class 
    6  * 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. 
    77 * 
    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 
    912 * 
    1013 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
    11  * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     14 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1215 * 
    1316 * Licensed under The MIT License 
    1417 * Redistributions of files must retain the above copyright notice. 
    1518 * 
    16  * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     19 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1720 * @link          http://cakephp.org CakePHP(tm) Project 
    18  * @package       cake 
    19  * @subpackage    cake.app.config 
     21 * @package       app.Config 
    2022 * @since         CakePHP(tm) v 0.10.8.2117 
    2123 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php) 
    2224 */ 
    2325 
     26// Setup a 'default' cache configuration for use in the application. 
     27Cache::config('default', array('engine' => 'File')); 
     28 
    2429/** 
    2530 * 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) 
    2731 * 
    2832 * 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/'), 
    3943 *     'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/') 
    4044 * )); 
     
    4347 
    4448/** 
    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 
    4651 * 
    4752 * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); 
     
    5156Inflector::rules('plural', array('uninflected' => array('[Bb]rowser'))); 
    5257Inflector::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 */ 
     72if (!defined('USER_DIR')) { 
     73  define('USER_DIR', APP . 'users' . DS); 
     74} 
     75 
     76/** 
     77 * Configuration directory 
     78 */ 
     79if (!defined('CONFIGS')) { 
     80  define('CONFIGS', APP . 'Config' . DS); 
     81} 
    5382 
    5483define('ROLE_NOBODY', 0); 
     
    125154define("LOCATION_COUNTRY", 0x04); 
    126155 
    127 /** Add pear path within vendor path to the include_path */ 
     156/**  
     157 * Add pear path within vendor path to the include_path  
     158 */ 
    128159if (function_exists('ini_set') && function_exists('ini_get')) { 
    129160  $path = ini_get('include_path'); 
     
    131162  ini_set('include_path', $vendorPearPath . PATH_SEPARATOR . ini_get('include_path')); 
    132163} 
    133 //EOF 
    134 ?> 
     164 
  • Config/core.php

    re449ecc0 ra42ace5  
    55 * Use it to configure core behavior of Cake. 
    66 * 
    7  * PHP versions 4 and 5 
     7 * PHP 5 
    88 * 
    99 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
    10  * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     10 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1111 * 
    1212 * Licensed under The MIT License 
    1313 * Redistributions of files must retain the above copyright notice. 
    1414 * 
    15  * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     15 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1616 * @link          http://cakephp.org CakePHP(tm) Project 
    17  * @package       cake 
    18  * @subpackage    cake.app.config 
     17 * @package       app.Config 
    1918 * @since         CakePHP(tm) v 0.2.9 
    2019 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php) 
     
    3433 * In development mode, you need to click the flash message to continue. 
    3534 */ 
    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        )); 
    5278 
    5379/** 
     
    5682        Configure::write('App.encoding', 'UTF-8'); 
    5783 
    58 /** 
     84 /** 
    5985 * In some php versions escapeshellarg() removes special characters like german 
    6086 * umlaut. This bug causes wrong system calls to files like import of media 
     
    6692 *          http://bugs.php.net/bug.php?id=44564 
    6793 */ 
    68   //setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8"); 
    69  
     94//setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8"); 
     95  
    7096/** 
    7197 * To configure CakePHP *not* to use mod_rewrite and to 
     
    96122 *      `manager_index()` and `/manager/controller/index` 
    97123 * 
    98  * [Note Routing.admin is deprecated in 1.3.  Use Routing.prefixes instead] 
    99  */ 
     124 */ 
     125        //Configure::write('Routing.prefixes', array('admin')); 
    100126        Configure::write('Routing.prefixes', array('admin')); 
    101127 
     
    110136 * 
    111137 * 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, 
    114140 * or in each action using $this->cacheAction = true. 
    115141 * 
     
    124150 
    125151/** 
    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. 
    209201 */ 
    210202        Configure::write('Security.level', 'medium'); 
     
    225217 * useful for invalidating browser caches. 
    226218 * 
    227  * Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable 
    228  * timestamping. 
     219 * Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable 
     220 * timestamping regardless of debug value. 
    229221 */ 
    230222        //Configure::write('Asset.timestamp', true); 
     223 
    231224/** 
    232225 * Compress CSS output by removing comments, whitespace, repeating tags, etc. 
     
    237230 */ 
    238231        //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'))); 
    246232 
    247233/** 
     
    254240 
    255241/** 
     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/** 
    256250 * The classname and database used in CakePHP's 
    257251 * access control lists. 
     
    260254        Configure::write('Acl.database', 'default'); 
    261255 
    262 /**  
     256/** 
    263257 * Set here your external SMTP server configuration if your local machine does 
    264258 * not have an SMPT server. If SMTP.host is not set PHP's function mail() is 
     
    301295 *      )); 
    302296 * 
    303  * 
    304297 * APC (http://pecl.php.net/package/APC) 
    305298 * 
     
    317310 *              'duration'=> 3600, //[optional] 
    318311 *              'probability'=> 100, //[optional] 
    319  *              'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 
     312 *              'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 
    320313 *              '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/) 
    326318 * 
    327319 *       Cache::config('default', array( 
     
    333325 *                      '127.0.0.1:11211' // localhost, default port 11211 
    334326 *              ), //[optional] 
     327 *              'persistent' => true, // [optional] set this to false for non-persistent connections 
    335328 *              'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) 
    336329 *      )); 
    337330 * 
    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'; 
     347if (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'; 
     353if (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 */ 
     361Cache::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 */ 
     373Cache::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  
    77 * different urls to chosen controllers and their actions (functions). 
    88 * 
    9  * PHP versions 4 and 5 
     9 * PHP 5 
    1010 * 
    1111 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
    12  * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     12 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1313 * 
    1414 * Licensed under The MIT License 
    1515 * Redistributions of files must retain the above copyright notice. 
    1616 * 
    17  * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     17 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1818 * @link          http://cakephp.org CakePHP(tm) Project 
    19  * @package       cake 
    20  * @subpackage    cake.app.config 
     19 * @package       app.Config 
    2120 * @since         CakePHP(tm) v 0.2.9 
    2221 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php) 
     
    2524 * Here, we are connecting '/' (base path) to controller called 'Pages', 
    2625 * 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)... 
    2827 */ 
    29         //Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); 
     28        Router::connect('/', array('controller' => 'home', 'action' => 'index')); 
    3029/** 
    3130 * ...and connect the rest of 'Pages' controller's urls. 
     
    3433 
    3534/** 
    36  * Routes for phTagr 
     35 * Load all plugin routes.  See the CakePlugin documentation on  
     36 * how to customize the loading of plugin routes. 
    3737 */ 
    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  
    55 * The Front Controller for handling every request 
    66 * 
    7  * PHP versions 4 and 5 
     7 * PHP 5 
    88 * 
    99 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
    10  * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     10 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1111 * 
    1212 * Licensed under The MIT License 
    1313 * Redistributions of files must retain the above copyright notice. 
    1414 * 
    15  * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     15 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1616 * @link          http://cakephp.org CakePHP(tm) Project 
    17  * @package       cake 
    18  * @subpackage    cake.app.webroot 
     17 * @package       app.webroot 
    1918 * @since         CakePHP(tm) v 0.2.9 
    2019 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php) 
     
    4645                define('APP_DIR', basename(dirname(dirname(__FILE__)))); 
    4746        } 
     47 
     48/** 
     49 * phTagr uses not CakePHP's standard directory structure 
     50 * 
     51 */ 
    4852        if (!defined('APP')) { 
    4953                define('APP', ROOT . DS); 
     
    5256 * The absolute path to the "cake" directory, WITHOUT a trailing DS. 
    5357 * 
     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 
    5465 */ 
    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'); 
    5869 
    5970/** 
     
    6879                define('WWW_ROOT', dirname(__FILE__) . DS); 
    6980        } 
    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 */ 
    7985        if (isset($_GET['url']) && preg_match('/media\/\w+\/\d+/', $_GET['url'])) { 
    8086                require APP . DS . 'fast_file_responder.php'; 
     
    8894                } 
    8995        } 
    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)) { 
    91110                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); 
    92111        } 
    93         if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') { 
     112 
     113        if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') { 
    94114                return; 
    95         } else { 
    96                 $Dispatcher = new Dispatcher(); 
    97                 $Dispatcher->dispatch(); 
    98115        } 
    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  
    33 * Web Access Frontend for TestSuite 
    44 * 
    5  * PHP versions 4 and 5 
     5 * PHP 5 
    66 * 
    77 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing> 
    8  * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    99 * 
    10  *  Licensed under The Open Group Test Suite License 
    11  *  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 
    1212 * 
    13  * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 
     13 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) 
    1414 * @link          http://book.cakephp.org/view/1196/Testing 
    15  * @package       cake 
    16  * @subpackage    cake.app.webroot 
     15 * @package       app.webroot 
    1716 * @since         CakePHP(tm) v 1.2.0.4433 
    18  * @license       http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License 
     17 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php) 
    1918 */ 
    2019set_time_limit(0); 
     
    4645                define('APP_DIR', basename(dirname(dirname(__FILE__)))); 
    4746        } 
     47/** 
     48 * phTagr uses not CakePHP's standard directory structure 
     49 * 
     50 */ 
    4851        if (!defined('APP')) { 
    4952                define('APP', ROOT . DS); 
    5053        } 
     54 
    5155/** 
    52  * The absolute path to the "cake" directory, WITHOUT a trailing DS. 
     56 * The absolute path to the "Cake" directory, WITHOUT a trailing DS. 
    5357 * 
     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 
    5462 */ 
    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'); 
    5866 
    5967/** 
     
    6876        define('WWW_ROOT', dirname(__FILE__) . DS); 
    6977} 
    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 
     79if (!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; 
    7789        } 
    7890} 
    79 if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) { 
     91if (!empty($failed)) { 
    8092        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); 
    8193} 
    8294 
    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); 
     95if (Configure::read('debug') < 1) { 
     96        die(__d('cake_dev', 'Debug setting does not allow access to this url.')); 
    8897} 
    8998 
    90 if (Configure::read('debug') < 1) { 
    91         die(__('Debug setting does not allow access to this url.', true)); 
    92 } 
     99require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php'; 
    93100 
    94 require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php'; 
    95  
    96 $Dispatcher = new CakeTestSuiteDispatcher(); 
    97 $Dispatcher->dispatch(); 
    98 ?> 
     101CakeTestSuiteDispatcher::run();