Skip to content
Browse files

Merge remote branch 'upstream/2.0' into 2.0

Conflicts:
	cake/libs/view/helpers/html.php
  • Loading branch information...
2 parents af4c45a + 9ac79da commit 8f3fdc836e7a0e0e784bb8c2686757c1f3acc991 @lipedjow lipedjow committed Apr 17, 2011
Showing with 56 additions and 19,597 deletions.
  1. 0 {vendors/shells/templates → app/Console/Command/Task}/empty
  2. 0 {vendors/shells/tasks → app/Console/Command}/empty
  3. 0 {cake/console/templates/skel/console → app/Console}/cake
  4. 0 {cake/console/templates/skel/console → app/Console}/cake.bat
  5. +24 −0 app/Console/cake.php
  6. 0 {cake/tests/test_app/views/scaffolds → app/Console/templates}/empty
  7. 0 {cake/tests/test_app/views/pages → app/Controller/Component}/empty
  8. 0 {cake/tests/test_app/views/helpers → app/Lib}/empty
  9. 0 {cake/tests/test_app/views/errors → app/Model/Behavior}/empty
  10. 0 {cake/tests/test_app/views/elements → app/Model/Datasource}/empty
  11. 0 {cake/tests/test_app/plugins/test_plugin_two/console/templates → app/View/Helper}/empty
  12. 0 ...tests/test_app/plugins/test_plugin_two/console/shells/tasks → app/View/elements/email/html}/empty
  13. 0 {cake/tests/test_app/plugins/test_plugin/console/templates → app/View/elements/email/text}/empty
  14. 0 {cake/tests/test_app/plugins/test_plugin/console/shells/tasks → app/View/elements}/empty
  15. 0 {cake/tests/test_app/models/behaviors → app/View/errors}/empty
  16. 0 {cake/tests/test_app/controllers/components → app/View/layouts/email/html}/empty
  17. 0 {cake/tests/test_app/console/shells/tasks → app/View/layouts/email/text}/empty
  18. 0 {cake/console/templates/skel/webroot → app/View/layouts}/js/empty
  19. 0 {cake/console/templates/skel/views/scaffolds → app/View/layouts/rss}/empty
  20. 0 {cake/console/templates/skel/views/pages → app/View/layouts/xml}/empty
  21. 0 {cake/console/templates/skel/views/helpers → app/View/pages}/empty
  22. 0 {cake/console/templates/skel/views/errors → app/View/scaffolds}/empty
  23. +15 −12 app/config/core.php
  24. +9 −9 app/config/database.php.default
  25. +0 −24 app/console/cake.php
  26. 0 app/console/shells/empty
  27. 0 app/console/shells/tasks/empty
  28. 0 app/console/shells/templates/empty
  29. 0 app/controllers/components/empty
  30. 0 {cake/console/templates/skel/views/elements → app/tests/Case/Controller/Component}/empty
  31. 0 {cake/console/templates/skel/vendors → app/tests/Case/Controller}/empty
  32. 0 {cake/console/templates/skel/tmp/tests → app/tests/Case/Model/Behavior}/empty
  33. 0 {cake/console/templates/skel/tmp/sessions → app/tests/Case/Model}/empty
  34. 0 {cake/console/templates/skel/tmp/logs → app/tests/Case/View/Helper}/empty
  35. 0 {cake/console/templates/skel/tmp/cache/views → app/tests/Fixture}/empty
  36. 0 app/tmp/cache/models/empty
  37. 0 app/tmp/cache/views/empty
  38. 0 app/tmp/logs/empty
  39. 0 app/tmp/sessions/empty
  40. 0 app/tmp/tests/empty
  41. +3 −3 app/webroot/index.php
  42. +5 −12 app/webroot/test.php
  43. +0 −721 cake/basics.php
  44. +0 −39 cake/bootstrap.php
  45. +0 −230 cake/config/paths.php
  46. +0 −24 cake/console/cake.php
  47. +0 −91 cake/console/libs/console_error_handler.php
  48. +0 −167 cake/console/libs/console_input_argument.php
  49. +0 −212 cake/console/libs/console_input_option.php
  50. +0 −606 cake/console/libs/console_option_parser.php
  51. +0 −177 cake/console/libs/help_formatter.php
  52. +0 −79 cake/console/libs/task_collection.php
  53. +0 −326 cake/console/shell_dispatcher.php
  54. +0 −611 cake/console/shells/acl.php
  55. +0 −229 cake/console/shells/api.php
  56. +0 −31 cake/console/shells/app_shell.php
  57. +0 −235 cake/console/shells/bake.php
  58. +0 −233 cake/console/shells/command_list.php
  59. +0 −354 cake/console/shells/console.php
  60. +0 −118 cake/console/shells/i18n.php
  61. +0 −520 cake/console/shells/schema.php
  62. +0 −759 cake/console/shells/shell.php
  63. +0 −76 cake/console/shells/tasks/bake.php
  64. +0 −501 cake/console/shells/tasks/controller.php
  65. +0 −380 cake/console/shells/tasks/db_config.php
  66. +0 −534 cake/console/shells/tasks/extract.php
  67. +0 −415 cake/console/shells/tasks/fixture.php
  68. +0 −910 cake/console/shells/tasks/model.php
  69. +0 −200 cake/console/shells/tasks/plugin.php
  70. +0 −394 cake/console/shells/tasks/project.php
  71. +0 −213 cake/console/shells/tasks/template.php
  72. +0 −445 cake/console/shells/tasks/test.php
  73. +0 −473 cake/console/shells/tasks/view.php
  74. +0 −325 cake/console/shells/testsuite.php
  75. +0 −100 cake/console/templates/default/classes/test.ctp
  76. +0 −85 cake/console/templates/default/views/home.ctp
  77. +0 −34 cake/console/templates/skel/app_helper.php
  78. +0 −322 cake/console/templates/skel/config/core.php
  79. +0 −81 cake/console/templates/skel/config/database.php.default
  80. +0 −80 cake/console/templates/skel/webroot/index.php
  81. +0 −87 cake/console/templates/skel/webroot/test.php
  82. +0 −908 cake/libs/app.php
  83. +0 −614 cake/libs/cache.php
  84. +0 −115 cake/libs/cache/apc.php
  85. +0 −305 cake/libs/cache/file.php
  86. +0 −215 cake/libs/cache/memcache.php
  87. +0 −177 cake/libs/cache/xcache.php
  88. +0 −222 cake/libs/cake_log.php
  89. +0 −711 cake/libs/cake_request.php
  90. +0 −656 cake/libs/cake_response.php
  91. +0 −752 cake/libs/cake_session.php
  92. +0 −279 cake/libs/cake_socket.php
  93. +0 −337 cake/libs/class_registry.php
  94. +0 −119 cake/libs/config/ini_reader.php
  95. +0 −84 cake/libs/config/php_reader.php
  96. +0 −376 cake/libs/configure.php
  97. +0 −34 cake/libs/controller/app_controller.php
  98. +0 −157 cake/libs/controller/component.php
  99. +0 −109 cake/libs/controller/component_collection.php
  100. +0 −678 cake/libs/controller/components/acl.php
  101. +0 −704 cake/libs/controller/components/auth.php
  102. +0 −39 cake/libs/controller/components/auth/actions_authorize.php
  103. +0 −110 cake/libs/controller/components/auth/base_authenticate.php
  104. +0 −135 cake/libs/controller/components/auth/base_authorize.php
  105. +0 −121 cake/libs/controller/components/auth/basic_authenticate.php
  106. +0 −65 cake/libs/controller/components/auth/controller_authorize.php
  107. +0 −98 cake/libs/controller/components/auth/crud_authorize.php
Sorry, we could not display the entire diff because too many files (1,642) changed.
View
0 vendors/shells/templates/empty → app/Console/Command/Task/empty
File renamed without changes.
View
0 vendors/shells/tasks/empty → app/Console/Command/empty
File renamed without changes.
View
0 cake/console/templates/skel/console/cake → app/Console/cake 100644 → 100755
File renamed without changes.
View
0 cake/console/templates/skel/console/cake.bat → app/Console/cake.bat
File renamed without changes.
View
24 app/Console/cake.php
@@ -0,0 +1,24 @@
+#!/usr/bin/php -q
+<?php
+/**
+ * Command-line code generation utility to automate programmer chores.
+ *
+ * Shell dispatcher class
+ *
+ * PHP 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2010, Cake Software Foundation, Inc.
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
+ * @package app.console
+ * @since CakePHP(tm) v 1.2.0.5012
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'lib'. DIRECTORY_SEPARATOR . 'Cake' . DIRECTORY_SEPARATOR . 'Console' . DIRECTORY_SEPARATOR . 'ShellDispatcher.php');
+
+return ShellDispatcher::run($argv);
View
0 cake/tests/test_app/views/scaffolds/empty → app/Console/templates/empty
File renamed without changes.
View
0 cake/tests/test_app/views/pages/empty → app/Controller/Component/empty
File renamed without changes.
View
0 cake/tests/test_app/views/helpers/empty → app/Lib/empty
File renamed without changes.
View
0 cake/tests/test_app/views/errors/empty → app/Model/Behavior/empty
File renamed without changes.
View
0 cake/tests/test_app/views/elements/empty → app/Model/Datasource/empty
File renamed without changes.
View
0 ...s/test_plugin_two/console/templates/empty → app/View/Helper/empty
File renamed without changes.
View
0 ...est_plugin_two/console/shells/tasks/empty → app/View/elements/email/html/empty
File renamed without changes.
View
0 ...ugins/test_plugin/console/templates/empty → app/View/elements/email/text/empty
File renamed without changes.
View
0 ...ns/test_plugin/console/shells/tasks/empty → app/View/elements/empty
File renamed without changes.
View
0 cake/tests/test_app/models/behaviors/empty → app/View/errors/empty
File renamed without changes.
View
0 ...sts/test_app/controllers/components/empty → app/View/layouts/email/html/empty
File renamed without changes.
View
0 ...tests/test_app/console/shells/tasks/empty → app/View/layouts/email/text/empty
File renamed without changes.
View
0 cake/console/templates/skel/webroot/js/empty → app/View/layouts/js/empty
File renamed without changes.
View
0 ...sole/templates/skel/views/scaffolds/empty → app/View/layouts/rss/empty
File renamed without changes.
View
0 .../console/templates/skel/views/pages/empty → app/View/layouts/xml/empty
File renamed without changes.
View
0 ...onsole/templates/skel/views/helpers/empty → app/View/pages/empty
File renamed without changes.
View
0 ...console/templates/skel/views/errors/empty → app/View/scaffolds/empty
File renamed without changes.
View
27 app/config/core.php
@@ -41,7 +41,7 @@
*
* Options:
*
- * - `handler` - callback - The callback to handle errors. You can set this to any callback type,
+ * - `handler` - callback - The callback to handle errors. You can set this to any callback type,
* including anonymous functions.
* - `level` - int - The level of errors you are interested in capturing.
* - `trace` - boolean - Include stack traces for errors in log files.
@@ -55,14 +55,14 @@
));
/**
- * Configure the Exception handler used for uncaught exceptions. By default,
- * ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
- * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
+ * Configure the Exception handler used for uncaught exceptions. By default,
+ * ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
+ * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
* framework errors will be coerced into generic HTTP errors.
*
* Options:
*
- * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
+ * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
* including anonymous functions.
* - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
* should place the file for that class in app/libs. This class needs to implement a render method.
@@ -138,7 +138,7 @@
/**
* Session configuration.
*
- * Contains an array of settings to use for session configuration. The defaults key is
+ * Contains an array of settings to use for session configuration. The defaults key is
* used to define a default preset to use for sessions, any settings declared here will override
* the settings of the default config.
*
@@ -147,14 +147,14 @@
* - `Session.name` - The name of the cookie to use. Defaults to 'CAKEPHP'
* - `Session.timeout` - The number of minutes you want sessions to live for. This timeout is handled by CakePHP
* - `Session.cookieTimeout` - The number of minutes you want session cookies to live for.
- * - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
+ * - `Session.checkAgent` - Do you want the user agent to be checked when starting sessions? You might want to set the
* value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
* - `Session.defaults` - The default configuration set to use as a basis for your session.
* There are four builtins: php, cake, cache, database.
* - `Session.handler` - Can be used to enable a custom session handler. Expects an array of of callables,
* that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
* to the ini array.
- * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
+ * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
* sessionids that change frequently. See CakeSession::$requestCountdown.
* - `Session.ini` - An associative array of additional ini values to set.
*
@@ -284,9 +284,13 @@
*
*/
-// Pick the caching engine to use. If APC is enabled use it.
+/**
+ * Pick the caching engine to use. If APC is enabled use it.
+ * If running via cli - apc is disabled by default. ensure it's avaiable and enabled in this case
+ *
+ */
$engine = 'File';
-if (extension_loaded('apc')) {
+if (extension_loaded('apc') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
$engine = 'Apc';
}
@@ -309,7 +313,7 @@
));
/**
- * Configure the cache for model, and datasource caches. This cache configuration
+ * Configure the cache for model, and datasource caches. This cache configuration
* is used to store schema descriptions, and table listings in connections.
*/
Cache::config('_cake_model_', array(
@@ -319,4 +323,3 @@
'serialize' => ($engine === 'File'),
'duration' => $duration
));
-
View
18 app/config/database.php.default
@@ -28,15 +28,15 @@
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
- * mysql - MySQL 4 & 5,
- * sqlite - SQLite (PHP5 only),
- * postgres - PostgreSQL 7 and higher,
- * mssql - Microsoft SQL Server 2000 and higher,
- * oracle - Oracle 8 and higher
+ * Datasabe/Mysql - MySQL 4 & 5,
+ * Datasabe/Sqlite - SQLite (PHP5 only),
+ * Datasabe/Postgres - PostgreSQL 7 and higher,
+ * Datasabe/Mssql - Microsoft SQL Server 2000 and higher,
+ * Datasabe/Oracle - Oracle 8 and higher
*
* You can add custom database drivers (or override existing drivers) by adding the
- * appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
- * where 'x' is the name of the database.
+ * appropriate file to app/models/datasources/database. Drivers should be named 'MyDriver.php',
+ *
*
* persistent => true / false
* Determines whether or not the database should use a persistent connection
@@ -59,7 +59,7 @@
class DATABASE_CONFIG {
public $default = array(
- 'driver' => 'mysql',
+ 'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
@@ -69,7 +69,7 @@ class DATABASE_CONFIG {
);
public $test = array(
- 'driver' => 'mysql',
+ 'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
View
0 app/console/cake
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/console/cake.bat
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
24 app/console/cake.php
@@ -1,24 +0,0 @@
-#!/usr/bin/php -q
-<?php
-/**
- * Command-line code generation utility to automate programmer chores.
- *
- * Shell dispatcher class
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc.
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package app.console
- * @since CakePHP(tm) v 1.2.0.5012
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'cake' . DIRECTORY_SEPARATOR . 'console' . DIRECTORY_SEPARATOR . 'shell_dispatcher.php');
-
-return ShellDispatcher::run($argv);
View
0 app/console/shells/empty
No changes.
View
0 app/console/shells/tasks/empty
No changes.
View
0 app/console/shells/templates/empty
No changes.
View
0 app/controllers/components/empty
No changes.
View
0 app/libs/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/models/behaviors/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/models/datasources/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 ...nsole/templates/skel/views/elements/empty → app/tests/Case/Controller/Component/empty
File renamed without changes.
View
0 cake/console/templates/skel/vendors/empty → app/tests/Case/Controller/empty
File renamed without changes.
View
0 cake/console/templates/skel/tmp/tests/empty → app/tests/Case/Model/Behavior/empty
File renamed without changes.
View
0 ...console/templates/skel/tmp/sessions/empty → app/tests/Case/Model/empty
File renamed without changes.
View
0 cake/console/templates/skel/tmp/logs/empty → app/tests/Case/View/Helper/empty
File renamed without changes.
View
0 ...sole/templates/skel/tmp/cache/views/empty → app/tests/Fixture/empty 100755 → 100644
File renamed without changes.
View
0 app/tests/cases/behaviors/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tests/cases/components/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tests/cases/controllers/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tests/cases/helpers/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tests/cases/models/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tests/fixtures/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tests/groups/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/tmp/cache/models/empty 100755 → 100644
File mode changed.
View
0 app/tmp/cache/views/empty 100755 → 100644
File mode changed.
View
0 app/tmp/logs/empty 100755 → 100644
File mode changed.
View
0 app/tmp/sessions/empty 100755 → 100644
File mode changed.
View
0 app/tmp/tests/empty 100755 → 100644
File mode changed.
View
0 app/views/elements/email/html/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/elements/email/text/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/elements/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/errors/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/helpers/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/layouts/email/html/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/layouts/email/text/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/layouts/js/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/layouts/rss/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/layouts/xml/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/pages/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 app/views/scaffolds/empty
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
6 app/webroot/index.php
@@ -49,7 +49,7 @@
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
- define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}
/**
@@ -67,14 +67,14 @@
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
- if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
+ if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
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);
}
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') {
return;
}
- require LIBS . 'dispatcher.php';
+ App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest());
View
17 app/webroot/test.php
@@ -45,11 +45,11 @@
define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
/**
- * The absolute path to the "cake" directory, WITHOUT a trailing DS.
+ * The absolute path to the "Cake" directory, WITHOUT a trailing DS.
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
- define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}
/**
@@ -67,21 +67,14 @@
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
-if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
+if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
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);
}
-$corePath = App::core('cake');
-if (isset($corePath[0])) {
- define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
-} else {
- define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
-}
-
if (Configure::read('debug') < 1) {
- die(__('Debug setting does not allow access to this url.'));
+ die(__d('cake', 'Debug setting does not allow access to this url.'));
}
-require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
+require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();
View
0 cake/LICENSE.txt
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/VERSION.txt
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
721 cake/basics.php
@@ -1,721 +0,0 @@
-<?php
-/**
- * Basic Cake functionality.
- *
- * Core functions for including other source files, loading models and so forth.
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake
- * @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-
-/**
- * Basic defines for timing functions.
- */
- define('SECOND', 1);
- define('MINUTE', 60);
- define('HOUR', 3600);
- define('DAY', 86400);
- define('WEEK', 604800);
- define('MONTH', 2592000);
- define('YEAR', 31536000);
-
-/**
- * Loads configuration files. Receives a set of configuration files
- * to load.
- * Example:
- *
- * `config('config1', 'config2');`
- *
- * @return boolean Success
- * @link http://book.cakephp.org/view/1125/config
- */
- function config() {
- $args = func_get_args();
- foreach ($args as $arg) {
- if ($arg === 'database' && file_exists(CONFIGS . 'database.php')) {
- include_once(CONFIGS . $arg . '.php');
- } elseif (file_exists(CONFIGS . $arg . '.php')) {
- include_once(CONFIGS . $arg . '.php');
-
- if (count($args) == 1) {
- return true;
- }
- } else {
- if (count($args) == 1) {
- return false;
- }
- }
- }
- return true;
- }
-
-/**
- * Prints out debug information about given variable.
- *
- * Only runs if debug level is greater than zero.
- *
- * @param boolean $var Variable to show debug information for.
- * @param boolean $showHtml If set to true, the method prints the debug data in a browser-friendly way.
- * @param boolean $showFrom If set to true, the method prints from where the function was called.
- * @link http://book.cakephp.org/view/1190/Basic-Debugging
- * @link http://book.cakephp.org/view/1128/debug
- */
- function debug($var = false, $showHtml = null, $showFrom = true) {
- if (Configure::read('debug') > 0) {
- $file = '';
- $line = '';
- if ($showFrom) {
- $calledFrom = debug_backtrace();
- $file = substr(str_replace(ROOT, '', $calledFrom[0]['file']), 1);
- $line = $calledFrom[0]['line'];
- }
- $html = <<<HTML
-<strong>%s</strong> (line <strong>%s</strong>)
-<pre class="cake-debug">
-%s
-</pre>
-HTML;
- $text = <<<TEXT
-
-%s (line %s)
-########## DEBUG ##########
-%s
-###########################
-
-TEXT;
- $template = $html;
- if (php_sapi_name() == 'cli') {
- $template = $text;
- }
- if ($showHtml === null && $template !== $text) {
- $showHtml = true;
- }
- $var = print_r($var, true);
- if ($showHtml) {
- $var = str_replace(array('<', '>'), array('&lt;', '&gt;'), $var);
- }
- printf($template, $file, $line, $var);
- }
- }
-
-if (!function_exists('sortByKey')) {
-
-/**
- * Sorts given $array by key $sortby.
- *
- * @param array $array Array to sort
- * @param string $sortby Sort by this key
- * @param string $order Sort order asc/desc (ascending or descending).
- * @param integer $type Type of sorting to perform
- * @return mixed Sorted array
- */
- function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
- if (!is_array($array)) {
- return null;
- }
-
- foreach ($array as $key => $val) {
- $sa[$key] = $val[$sortby];
- }
-
- if ($order == 'asc') {
- asort($sa, $type);
- } else {
- arsort($sa, $type);
- }
-
- foreach ($sa as $key => $val) {
- $out[] = $array[$key];
- }
- return $out;
- }
-}
-
-/**
- * Convenience method for htmlspecialchars.
- *
- * @param string $text Text to wrap through htmlspecialchars
- * @param boolean $double Encode existing html entities
- * @param string $charset Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8'
- * @return string Wrapped text
- * @link http://book.cakephp.org/view/1132/h
- */
- function h($text, $double = true, $charset = null) {
- if (is_array($text)) {
- $texts = array();
- foreach ($text as $k => $t) {
- $texts[$k] = h($t, $double, $charset);
- }
- return $texts;
- }
-
- static $defaultCharset = false;
- if ($defaultCharset === false) {
- $defaultCharset = Configure::read('App.encoding');
- if ($defaultCharset === null) {
- $defaultCharset = 'UTF-8';
- }
- }
- if (is_string($double)) {
- $charset = $double;
- }
- return htmlspecialchars($text, ENT_QUOTES, ($charset) ? $charset : $defaultCharset, $double);
- }
-
-/**
- * Splits a dot syntax plugin name into its plugin and classname.
- * If $name does not have a dot, then index 0 will be null.
- *
- * Commonly used like `list($plugin, $name) = pluginSplit($name);`
- *
- * @param string $name The name you want to plugin split.
- * @param boolean $dotAppend Set to true if you want the plugin to have a '.' appended to it.
- * @param string $plugin Optional default plugin to use if no plugin is found. Defaults to null.
- * @return array Array with 2 indexes. 0 => plugin name, 1 => classname
- */
- function pluginSplit($name, $dotAppend = false, $plugin = null) {
- if (strpos($name, '.') !== false) {
- $parts = explode('.', $name, 2);
- if ($dotAppend) {
- $parts[0] .= '.';
- }
- return $parts;
- }
- return array($plugin, $name);
- }
-
-/**
- * Print_r convenience function, which prints out <PRE> tags around
- * the output of given array. Similar to debug().
- *
- * @see debug()
- * @param array $var Variable to print out
- * @link http://book.cakephp.org/view/1136/pr
- */
- function pr($var) {
- if (Configure::read('debug') > 0) {
- echo '<pre>';
- print_r($var);
- echo '</pre>';
- }
- }
-
-/**
- * Merge a group of arrays
- *
- * @param array First array
- * @param array Second array
- * @param array Third array
- * @param array Etc...
- * @return array All array parameters merged into one
- * @link http://book.cakephp.org/view/1124/am
- */
- function am() {
- $r = array();
- $args = func_get_args();
- foreach ($args as $a) {
- if (!is_array($a)) {
- $a = array($a);
- }
- $r = array_merge($r, $a);
- }
- return $r;
- }
-
-/**
- * Gets an environment variable from available sources, and provides emulation
- * for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on
- * IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom
- * environment information.
- *
- * @param string $key Environment variable name.
- * @return string Environment variable setting.
- * @link http://book.cakephp.org/view/1130/env
- */
- function env($key) {
- if ($key === 'HTTPS') {
- if (isset($_SERVER['HTTPS'])) {
- return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
- }
- return (strpos(env('SCRIPT_URI'), 'https://') === 0);
- }
-
- if ($key === 'SCRIPT_NAME') {
- if (env('CGI_MODE') && isset($_ENV['SCRIPT_URL'])) {
- $key = 'SCRIPT_URL';
- }
- }
-
- $val = null;
- if (isset($_SERVER[$key])) {
- $val = $_SERVER[$key];
- } elseif (isset($_ENV[$key])) {
- $val = $_ENV[$key];
- } elseif (getenv($key) !== false) {
- $val = getenv($key);
- }
-
- if ($key === 'REMOTE_ADDR' && $val === env('SERVER_ADDR')) {
- $addr = env('HTTP_PC_REMOTE_ADDR');
- if ($addr !== null) {
- $val = $addr;
- }
- }
-
- if ($val !== null) {
- return $val;
- }
-
- switch ($key) {
- case 'SCRIPT_FILENAME':
- if (defined('SERVER_IIS') && SERVER_IIS === true) {
- return str_replace('\\\\', '\\', env('PATH_TRANSLATED'));
- }
- break;
- case 'DOCUMENT_ROOT':
- $name = env('SCRIPT_NAME');
- $filename = env('SCRIPT_FILENAME');
- $offset = 0;
- if (!strpos($name, '.php')) {
- $offset = 4;
- }
- return substr($filename, 0, strlen($filename) - (strlen($name) + $offset));
- break;
- case 'PHP_SELF':
- return str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));
- break;
- case 'CGI_MODE':
- return (PHP_SAPI === 'cgi');
- break;
- case 'HTTP_BASE':
- $host = env('HTTP_HOST');
- $parts = explode('.', $host);
- $count = count($parts);
-
- if ($count === 1) {
- return '.' . $host;
- } elseif ($count === 2) {
- return '.' . $host;
- } elseif ($count === 3) {
- $gTLD = array('aero', 'asia', 'biz', 'cat', 'com', 'coop', 'edu', 'gov', 'info', 'int', 'jobs', 'mil', 'mobi', 'museum', 'name', 'net', 'org', 'pro', 'tel', 'travel', 'xxx');
- if (in_array($parts[1], $gTLD)) {
- return '.' . $host;
- }
- }
- array_shift($parts);
- return '.' . implode('.', $parts);
- break;
- }
- return null;
- }
-
-/**
- * Reads/writes temporary data to cache files or session.
- *
- * @param string $path File path within /tmp to save the file.
- * @param mixed $data The data to save to the temporary file.
- * @param mixed $expires A valid strtotime string when the data expires.
- * @param string $target The target of the cached data; either 'cache' or 'public'.
- * @return mixed The contents of the temporary file.
- * @deprecated Please use Cache::write() instead
- */
- function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
- if (Configure::read('Cache.disable')) {
- return null;
- }
- $now = time();
-
- if (!is_numeric($expires)) {
- $expires = strtotime($expires, $now);
- }
-
- switch (strtolower($target)) {
- case 'cache':
- $filename = CACHE . $path;
- break;
- case 'public':
- $filename = WWW_ROOT . $path;
- break;
- case 'tmp':
- $filename = TMP . $path;
- break;
- }
- $timediff = $expires - $now;
- $filetime = false;
-
- if (file_exists($filename)) {
- $filetime = @filemtime($filename);
- }
-
- if ($data === null) {
- if (file_exists($filename) && $filetime !== false) {
- if ($filetime + $timediff < $now) {
- @unlink($filename);
- } else {
- $data = @file_get_contents($filename);
- }
- }
- } elseif (is_writable(dirname($filename))) {
- @file_put_contents($filename, $data);
- }
- return $data;
- }
-
-/**
- * Used to delete files in the cache directories, or clear contents of cache directories
- *
- * @param mixed $params As String name to be searched for deletion, if name is a directory all files in
- * directory will be deleted. If array, names to be searched for deletion. If clearCache() without params,
- * all files in app/tmp/cache/views will be deleted
- * @param string $type Directory in tmp/cache defaults to view directory
- * @param string $ext The file extension you are deleting
- * @return true if files found and deleted false otherwise
- */
- function clearCache($params = null, $type = 'views', $ext = '.php') {
- if (is_string($params) || $params === null) {
- $params = preg_replace('/\/\//', '/', $params);
- $cache = CACHE . $type . DS . $params;
-
- if (is_file($cache . $ext)) {
- @unlink($cache . $ext);
- return true;
- } elseif (is_dir($cache)) {
- $files = glob($cache . '*');
-
- if ($files === false) {
- return false;
- }
-
- foreach ($files as $file) {
- if (is_file($file) && strrpos($file, DS . 'empty') !== strlen($file) - 6) {
- @unlink($file);
- }
- }
- return true;
- } else {
- $cache = array(
- CACHE . $type . DS . '*' . $params . $ext,
- CACHE . $type . DS . '*' . $params . '_*' . $ext
- );
- $files = array();
- while ($search = array_shift($cache)) {
- $results = glob($search);
- if ($results !== false) {
- $files = array_merge($files, $results);
- }
- }
- if (empty($files)) {
- return false;
- }
- foreach ($files as $file) {
- if (is_file($file) && strrpos($file, DS . 'empty') !== strlen($file) - 6) {
- @unlink($file);
- }
- }
- return true;
- }
- } elseif (is_array($params)) {
- foreach ($params as $file) {
- clearCache($file, $type, $ext);
- }
- return true;
- }
- return false;
- }
-
-/**
- * Recursively strips slashes from all values in an array
- *
- * @param array $values Array of values to strip slashes
- * @return mixed What is returned from calling stripslashes
- * @link http://book.cakephp.org/view/1138/stripslashes_deep
- */
- function stripslashes_deep($values) {
- if (is_array($values)) {
- foreach ($values as $key => $value) {
- $values[$key] = stripslashes_deep($value);
- }
- } else {
- $values = stripslashes($values);
- }
- return $values;
- }
-
-/**
- * Returns a translated string if one is found; Otherwise, the submitted message.
- *
- * @param string $singular Text to translate
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return mixed translated string
- * @link http://book.cakephp.org/view/1121/__
- */
- function __($singular, $args = null) {
- if (!$singular) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($singular);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 1);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * Returns correct plural form of message identified by $singular and $plural for count $count.
- * Some languages have more than one form for plural messages dependent on the count.
- *
- * @param string $singular Singular text to translate
- * @param string $plural Plural text
- * @param integer $count Count
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return mixed plural form of translated string
- */
- function __n($singular, $plural, $count, $args = null) {
- if (!$singular) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($singular, $plural, null, 6, $count);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 3);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * Allows you to override the current domain for a single message lookup.
- *
- * @param string $domain Domain
- * @param string $msg String to translate
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return translated string
- */
- function __d($domain, $msg, $args = null) {
- if (!$msg) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($msg, null, $domain);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 2);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * Allows you to override the current domain for a single plural message lookup.
- * Returns correct plural form of message identified by $singular and $plural for count $count
- * from domain $domain.
- *
- * @param string $domain Domain
- * @param string $singular Singular string to translate
- * @param string $plural Plural
- * @param integer $count Count
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return plural form of translated string
- */
- function __dn($domain, $singular, $plural, $count, $args = null) {
- if (!$singular) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($singular, $plural, $domain, 6, $count);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 4);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * Allows you to override the current domain for a single message lookup.
- * It also allows you to specify a category.
- *
- * The category argument allows a specific category of the locale settings to be used for fetching a message.
- * Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
- *
- * Note that the category must be specified with a numeric value, instead of the constant name. The values are:
- *
- * - LC_ALL 0
- * - LC_COLLATE 1
- * - LC_CTYPE 2
- * - LC_MONETARY 3
- * - LC_NUMERIC 4
- * - LC_TIME 5
- * - LC_MESSAGES 6
- *
- * @param string $domain Domain
- * @param string $msg Message to translate
- * @param integer $category Category
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return translated string
- */
- function __dc($domain, $msg, $category, $args = null) {
- if (!$msg) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($msg, null, $domain, $category);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 3);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * Allows you to override the current domain for a single plural message lookup.
- * It also allows you to specify a category.
- * Returns correct plural form of message identified by $singular and $plural for count $count
- * from domain $domain.
- *
- * The category argument allows a specific category of the locale settings to be used for fetching a message.
- * Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
- *
- * Note that the category must be specified with a numeric value, instead of the constant name. The values are:
- *
- * - LC_ALL 0
- * - LC_COLLATE 1
- * - LC_CTYPE 2
- * - LC_MONETARY 3
- * - LC_NUMERIC 4
- * - LC_TIME 5
- * - LC_MESSAGES 6
- *
- * @param string $domain Domain
- * @param string $singular Singular string to translate
- * @param string $plural Plural
- * @param integer $count Count
- * @param integer $category Category
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return plural form of translated string
- */
- function __dcn($domain, $singular, $plural, $count, $category, $args = null) {
- if (!$singular) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($singular, $plural, $domain, $category, $count);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 5);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * The category argument allows a specific category of the locale settings to be used for fetching a message.
- * Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
- *
- * Note that the category must be specified with a numeric value, instead of the constant name. The values are:
- *
- * - LC_ALL 0
- * - LC_COLLATE 1
- * - LC_CTYPE 2
- * - LC_MONETARY 3
- * - LC_NUMERIC 4
- * - LC_TIME 5
- * - LC_MESSAGES 6
- *
- * @param string $msg String to translate
- * @param integer $category Category
- * @param mixed $args Array with arguments or multiple arguments in function
- * @return translated string
- */
- function __c($msg, $category, $args = null) {
- if (!$msg) {
- return;
- }
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
- $translated = I18n::translate($msg, null, null, $category);
- if ($args === null) {
- return $translated;
- } elseif (!is_array($args)) {
- $args = array_slice(func_get_args(), 2);
- }
- return vsprintf($translated, $args);
- }
-
-/**
- * Shortcut to Log::write.
- *
- * @param string $message Message to write to log
- */
- function LogError($message) {
- if (!class_exists('CakeLog')) {
- App::import('Core', 'CakeLog');
- }
- $bad = array("\n", "\r", "\t");
- $good = ' ';
- CakeLog::write('error', str_replace($bad, $good, $message));
- }
-
-/**
- * Searches include path for files.
- *
- * @param string $file File to look for
- * @return Full path to file if exists, otherwise false
- * @link http://book.cakephp.org/view/1131/fileExistsInPath
- */
- function fileExistsInPath($file) {
- $paths = explode(PATH_SEPARATOR, ini_get('include_path'));
- foreach ($paths as $path) {
- $fullPath = $path . DS . $file;
-
- if (file_exists($fullPath)) {
- return $fullPath;
- } elseif (file_exists($file)) {
- return $file;
- }
- }
- return false;
- }
-
-/**
- * Convert forward slashes to underscores and removes first and last underscores in a string
- *
- * @param string String to convert
- * @return string with underscore remove from start and end of string
- * @link http://book.cakephp.org/view/1126/convertSlash
- */
- function convertSlash($string) {
- $string = trim($string, '/');
- $string = preg_replace('/\/\//', '/', $string);
- $string = str_replace('/', '_', $string);
- return $string;
- }
View
39 cake/bootstrap.php
@@ -1,39 +0,0 @@
-<?php
-/**
- * Basic Cake functionality.
- *
- * Handles loading of core files needed on every request
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake
- * @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-if (!defined('E_DEPRECATED')) {
- define('E_DEPRECATED', 8192);
-}
-error_reporting(E_ALL & ~E_DEPRECATED);
-
-require CORE_PATH . 'cake' . DS . 'basics.php';
-require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
-require LIBS . 'error' . DS . 'exceptions.php';
-require LIBS . 'object.php';
-require LIBS . 'object_collection.php';
-require LIBS . 'inflector.php';
-require LIBS . 'app.php';
-require LIBS . 'configure.php';
-require LIBS . 'set.php';
-require LIBS . 'cache.php';
-require LIBS . 'error' . DS . 'error_handler.php';
-
-Configure::bootstrap(isset($boot) ? $boot : true);
-
View
0 cake/config/config.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
230 cake/config/paths.php
@@ -1,230 +0,0 @@
-<?php
-/**
- * Path configuration
- *
- * In this file you set paths to different directories used by Cake.
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake.config
- * @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-
-/**
- * If the index.php file is used instead of an .htaccess file
- * or if the user can not set the web root to use the public
- * directory we will define ROOT there, otherwise we set it
- * here.
- */
- if (!defined('ROOT')) {
- define('ROOT', '../');
- }
- if (!defined('WEBROOT_DIR')) {
- define('WEBROOT_DIR', 'webroot');
- }
-
-/**
- * Path to the cake directory.
- */
- define('CAKE', CORE_PATH.'cake'.DS);
-
-/**
- * Path to the application's directory.
- */
-if (!defined('APP')) {
- define('APP', ROOT.DS.APP_DIR.DS);
-}
-
-/**
- * Path to the application's models directory.
- */
- define('MODELS', APP.'models'.DS);
-
-/**
- * Path to model behaviors directory.
- */
- define('BEHAVIORS', MODELS.'behaviors'.DS);
-
-/**
- * Path to the application's controllers directory.
- */
- define('CONTROLLERS', APP.'controllers'.DS);
-
-/**
- * Path to the application's components directory.
- */
- define('COMPONENTS', CONTROLLERS.'components'.DS);
-
-/**
- * Path to the application's libs directory.
- */
- define('APPLIBS', APP.'libs'.DS);
-
-/**
- * Path to the application's views directory.
- */
- define('VIEWS', APP.'views'.DS);
-
-/**
- * Path to the application's helpers directory.
- */
- define('HELPERS', VIEWS.'helpers'.DS);
-
-/**
- * Path to the application's view's layouts directory.
- */
- define('LAYOUTS', VIEWS.'layouts'.DS);
-
-/**
- * Path to the application's view's elements directory.
- * It's supposed to hold pieces of PHP/HTML that are used on multiple pages
- * and are not linked to a particular layout (like polls, footers and so on).
- */
- define('ELEMENTS', VIEWS.'elements'.DS);
-
-/**
- * Path to the configuration files directory.
- */
-if (!defined('CONFIGS')) {
- define('CONFIGS', APP.'config'.DS);
-}
-
-/**
- * Path to the libs directory.
- */
- define('LIBS', CAKE.'libs'.DS);
-
-/**
- * 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 console libs direcotry.
- */
- define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS);
-
-/**
- * Path to the tests directory.
- */
-if (!defined('TESTS')) {
- define('TESTS', APP.'tests'.DS);
-}
-
-/**
- * Path to the core tests directory.
- */
-if (!defined('CAKE_TESTS')) {
- define('CAKE_TESTS', CAKE.'tests'.DS);
-}
-
-/**
- * Path to the test suite.
- */
- define('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS);
-
-/**
- * Path to the controller test directory.
- */
- define('CONTROLLER_TESTS', TESTS.'cases'.DS.'controllers'.DS);
-
-/**
- * Path to the components test directory.
- */
- define('COMPONENT_TESTS', TESTS.'cases'.DS.'components'.DS);
-
-/**
- * Path to the helpers test directory.
- */
- define('HELPER_TESTS', TESTS.'cases'.DS.'views'.DS.'helpers'.DS);
-
-/**
- * Path to the models' test directory.
- */
- define('MODEL_TESTS', TESTS.'cases'.DS.'models'.DS);
-
-/**
- * Path to the lib test directory.
- */
- define('LIB_TESTS', CAKE_TESTS.'cases'.DS.'lib'.DS);
-
-/**
- * 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')) {
- define('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS);
-}
-
-/**
- * Full url prefix
- */
-if (!defined('FULL_BASE_URL')) {
- $s = null;
- if (env('HTTPS')) {
- $s ='s';
- }
-
- $httpHost = env('HTTP_HOST');
-
- if (isset($httpHost)) {
- define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost);
- }
- unset($httpHost, $s);
-}
-
-/**
- * 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/');
-}
View
0 cake/config/unicode/casefolding/0080_00ff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0100_017f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0180_024F.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0250_02af.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0370_03ff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0400_04ff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0500_052f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/0530_058f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/1e00_1eff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/1f00_1fff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/2100_214f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/2150_218f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/2460_24ff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/2c00_2c5f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/2c60_2c7f.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/2c80_2cff.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/config/unicode/casefolding/ff00_ffef.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/console/cake
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
0 cake/console/cake.bat
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
24 cake/console/cake.php
@@ -1,24 +0,0 @@
-#!/usr/bin/php -q
-<?php
-/**
- * Command-line code generation utility to automate programmer chores.
- *
- * Shell dispatcher class
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc.
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console
- * @since CakePHP(tm) v 1.2.0.5012
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'shell_dispatcher.php');
-
-return ShellDispatcher::run($argv);
View
91 cake/console/libs/console_error_handler.php
@@ -1,91 +0,0 @@
-<?php
-/**
- * ErrorHandler for Console Shells
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs
- * @since CakePHP(tm) v 2.0
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-App::import('Core', 'ErrorHandler');
-require_once 'console_output.php';
-
-/**
- * Error Handler for Cake console. Does simple printing of the
- * exception that occurred and the stack trace of the error.
- *
- * @package cake.console.libs
- */
-class ConsoleErrorHandler extends ErrorHandler {
-
-/**
- * Standard error stream.
- *
- * @var filehandle
- * @access public
- */
- public static $stderr;
-
-/**
- * Get the stderr object for the console error handling.
- *
- * @param Exception $error Exception to handle.
- * @param array $messages Error messages
- */
- public static function getStderr() {
- if (empty(self::$stderr)) {
- self::$stderr = new ConsoleOutput('php://stderr');
- }
- return self::$stderr;
- }
-
-/**
- * Handle a exception in the console environment. Prints a message to stderr.
- *
- * @param Exception $exception The exception to handle
- * @return void
- */
- public static function handleException(Exception $exception) {
- $stderr = self::getStderr();
- $stderr->write(sprintf(
- __("<error>Error:</error> %s\n%s"),
- $exception->getMessage(),
- $exception->getTraceAsString()
- ));
- }
-
-/**
- * Handle errors in the console environment.
- *
- * @param int $code Error code
- * @param string $description Description of the error.
- * @param string $file The file the error occurred in.
- * @param int $line The line the error ocurrred on.
- * @param array $context The backtrace of the error.
- * @return void
- */
- public static function handleError($code, $description, $file = null, $line = null, $context = null) {
- if (error_reporting() === 0) {
- return;
- }
- $stderr = self::getStderr();
- list($name, $log) = self::_mapErrorCode($code);
- $message = __('%s in [%s, line %s]', $description, $file, $line);
- $stderr->write(__("<error>%s Error:</error> %s\n", $name, $message));
-
- if (Configure::read('debug') == 0) {
- App::import('Core', 'CakeLog');
- CakeLog::write($log, $message);
- }
- }
-
-}
View
0 cake/console/libs/console_input.php
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
167 cake/console/libs/console_input_argument.php
@@ -1,167 +0,0 @@
-<?php
-/**
- * ConsoleArgumentOption file
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs
- * @since CakePHP(tm) v 2.0
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-/**
- * An object to represent a single argument used in the command line.
- * ConsoleOptionParser creates these when you use addArgument()
- *
- * @see ConsoleOptionParser::addArgument()
- * @package cake.console.libs
- */
-class ConsoleInputArgument {
-/**
- * Name of the argument.
- *
- * @var string
- */
- protected $_name;
-
-/**
- * Help string
- *
- * @var string
- */
- protected $_help;
-
-/**
- * Is this option required?
- *
- * @var boolean
- */
- protected $_required;
-
-/**
- * An array of valid choices for this argument.
- *
- * @var array
- */
- protected $_choices;
-
-/**
- * Make a new Input Argument
- *
- * @param mixed $name The long name of the option, or an array with all the properites.
- * @param string $help The help text for this option
- * @param boolean $required Whether this argument is required. Missing required args will trigger exceptions
- * @param array $choices Valid choices for this option.
- */
- public function __construct($name, $help = '', $required = false, $choices = array()) {
- if (is_array($name) && isset($name['name'])) {
- foreach ($name as $key => $value) {
- $this->{'_' . $key} = $value;
- }
- } else {
- $this->_name = $name;
- $this->_help = $help;
- $this->_required = $required;
- $this->_choices = $choices;
- }
- }
-
-/**
- * Get the value of the name attribute.
- *
- * @return string Value of this->_name.
- */
- public function name() {
- return $this->_name;
- }
-
-/**
- * Generate the help for this argument.
- *
- * @param int $width The width to make the name of the option.
- * @return string
- */
- public function help($width = 0) {
- $name = $this->_name;
- if (strlen($name) < $width) {
- $name = str_pad($name, $width, ' ');
- }
- $optional = '';
- if (!$this->isRequired()) {
- $optional = __(' <comment>(optional)</comment>');
- }
- if (!empty($this->_choices)) {
- $optional .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
- }
- return sprintf('%s%s%s', $name, $this->_help, $optional);
- }
-
-/**
- * Get the usage value for this argument
- *
- * @return string
- */
- public function usage() {
- $name = $this->_name;
- if (!empty($this->_choices)) {
- $name = implode('|', $this->_choices);
- }
- $name = '<' . $name . '>';
- if (!$this->isRequired()) {
- $name = '[' . $name . ']';
- }
- return $name;
- }
-
-/**
- * Check if this argument is a required argument
- *
- * @return boolean
- */
- public function isRequired() {
- return (bool) $this->_required;
- }
-
-/**
- * Check that $value is a valid choice for this argument.
- *
- * @return boolean
- */
- public function validChoice($value) {
- if (empty($this->_choices)) {
- return true;
- }
- if (!in_array($value, $this->_choices)) {
- throw new ConsoleException(sprintf(
- __('"%s" is not a valid value for %s. Please use one of "%s"'),
- $value, $this->_name, implode(', ', $this->_choices)
- ));
- }
- return true;
- }
-
-/**
- * Append this arguments XML representation to the passed in SimpleXml object.
- *
- * @param SimpleXmlElement The parent element.
- * @return SimpleXmlElement The parent with this argument appended.
- */
- public function xml(SimpleXmlElement $parent) {
- $option = $parent->addChild('argument');
- $option->addAttribute('name', $this->_name);
- $option->addAttribute('help', $this->_help);
- $option->addAttribute('required', $this->isRequired());
- $choices = $option->addChild('choices');
- foreach ($this->_choices as $valid) {
- $choices->addChild('choice', $valid);
- }
- return $parent;
- }
-}
View
212 cake/console/libs/console_input_option.php
@@ -1,212 +0,0 @@
-<?php
-/**
- * ConsoleInputOption file
- *
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs
- * @since CakePHP(tm) v 2.0
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-
-/**
- * An object to represent a single option used in the command line.
- * ConsoleOptionParser creates these when you use addOption()
- *
- * @see ConsoleOptionParser::addOption()
- * @package cake.console.libs
- */
-class ConsoleInputOption {
-/**
- * Name of the option
- *
- * @var string
- */
- protected $_name;
-
-/**
- * Short (1 character) alias for the option.
- *
- * @var string
- */
- protected $_short;
-
-/**
- * Help text for the option.
- *
- * @var string
- */
- protected $_help;
-
-/**
- * Is the option a boolean option. Boolean options do not consume a parameter.
- *
- * @var boolean
- */
- protected $_boolean;
-
-/**
- * Default value for the option
- *
- * @var mixed
- */
- protected $_default;
-
-/**
- * An array of choices for the option.
- *
- * @var array
- */
- protected $_choices;
-
-/**
- * Make a new Input Option
- *
- * @param mixed $name The long name of the option, or an array with all the properites.
- * @param string $short The short alias for this option
- * @param string $help The help text for this option
- * @param boolean $boolean Whether this option is a boolean option. Boolean options don't consume extra tokens
- * @param string $default The default value for this option.
- * @param array $choices Valid choices for this option.
- */
- public function __construct($name, $short = null, $help = '', $boolean = false, $default = '', $choices = array()) {
- if (is_array($name) && isset($name['name'])) {
- foreach ($name as $key => $value) {
- $this->{'_' . $key} = $value;
- }
- } else {
- $this->_name = $name;
- $this->_short = $short;
- $this->_help = $help;
- $this->_boolean = $boolean;
- $this->_default = $default;
- $this->_choices = $choices;
- }
- }
-
-/**
- * Get the value of the name attribute.
- *
- * @return string Value of this->_name.
- */
- public function name() {
- return $this->_name;
- }
-
-/**
- * Get the value of the short attribute.
- *
- * @return string Value of this->_short.
- */
- public function short() {
- return $this->_short;
- }
-
-/**
- * Generate the help for this this option.
- *
- * @param int $width The width to make the name of the option.
- * @return string
- */
- public function help($width = 0) {
- $default = $short = '';
- if (!empty($this->_default) && $this->_default !== true) {
- $default = __(' <comment>(default: %s)</comment>', $this->_default);
- }
- if (!empty($this->_choices)) {
- $default .= __(' <comment>(choices: %s)</comment>', implode('|', $this