Permalink
Browse files

Merge branch '1.3' into 1.3-jshelper

Conflicts:
	cake/libs/view/helpers/html.php
	cake/libs/view/helpers/js.php
	cake/tests/cases/libs/view/helpers/html.test.php
	cake/tests/cases/libs/view/helpers/js.test.php
	cake/tests/lib/header.php
  • Loading branch information...
2 parents ed10374 + cfb4602 commit def4c98a0868f1700fa8060056fb1ea2953044ff @markstory markstory committed Jul 25, 2009
Showing 462 changed files with 6,744 additions and 347 deletions.
View
@@ -1,5 +1,6 @@
<?php
/* SVN FILE: $Id$ */
+
/**
* Basic Cake functionality.
*
@@ -24,6 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Basic defines for timing functions.
*/
@@ -34,6 +36,7 @@
define('WEEK', 7 * DAY);
define('MONTH', 30 * DAY);
define('YEAR', 365 * DAY);
+
/**
* Patch for PHP < 5.0
*/
@@ -46,6 +49,7 @@ function clone($object)
}');
}
}
+
/**
* Loads configuration files. Receives a set of configuration files
* to load.
@@ -75,6 +79,7 @@ function config() {
}
return true;
}
+
/**
* Loads component/components from LIBS. Takes optional number of parameters.
*
@@ -91,6 +96,7 @@ function uses() {
require_once(LIBS . strtolower($file) . '.php');
}
}
+
/**
* Prints out debug information about given variable.
*
@@ -118,6 +124,7 @@ function debug($var = false, $showHtml = false, $showFrom = true) {
}
}
if (!function_exists('getMicrotime')) {
+
/**
* Returns microtime for execution time checking
*
@@ -129,6 +136,7 @@ function getMicrotime() {
}
}
if (!function_exists('sortByKey')) {
+
/**
* Sorts given $array by key $sortby.
*
@@ -160,6 +168,7 @@ function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
}
}
if (!function_exists('array_combine')) {
+
/**
* Combines given identical arrays by using the first array's values as keys,
* and the second one's values as values. (Implemented for backwards compatibility with PHP4)
@@ -188,6 +197,7 @@ function array_combine($a1, $a2) {
return $output;
}
}
+
/**
* Convenience method for htmlspecialchars.
*
@@ -208,6 +218,7 @@ function h($text, $charset = null) {
}
return htmlspecialchars($text, ENT_QUOTES, $charset);
}
+
/**
* Returns an array of all the given parameters.
*
@@ -228,6 +239,7 @@ function a() {
$args = func_get_args();
return $args;
}
+
/**
* Constructs associative array from pairs of arguments.
*
@@ -257,6 +269,7 @@ function aa() {
}
return $a;
}
+
/**
* Convenience method for echo().
*
@@ -266,6 +279,7 @@ function aa() {
function e($text) {
echo $text;
}
+
/**
* Convenience method for strtolower().
*
@@ -276,6 +290,7 @@ function e($text) {
function low($str) {
return strtolower($str);
}
+
/**
* Convenience method for strtoupper().
*
@@ -286,6 +301,7 @@ function low($str) {
function up($str) {
return strtoupper($str);
}
+
/**
* Convenience method for str_replace().
*
@@ -298,6 +314,7 @@ function up($str) {
function r($search, $replace, $subject) {
return str_replace($search, $replace, $subject);
}
+
/**
* Print_r convenience function, which prints out <PRE> tags around
* the output of given array. Similar to debug().
@@ -314,6 +331,7 @@ function pr($var) {
echo '</pre>';
}
}
+
/**
* Display parameters.
*
@@ -329,6 +347,7 @@ function params($p) {
}
return $p;
}
+
/**
* Merge a group of arrays
*
@@ -350,6 +369,7 @@ function am() {
}
return $r;
}
+
/**
* Gets an environment variable from available sources, and provides emulation
* for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on
@@ -426,6 +446,7 @@ function env($key) {
return null;
}
if (!function_exists('file_put_contents')) {
+
/**
* Writes data into file.
*
@@ -453,6 +474,7 @@ function file_put_contents($fileName, $data) {
return false;
}
}
+
/**
* Reads/writes temporary data to cache files or session.
*
@@ -504,6 +526,7 @@ function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
}
return $data;
}
+
/**
* Used to delete files in the cache directories, or clear contents of cache directories
*
@@ -566,6 +589,7 @@ function clearCache($params = null, $type = 'views', $ext = '.php') {
}
return false;
}
+
/**
* Recursively strips slashes from all values in an array
*
@@ -583,6 +607,7 @@ function stripslashes_deep($values) {
}
return $values;
}
+
/**
* Returns a translated string if one is found; Otherwise, the submitted message.
*
@@ -605,6 +630,7 @@ function __($singular, $return = false) {
return I18n::translate($singular);
}
}
+
/**
* 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.
@@ -629,6 +655,7 @@ function __n($singular, $plural, $count, $return = false) {
return I18n::translate($singular, $plural, null, 6, $count);
}
}
+
/**
* Allows you to override the current domain for a single message lookup.
*
@@ -651,6 +678,7 @@ function __d($domain, $msg, $return = false) {
return I18n::translate($msg, null, $domain);
}
}
+
/**
* 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
@@ -677,6 +705,7 @@ function __dn($domain, $singular, $plural, $count, $return = false) {
return I18n::translate($singular, $plural, $domain, 6, $count);
}
}
+
/**
* Allows you to override the current domain for a single message lookup.
* It also allows you to specify a category.
@@ -713,6 +742,7 @@ function __dc($domain, $msg, $category, $return = false) {
return I18n::translate($msg, null, $domain, $category);
}
}
+
/**
* Allows you to override the current domain for a single plural message lookup.
* It also allows you to specify a category.
@@ -753,6 +783,7 @@ function __dcn($domain, $singular, $plural, $count, $category, $return = false)
return I18n::translate($singular, $plural, $domain, $category, $count);
}
}
+
/**
* 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.
@@ -785,6 +816,7 @@ function __c($msg, $category, $return = false) {
return I18n::translate($msg, null, null, $category);
}
}
+
/**
* Computes the difference of arrays using keys for comparison.
*
@@ -819,6 +851,7 @@ function array_diff_key() {
return $valuesDiff;
}
}
+
/**
* Computes the intersection of arrays using keys for comparison
*
@@ -837,6 +870,7 @@ function array_intersect_key($arr1, $arr2) {
return $res;
}
}
+
/**
* Shortcut to Log::write.
*
@@ -850,6 +884,7 @@ function LogError($message) {
$good = ' ';
CakeLog::write('error', str_replace($bad, $good, $message));
}
+
/**
* Searches include path for files.
*
@@ -870,6 +905,7 @@ function fileExistsInPath($file) {
}
return false;
}
+
/**
* Convert forward slashes to underscores and removes first and last underscores in a string
*
@@ -883,6 +919,7 @@ function convertSlash($string) {
$string = str_replace('/', '_', $string);
return $string;
}
+
/**
* Implements http_build_query for PHP4.
*
@@ -922,6 +959,7 @@ function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null
return implode($argSep, $out);
}
}
+
/**
* Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2.
* Don't use for isset() conditions, or wrap your variable with @ operator:
Oops, something went wrong.

0 comments on commit def4c98

Please sign in to comment.