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:
mariano.iglesias 2007-10-22 06:17:16 +00:00
parent 897825d596
commit 2e896e5220
2 changed files with 44 additions and 55 deletions

View file

@ -244,7 +244,6 @@
}
return true;
}
/**
* Get CakePHP basic paths as an indexed array.
* Resulting array will contain array of paths
@ -706,21 +705,21 @@
return true;
}
/**
* Loads component/components from LIBS.
* Loads component/components from LIBS. Takes optional number of parameters.
*
* Example:
* <code>
* uses('flay', 'time');
* </code>
*
* @uses LIBS
* @param string $name Filename without the .php part
*/
function uses() {
$args = func_get_args();
$c = func_num_args();
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";
}
}
if (!function_exists('getMicrotime')) {
/**
* Returns microtime for execution time checking
*
* @return float Microtime
*/
if (!function_exists('getMicrotime')) {
function getMicrotime() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
}
if (!function_exists('sortByKey')) {
/**
* Sorts given $array by key $sortby.
*
@ -802,7 +802,6 @@
* @param int $type Type of sorting to perform
* @return mixed Sorted array
*/
if (!function_exists('sortByKey')) {
function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) {
if (!is_array($array)) {
return null;
@ -824,6 +823,7 @@
return $out;
}
}
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 back-compatibility with PHP4)
@ -832,7 +832,6 @@
* @param array $a2 Array to use for values
* @return mixed Outputs either combined array or false.
*/
if (!function_exists('array_combine')) {
function array_combine($a1, $a2) {
$a1 = array_values($a1);
$a2 = array_values($a2);
@ -1025,7 +1024,6 @@
* @return string Environment variable setting.
*/
function env($key) {
if ($key == 'HTTPS') {
if (isset($_SERVER) && !empty($_SERVER)) {
return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
@ -1085,6 +1083,7 @@
}
return null;
}
if (!function_exists('file_put_contents')) {
/**
* Writes data into file.
*
@ -1094,7 +1093,6 @@
* @param mixed $data String or array.
* @return bool Success
*/
if (!function_exists('file_put_contents')) {
function file_put_contents($fileName, $data) {
if (is_array($data)) {
$data = join('', $data);
@ -1121,7 +1119,6 @@
* @return mixed The contents of the temporary file.
*/
function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
if (Configure::read('Cache.disable')) {
return null;
}
@ -1131,7 +1128,7 @@
$expires = strtotime($expires, $now);
}
switch(strtolower($target)) {
switch(low($target)) {
case 'cache':
$filename = CACHE . $path;
break;
@ -1251,7 +1248,6 @@
}
}
/**
*
* Returns a translated string if one is found, or the submitted message if not found.
*
* @param string $singular Text to translate
@ -1272,7 +1268,6 @@
}
}
/**
*
* 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.
*
@ -1296,7 +1291,6 @@
}
}
/**
*
* Allows you to override the current domain for a single message lookup.
*
* @param string $domain Domain
@ -1316,7 +1310,6 @@
}
}
/**
*
* 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
@ -1340,7 +1333,6 @@
}
}
/**
*
* Allows you to override the current domain for a single message lookup.
* 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.
* It also allows you to specify a category.
* 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.
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
*

View file

@ -82,7 +82,6 @@ class Dispatcher extends Object {
* @access public
*/
var $plugin = null;
/**
* 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
* Actions).
*
* @param string $url URL information to work on.
* @param array $additionalParams Settings array ("bare", "return"),
* which is melded with the GET and POST params.
* @param string $url URL information to work on
* @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params
* @return bool Success
* @access public
*/
@ -259,7 +257,7 @@ class Dispatcher extends Object {
* @return string Output as sent by controller
* @access protected
*/
function _invoke (&$controller, $params, $missingAction = false) {
function _invoke(&$controller, $params, $missingAction = false) {
$classVars = get_object_vars($controller);
if ($missingAction && in_array('scaffold', array_keys($classVars))) {
uses('controller'. DS . 'scaffold');
@ -468,7 +466,7 @@ class Dispatcher extends Object {
/**
* 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
* @access private
*/
@ -502,10 +500,10 @@ class Dispatcher extends Object {
return $controller;
}
/**
* load controller and return controller class
* Load controller and return controller class
*
* @param array $params Array
* @return mixed name of controller class name
* @param array $params Array of parameters
* @return string|bool Name of controller class name
* @access private
*/
function __loadController($params) {
@ -536,6 +534,7 @@ class Dispatcher extends Object {
* constructs a new one, using the PHP_SELF constant and other variables.
*
* @return string URI
* @access public
*/
function uri() {
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
*
* @param string $uri
* @param string $script
* @param string $uri Request URI
* @param string $base Base path
* @return string URL
* @access public
*/
function getUrl($uri = null, $base = null) {
if (empty($_GET['url'])) {
@ -610,11 +610,10 @@ class Dispatcher extends Object {
/**
* Outputs cached dispatch for js, css, view cache
*
* @param string $url
* @return string URL
* @param string $url Requested URL
* @access public
*/
function cached($url) {
if (strpos($url, 'ccss/') === 0) {
include WWW_ROOT . DS . 'css.php';
exit();