mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fixing incorrectly position phpdoc blocks.
Adding more documentation to basic CakePHP functions and Dispatcher. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5852 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
897825d596
commit
2e896e5220
2 changed files with 44 additions and 55 deletions
|
@ -244,7 +244,6 @@
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get CakePHP basic paths as an indexed array.
|
* Get CakePHP basic paths as an indexed array.
|
||||||
* Resulting array will contain array of paths
|
* Resulting array will contain array of paths
|
||||||
|
@ -706,21 +705,21 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Loads component/components from LIBS.
|
* Loads component/components from LIBS. Takes optional number of parameters.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* uses('flay', 'time');
|
* uses('flay', 'time');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @uses LIBS
|
* @param string $name Filename without the .php part
|
||||||
*/
|
*/
|
||||||
function uses() {
|
function uses() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$c = func_num_args();
|
$c = func_num_args();
|
||||||
|
|
||||||
for ($i = 0; $i < $c; $i++) {
|
for ($i = 0; $i < $c; $i++) {
|
||||||
require_once(LIBS . strtolower($args[$i]) . '.php');
|
require_once(LIBS . low($args[$i]) . '.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -782,17 +781,18 @@
|
||||||
print "{$var}\n</pre>\n";
|
print "{$var}\n</pre>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!function_exists('getMicrotime')) {
|
||||||
/**
|
/**
|
||||||
* Returns microtime for execution time checking
|
* Returns microtime for execution time checking
|
||||||
*
|
*
|
||||||
* @return float Microtime
|
* @return float Microtime
|
||||||
*/
|
*/
|
||||||
if (!function_exists('getMicrotime')) {
|
|
||||||
function getMicrotime() {
|
function getMicrotime() {
|
||||||
list($usec, $sec) = explode(" ", microtime());
|
list($usec, $sec) = explode(" ", microtime());
|
||||||
return ((float)$usec + (float)$sec);
|
return ((float)$usec + (float)$sec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!function_exists('sortByKey')) {
|
||||||
/**
|
/**
|
||||||
* Sorts given $array by key $sortby.
|
* Sorts given $array by key $sortby.
|
||||||
*
|
*
|
||||||
|
@ -802,7 +802,6 @@
|
||||||
* @param int $type Type of sorting to perform
|
* @param int $type Type of sorting to perform
|
||||||
* @return mixed Sorted array
|
* @return mixed Sorted array
|
||||||
*/
|
*/
|
||||||
if (!function_exists('sortByKey')) {
|
|
||||||
function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
|
function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
|
||||||
if (!is_array($array)) {
|
if (!is_array($array)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -824,6 +823,7 @@
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!function_exists('array_combine')) {
|
||||||
/**
|
/**
|
||||||
* Combines given identical arrays by using the first array's values as keys,
|
* Combines given identical arrays by using the first array's values as keys,
|
||||||
* and the second one's values as values. (Implemented for back-compatibility with PHP4)
|
* and the second one's values as values. (Implemented for back-compatibility with PHP4)
|
||||||
|
@ -832,7 +832,6 @@
|
||||||
* @param array $a2 Array to use for values
|
* @param array $a2 Array to use for values
|
||||||
* @return mixed Outputs either combined array or false.
|
* @return mixed Outputs either combined array or false.
|
||||||
*/
|
*/
|
||||||
if (!function_exists('array_combine')) {
|
|
||||||
function array_combine($a1, $a2) {
|
function array_combine($a1, $a2) {
|
||||||
$a1 = array_values($a1);
|
$a1 = array_values($a1);
|
||||||
$a2 = array_values($a2);
|
$a2 = array_values($a2);
|
||||||
|
@ -1025,7 +1024,6 @@
|
||||||
* @return string Environment variable setting.
|
* @return string Environment variable setting.
|
||||||
*/
|
*/
|
||||||
function env($key) {
|
function env($key) {
|
||||||
|
|
||||||
if ($key == 'HTTPS') {
|
if ($key == 'HTTPS') {
|
||||||
if (isset($_SERVER) && !empty($_SERVER)) {
|
if (isset($_SERVER) && !empty($_SERVER)) {
|
||||||
return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
|
return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
|
||||||
|
@ -1085,6 +1083,7 @@
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!function_exists('file_put_contents')) {
|
||||||
/**
|
/**
|
||||||
* Writes data into file.
|
* Writes data into file.
|
||||||
*
|
*
|
||||||
|
@ -1094,7 +1093,6 @@
|
||||||
* @param mixed $data String or array.
|
* @param mixed $data String or array.
|
||||||
* @return bool Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
if (!function_exists('file_put_contents')) {
|
|
||||||
function file_put_contents($fileName, $data) {
|
function file_put_contents($fileName, $data) {
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
$data = join('', $data);
|
$data = join('', $data);
|
||||||
|
@ -1121,7 +1119,6 @@
|
||||||
* @return mixed The contents of the temporary file.
|
* @return mixed The contents of the temporary file.
|
||||||
*/
|
*/
|
||||||
function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
|
function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
|
||||||
|
|
||||||
if (Configure::read('Cache.disable')) {
|
if (Configure::read('Cache.disable')) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1131,7 +1128,7 @@
|
||||||
$expires = strtotime($expires, $now);
|
$expires = strtotime($expires, $now);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(strtolower($target)) {
|
switch(low($target)) {
|
||||||
case 'cache':
|
case 'cache':
|
||||||
$filename = CACHE . $path;
|
$filename = CACHE . $path;
|
||||||
break;
|
break;
|
||||||
|
@ -1251,7 +1248,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Returns a translated string if one is found, or the submitted message if not found.
|
* Returns a translated string if one is found, or the submitted message if not found.
|
||||||
*
|
*
|
||||||
* @param string $singular Text to translate
|
* @param string $singular Text to translate
|
||||||
|
@ -1272,7 +1268,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Returns correct plural form of message identified by $singular and $plural for count $count.
|
* 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.
|
* Some languages have more than one form for plural messages dependent on the count.
|
||||||
*
|
*
|
||||||
|
@ -1296,7 +1291,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Allows you to override the current domain for a single message lookup.
|
* Allows you to override the current domain for a single message lookup.
|
||||||
*
|
*
|
||||||
* @param string $domain Domain
|
* @param string $domain Domain
|
||||||
|
@ -1316,7 +1310,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Allows you to override the current domain for a single plural message lookup
|
* 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
|
* Returns correct plural form of message identified by $singular and $plural for count $count
|
||||||
* from domain $domain
|
* from domain $domain
|
||||||
|
@ -1340,7 +1333,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Allows you to override the current domain for a single message lookup.
|
* Allows you to override the current domain for a single message lookup.
|
||||||
* It also allows you to specify a category.
|
* It also allows you to specify a category.
|
||||||
*
|
*
|
||||||
|
@ -1374,7 +1366,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Allows you to override the current domain for a single plural message lookup.
|
* Allows you to override the current domain for a single plural message lookup.
|
||||||
* It also allows you to specify a category.
|
* It also allows you to specify a category.
|
||||||
* Returns correct plural form of message identified by $singular and $plural for count $count
|
* Returns correct plural form of message identified by $singular and $plural for count $count
|
||||||
|
@ -1412,7 +1403,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* The category argument allows a specific category of the locale settings to be used for fetching a message.
|
* 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.
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
||||||
*
|
*
|
||||||
|
|
|
@ -82,7 +82,6 @@ class Dispatcher extends Object {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $plugin = null;
|
var $plugin = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the params for this request
|
* the params for this request
|
||||||
*
|
*
|
||||||
|
@ -110,9 +109,8 @@ class Dispatcher extends Object {
|
||||||
* the form of Missing Controllers information. It does the same with Actions (methods of Controllers are called
|
* the form of Missing Controllers information. It does the same with Actions (methods of Controllers are called
|
||||||
* Actions).
|
* Actions).
|
||||||
*
|
*
|
||||||
* @param string $url URL information to work on.
|
* @param string $url URL information to work on
|
||||||
* @param array $additionalParams Settings array ("bare", "return"),
|
* @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params
|
||||||
* which is melded with the GET and POST params.
|
|
||||||
* @return bool Success
|
* @return bool Success
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
@ -468,7 +466,7 @@ class Dispatcher extends Object {
|
||||||
/**
|
/**
|
||||||
* Get controller to use, either plugin controller or application controller
|
* Get controller to use, either plugin controller or application controller
|
||||||
*
|
*
|
||||||
* @param array $params Array
|
* @param array $params Array of parameters
|
||||||
* @return mixed name of controller if not loaded, or object if loaded
|
* @return mixed name of controller if not loaded, or object if loaded
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
|
@ -502,10 +500,10 @@ class Dispatcher extends Object {
|
||||||
return $controller;
|
return $controller;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* load controller and return controller class
|
* Load controller and return controller class
|
||||||
*
|
*
|
||||||
* @param array $params Array
|
* @param array $params Array of parameters
|
||||||
* @return mixed name of controller class name
|
* @return string|bool Name of controller class name
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __loadController($params) {
|
function __loadController($params) {
|
||||||
|
@ -536,6 +534,7 @@ class Dispatcher extends Object {
|
||||||
* constructs a new one, using the PHP_SELF constant and other variables.
|
* constructs a new one, using the PHP_SELF constant and other variables.
|
||||||
*
|
*
|
||||||
* @return string URI
|
* @return string URI
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function uri() {
|
function uri() {
|
||||||
if ($uri = env('HTTP_X_REWRITE_URL')) {
|
if ($uri = env('HTTP_X_REWRITE_URL')) {
|
||||||
|
@ -566,9 +565,10 @@ class Dispatcher extends Object {
|
||||||
/**
|
/**
|
||||||
* Returns and sets the $_GET[url] derived from the REQUEST_URI
|
* Returns and sets the $_GET[url] derived from the REQUEST_URI
|
||||||
*
|
*
|
||||||
* @param string $uri
|
* @param string $uri Request URI
|
||||||
* @param string $script
|
* @param string $base Base path
|
||||||
* @return string URL
|
* @return string URL
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
function getUrl($uri = null, $base = null) {
|
function getUrl($uri = null, $base = null) {
|
||||||
if (empty($_GET['url'])) {
|
if (empty($_GET['url'])) {
|
||||||
|
@ -610,11 +610,10 @@ class Dispatcher extends Object {
|
||||||
/**
|
/**
|
||||||
* Outputs cached dispatch for js, css, view cache
|
* Outputs cached dispatch for js, css, view cache
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @param string $url Requested URL
|
||||||
* @return string URL
|
* @access public
|
||||||
*/
|
*/
|
||||||
function cached($url) {
|
function cached($url) {
|
||||||
|
|
||||||
if (strpos($url, 'ccss/') === 0) {
|
if (strpos($url, 'ccss/') === 0) {
|
||||||
include WWW_ROOT . DS . 'css.php';
|
include WWW_ROOT . DS . 'css.php';
|
||||||
exit();
|
exit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue