Permalink
Browse files

Merge branch '1.3-misc' into mergers

Conflicts:
	cake/libs/model/datasources/dbo_source.php
	cake/libs/view/helpers/js.php
  • Loading branch information...
2 parents 6b2154d + 173b4e7 commit 7a620b62b00f88eae878a9f88428e1aea6eadce9 @markstory markstory committed Dec 27, 2009
Showing with 1,228 additions and 297 deletions.
  1. +0 −1 app/config/core.php
  2. +14 −1 cake/basics.php
  3. +9 −5 cake/console/templates/default/classes/controller.ctp
  4. +6 −4 cake/libs/cache.php
  5. +2 −1 cake/libs/controller/components/auth.php
  6. +12 −2 cake/libs/controller/components/request_handler.php
  7. +14 −3 cake/libs/controller/components/security.php
  8. +75 −47 cake/libs/controller/controller.php
  9. +29 −2 cake/libs/error.php
  10. +52 −19 cake/libs/model/datasources/datasource.php
  11. +266 −111 cake/libs/model/datasources/dbo_source.php
  12. +61 −10 cake/libs/model/model.php
  13. +42 −7 cake/libs/validation.php
  14. +54 −0 cake/libs/view/elements/sql_dump.ctp
  15. +7 −8 cake/libs/view/{elements/dump.ctp → errors/error500.ctp}
  16. +11 −11 cake/libs/view/helpers/ajax.php
  17. +8 −3 cake/libs/view/helpers/js.php
  18. +19 −4 cake/libs/view/helpers/number.php
  19. +1 −1 cake/libs/view/layouts/default.ctp
  20. +0 −10 cake/libs/view/view.php
  21. +12 −11 cake/tests/cases/console/libs/api.test.php
  22. +5 −0 cake/tests/cases/console/libs/bake.test.php
  23. +7 −1 cake/tests/cases/console/libs/tasks/controller.test.php
  24. +3 −8 cake/tests/cases/console/libs/tasks/extract.test.php
  25. +55 −0 cake/tests/cases/libs/controller/components/auth.test.php
  26. +15 −0 cake/tests/cases/libs/controller/components/cookie.test.php
  27. +8 −2 cake/tests/cases/libs/controller/components/request_handler.test.php
  28. +27 −2 cake/tests/cases/libs/controller/components/security.test.php
  29. +65 −1 cake/tests/cases/libs/controller/controller.test.php
  30. +7 −7 cake/tests/cases/libs/controller/scaffold.test.php
  31. +26 −1 cake/tests/cases/libs/error.test.php
  32. +153 −8 cake/tests/cases/libs/model/datasources/dbo_source.test.php
  33. +82 −2 cake/tests/cases/libs/model/model_read.test.php
  34. +40 −0 cake/tests/cases/libs/validation.test.php
  35. +8 −0 cake/tests/cases/libs/view/helpers/ajax.test.php
  36. +7 −3 cake/tests/cases/libs/view/helpers/js.test.php
  37. +12 −0 cake/tests/cases/libs/view/helpers/number.test.php
  38. +8 −0 cake/tests/cases/libs/view/view.test.php
  39. +6 −0 cake/tests/groups/lib.group.php
  40. +0 −1 cake/tests/test_app/views/layouts/default.ctp
  41. 0 vendors/css/empty
  42. 0 vendors/js/empty
View
@@ -29,7 +29,6 @@
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
- * 3: As in 2, but also with full controller dump.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
View
@@ -81,7 +81,7 @@ function config() {
* `uses('flay', 'time');`
*
* @param string $name Filename without the .php part
- * @deprecated
+ * @deprecated Will be removed in 2.0
*/
function uses() {
$args = func_get_args();
@@ -169,6 +169,7 @@ function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
* @param array $a1 Array to use for keys
* @param array $a2 Array to use for values
* @return mixed Outputs either combined array or false.
+ * @deprecated Will be removed in 2.0
*/
function array_combine($a1, $a2) {
$a1 = array_values($a1);
@@ -247,6 +248,7 @@ function pluginSplit($name, $dotAppend = false, $plugin = null) {
*
* @return array Array of given parameters
* @link http://book.cakephp.org/view/694/a
+ * @deprecated Will be removed in 2.0
*/
function a() {
$args = func_get_args();
@@ -266,6 +268,7 @@ function a() {
*
* @return array Associative array
* @link http://book.cakephp.org/view/695/aa
+ * @deprecated Will be removed in 2.0
*/
function aa() {
$args = func_get_args();
@@ -286,6 +289,7 @@ function aa() {
*
* @param string $text String to echo
* @link http://book.cakephp.org/view/700/e
+ * @deprecated Will be removed in 2.0
*/
function e($text) {
echo $text;
@@ -297,6 +301,7 @@ function e($text) {
* @param string $str String to lowercase
* @return string Lowercased string
* @link http://book.cakephp.org/view/705/low
+ * @deprecated Will be removed in 2.0
*/
function low($str) {
return strtolower($str);
@@ -308,6 +313,7 @@ function low($str) {
* @param string $str String to uppercase
* @return string Uppercased string
* @link http://book.cakephp.org/view/710/up
+ * @deprecated Will be removed in 2.0
*/
function up($str) {
return strtoupper($str);
@@ -321,6 +327,7 @@ function up($str) {
* @param string $subject String to search
* @return string Replaced string
* @link http://book.cakephp.org/view/708/r
+ * @deprecated Will be removed in 2.0
*/
function r($search, $replace, $subject) {
return str_replace($search, $replace, $subject);
@@ -348,6 +355,7 @@ function pr($var) {
*
* @param mixed $p Parameter as string or array
* @return string
+ * @deprecated Will be removed in 2.0
*/
function params($p) {
if (!is_array($p) || count($p) == 0) {
@@ -466,6 +474,7 @@ function env($key) {
* @param string $fileName File name.
* @param mixed $data String or array.
* @return boolean Success
+ * @deprecated Will be removed in 2.0
*/
function file_put_contents($fileName, $data) {
if (is_array($data)) {
@@ -836,6 +845,7 @@ function __c($msg, $category, $return = false) {
* @param array First array
* @param array Second array
* @return array Array with different keys
+ * @deprecated Will be removed in 2.0
*/
if (!function_exists('array_diff_key')) {
function array_diff_key() {
@@ -871,6 +881,7 @@ function array_diff_key() {
* @param array First array
* @param array Second array
* @return array Array with interesected keys
+ * @deprecated Will be removed in 2.0
*/
if (!function_exists('array_intersect_key')) {
function array_intersect_key($arr1, $arr2) {
@@ -942,6 +953,7 @@ function convertSlash($string) {
* @param string $baseKey Base key
* @return string URL encoded query string
* @see http://php.net/http_build_query
+ * @deprecated Will be removed in 2.0
*/
if (!function_exists('http_build_query')) {
function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null) {
@@ -985,6 +997,7 @@ function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null
* @param mixed $val2 Value to return if condition doesn't match
* @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression.
* @link http://book.cakephp.org/view/704/ife
+ * @deprecated Will be removed in 2.0
*/
function ife($condition, $val1 = null, $val2 = null) {
if (!empty($condition)) {
@@ -29,13 +29,17 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App
var $scaffold;
<?php else: ?>
<?php
-echo "\tvar \$helpers = array('Html', 'Form'";
if (count($helpers)):
- foreach ($helpers as $help):
- echo ", '" . Inflector::camelize($help) . "'";
- endforeach;
+ echo "\tvar \$helpers = array(";
+ for ($i = 0, $len = count($helpers); $i < $len; $i++):
+ if ($i != $len - 1):
+ echo "'" . Inflector::camelize($helpers[$i]) . "', ";
+ else:
+ echo "'" . Inflector::camelize($helpers[$i]) . "'";
+ endif;
+ endfor;
+ echo ");\n";
endif;
-echo ");\n";
if (count($components)):
echo "\tvar \$components = array(";
View
@@ -196,11 +196,13 @@ function __loadEngine($name, $plugin = null) {
if ($plugin) {
return App::import('Lib', $plugin . '.cache' . DS . $name, false);
} else {
- $app = App::import('Lib', 'cache' . DS . $name, false);
- if (!$app) {
- require LIBS . 'cache' . DS . strtolower($name) . '.php';
+ $core = App::core();
+ $path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
+ if (file_exists($path)) {
+ require $path;
+ return true;
}
- return true;
+ return App::import('Lib', 'cache' . DS . $name, false);
}
}
@@ -253,7 +253,7 @@ class AuthComponent extends Object {
* @return void
* @access public
*/
- function initialize(&$controller) {
+ function initialize(&$controller, $settings = array()) {
$this->params = $controller->params;
$crud = array('create', 'read', 'update', 'delete');
$this->actionMap = array_merge($this->actionMap, array_combine($crud, $crud));
@@ -275,6 +275,7 @@ function initialize(&$controller) {
));
}
}
+ $this->_set($settings);
if (Configure::read() > 0) {
App::import('Debugger');
Debugger::checkSessionKey();
@@ -165,14 +165,16 @@ function __construct() {
* as the first item.
*
* @param object $controller A reference to the controller
+ * @param array $settings Array of settings to _set().
* @return void
* @see Router::parseExtensions()
* @access public
*/
- function initialize(&$controller) {
+ function initialize(&$controller, $settings = array()) {
if (isset($controller->params['url']['ext'])) {
$this->ext = $controller->params['url']['ext'];
}
+ $this->_set($settings);
}
/**
@@ -408,7 +410,7 @@ function setContent($name, $type = null) {
* @return string Server address
* @access public
*/
- function getReferrer() {
+ function getReferer() {
if (env('HTTP_HOST') != null) {
$sessHost = env('HTTP_HOST');
}
@@ -420,6 +422,14 @@ function getReferrer() {
}
/**
+ * @deprecated use getReferer()
+ */
+ function getReferrer() {
+ trigger_error('Deprecated method, use RequestHandlerComponent::getReferer instead', E_USER_WARNING);
+ return $this->getReferer();
+ }
+
+/**
* Gets remote client IP
*
* @return string Client IP address
@@ -169,9 +169,22 @@ class SecurityComponent extends Object {
var $_action = null;
/**
+ * Initialize the SecurityComponent
+ *
+ * @param object $controller Controller instance for the request
+ * @param array $settings Settings to set to the component
+ * @return void
+ * @access public
+ */
+ function initialize(&$controller, $settings = array()) {
+ $this->_set($settings);
+ }
+
+/**
* Component startup. All security checking happens here.
*
* @param object $controller Instantiating controller
+ * @return void
* @access public
*/
function startup(&$controller) {
@@ -342,7 +355,7 @@ function loginRequest($options = array()) {
if (strtolower($options['type']) == 'digest') {
$out[] = 'qop="auth"';
$out[] = 'nonce="' . uniqid("") . '"';
- $out[] = 'opaque="' . md5($options['realm']).'"';
+ $out[] = 'opaque="' . md5($options['realm']) . '"';
}
return $auth . ' ' . implode(',', $out);
@@ -719,10 +732,8 @@ function _callback(&$controller, $method, $params = array()) {
if (is_callable(array($controller, $method))) {
return call_user_func_array(array(&$controller, $method), empty($params) ? null : $params);
} else {
- // Debug::warning('Callback method ' . $method . ' in controller ' . get_class($controller)
return null;
}
}
}
-
?>
Oops, something went wrong.

0 comments on commit 7a620b6

Please sign in to comment.