Skip to content
Browse files

Merge branch '3.2/develop' into 3.2/release/3.2.1

  • Loading branch information...
2 parents 44fcb1b + 713bfd5 commit ca8c0acd1d265511b0b7f8aaa468a6fb3b077277 @zombor zombor committed Aug 23, 2012
Showing with 1,696 additions and 1,002 deletions.
  1. +56 −39 classes/kohana/arr.php
  2. +3 −4 classes/kohana/cli.php
  3. +10 −10 classes/kohana/config.php
  4. +1 −1 classes/kohana/config/file.php
  5. +3 −3 classes/kohana/config/file/reader.php
  6. +5 −5 classes/kohana/config/group.php
  7. +1 −1 classes/kohana/config/reader.php
  8. +1 −1 classes/kohana/config/source.php
  9. +1 −1 classes/kohana/config/writer.php
  10. +1 −1 classes/kohana/controller.php
  11. +1 −1 classes/kohana/controller/template.php
  12. +9 −9 classes/kohana/cookie.php
  13. +37 −29 classes/kohana/core.php
  14. +42 −37 classes/kohana/date.php
  15. +14 −15 classes/kohana/debug.php
  16. +7 −7 classes/kohana/encrypt.php
  17. +7 −7 classes/kohana/feed.php
  18. +8 −10 classes/kohana/file.php
  19. +43 −43 classes/kohana/form.php
  20. +8 −8 classes/kohana/fragment.php
  21. +35 −35 classes/kohana/html.php
  22. +1 −1 classes/kohana/http.php
  23. +16 −16 classes/kohana/http/cache.php
  24. +3 −3 classes/kohana/http/exception.php
  25. +83 −64 classes/kohana/http/header.php
  26. +1 −1 classes/kohana/http/message.php
  27. +1 −1 classes/kohana/http/request.php
  28. +1 −1 classes/kohana/http/response.php
  29. +8 −8 classes/kohana/i18n.php
  30. +11 −11 classes/kohana/inflector.php
  31. +9 −8 classes/kohana/kohana/exception.php
  32. +8 −8 classes/kohana/log.php
  33. +3 −3 classes/kohana/log/file.php
  34. +2 −2 classes/kohana/log/stderr.php
  35. +2 −2 classes/kohana/log/stdout.php
  36. +9 −15 classes/kohana/log/syslog.php
  37. +2 −2 classes/kohana/log/writer.php
  38. +2 −2 classes/kohana/model.php
  39. +6 −6 classes/kohana/num.php
  40. +10 −10 classes/kohana/profiler.php
  41. +29 −13 classes/kohana/request.php
  42. +5 −5 classes/kohana/request/client.php
  43. +28 −3 classes/kohana/request/client/curl.php
  44. +6 −6 classes/kohana/request/client/external.php
  45. +3 −3 classes/kohana/request/client/http.php
  46. +1 −3 classes/kohana/request/client/internal.php
  47. +2 −2 classes/kohana/request/client/stream.php
  48. +1 −1 classes/kohana/request/exception.php
  49. +12 −12 classes/kohana/response.php
  50. +31 −21 classes/kohana/route.php
  51. +5 −5 classes/kohana/security.php
  52. +16 −17 classes/kohana/session.php
  53. +1 −1 classes/kohana/session/cookie.php
  54. +1 −1 classes/kohana/session/exception.php
  55. +1 −1 classes/kohana/session/native.php
  56. +31 −31 classes/kohana/text.php
  57. +17 −17 classes/kohana/upload.php
  58. +12 −5 classes/kohana/url.php
  59. +94 −94 classes/kohana/utf8.php
  60. +1 −1 classes/kohana/utf8/exception.php
  61. +42 −41 classes/kohana/valid.php
  62. +51 −32 classes/kohana/validation.php
  63. +5 −5 classes/kohana/validation/exception.php
  64. +26 −26 classes/kohana/view.php
  65. +1 −1 classes/kohana/view/exception.php
  66. +1 −1 classes/request/exception.php
  67. +1 −1 classes/session/exception.php
  68. +1 −1 classes/utf8/exception.php
  69. +1 −1 classes/view/exception.php
  70. +39 −13 config/inflector.php
  71. +2 −1 config/mimes.php
  72. +9 −8 config/user_agents.php
  73. +1 −1 config/userguide.php
  74. +2 −2 guide/kohana/autoloading.md
  75. +3 −3 guide/kohana/errors.md
  76. +1 −1 guide/kohana/extension.md
  77. +6 −2 guide/kohana/index.md
  78. +2 −2 guide/kohana/install.md
  79. +2 −1 guide/kohana/menu.md
  80. +2 −2 guide/kohana/mvc/controllers.md
  81. +0 −30 guide/kohana/security/deploying.md
  82. +107 −1 guide/kohana/security/encryption.md
  83. +17 −15 guide/kohana/security/validation.md
  84. +14 −1 guide/kohana/tutorials/clean-urls.md
  85. +9 −9 guide/kohana/tutorials/error-pages.md
  86. +7 −7 guide/kohana/tutorials/git.md
  87. +219 −0 guide/kohana/tutorials/library-kohana.md
  88. +7 −0 messages/tests/validation/error_type_check.php
  89. +3 −2 tests/kohana/ArrTest.php
  90. +3 −2 tests/kohana/CLITest.php
  91. +1 −1 tests/kohana/Config/File/ReaderTest.php
  92. +1 −1 tests/kohana/Config/GroupTest.php
  93. +3 −2 tests/kohana/ConfigTest.php
  94. +3 −2 tests/kohana/CookieTest.php
  95. +2 −1 tests/kohana/CoreTest.php
  96. +11 −5 tests/kohana/DateTest.php
  97. +3 −2 tests/kohana/DebugTest.php
  98. +3 −2 tests/kohana/ExceptionTest.php
  99. +4 −6 tests/kohana/FeedTest.php
  100. +6 −2 tests/kohana/FileTest.php
  101. +3 −2 tests/kohana/FormTest.php
  102. +35 −3 tests/kohana/HTMLTest.php
  103. +23 −3 tests/kohana/Http/HeaderTest.php
  104. +20 −12 tests/kohana/I18nTest.php
  105. +3 −2 tests/kohana/InflectorTest.php
  106. +3 −2 tests/kohana/LogTest.php
  107. +3 −2 tests/kohana/ModelTest.php
  108. +5 −4 tests/kohana/NumTest.php
  109. +16 −5 tests/kohana/RequestTest.php
  110. +3 −2 tests/kohana/ResponseTest.php
  111. +3 −2 tests/kohana/RouteTest.php
  112. +16 −2 tests/kohana/SecurityTest.php
  113. +3 −2 tests/kohana/SessionTest.php
  114. +36 −1 tests/kohana/TextTest.php
  115. +7 −2 tests/kohana/URLTest.php
  116. +3 −2 tests/kohana/UTF8Test.php
  117. +3 −2 tests/kohana/UploadTest.php
  118. +4 −3 tests/kohana/ValidTest.php
  119. +64 −2 tests/kohana/ValidationTest.php
  120. +4 −3 tests/kohana/ViewTest.php
  121. +17 −3 tests/kohana/request/client/CacheTest.php
  122. +1 −1 tests/kohana/request/client/ExternalTest.php
  123. +5 −4 tests/kohana/request/client/InternalTest.php
  124. +1 −1 tests/test_data/callback_routes.php
  125. +1 −1 utf8/from_unicode.php
  126. +1 −1 utf8/ltrim.php
  127. +1 −1 utf8/ord.php
  128. +1 −1 utf8/rtrim.php
  129. +1 −1 utf8/str_ireplace.php
  130. +1 −1 utf8/str_pad.php
  131. +1 −1 utf8/str_split.php
  132. +1 −1 utf8/strcasecmp.php
  133. +1 −1 utf8/strcspn.php
  134. +1 −1 utf8/stristr.php
  135. +1 −1 utf8/strlen.php
  136. +1 −1 utf8/strpos.php
  137. +1 −1 utf8/strrev.php
  138. +1 −1 utf8/strrpos.php
  139. +1 −1 utf8/strspn.php
  140. +1 −1 utf8/strtolower.php
  141. +1 −1 utf8/strtoupper.php
  142. +1 −1 utf8/substr.php
  143. +1 −1 utf8/substr_replace.php
  144. +1 −1 utf8/to_unicode.php
  145. +1 −1 utf8/transliterate_to_ascii.php
  146. +1 −1 utf8/trim.php
  147. +1 −1 utf8/ucfirst.php
  148. +1 −1 utf8/ucwords.php
  149. +1 −1 views/kohana/generate_logo.php
  150. +1 −1 views/kohana/logo.php
View
95 classes/kohana/arr.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Arr {
@@ -24,7 +24,7 @@ class Kohana_Arr {
* // Returns FALSE
* Arr::is_assoc('foo', 'bar');
*
- * @param array array to check
+ * @param array $array array to check
* @return boolean
*/
public static function is_assoc(array $array)
@@ -49,7 +49,7 @@ public static function is_assoc(array $array)
* Arr::is_array('not an array!');
* Arr::is_array(Database::instance());
*
- * @param mixed value to check
+ * @param mixed $value value to check
* @return boolean
*/
public static function is_array($value)
@@ -80,10 +80,10 @@ public static function is_array($value)
* // Using an array of keys
* $colors = Arr::path($array, array('theme', '*', 'color'));
*
- * @param array array to search
- * @param mixed key path string (delimiter separated) or array of keys
- * @param mixed default value if the path is not set
- * @param string key path delimiter
+ * @param array $array array to search
+ * @param mixed $path key path string (delimiter separated) or array of keys
+ * @param mixed $default default value if the path is not set
+ * @param string $delimiter key path delimiter
* @return mixed
*/
public static function path($array, $path, $default = NULL, $delimiter = NULL)
@@ -239,8 +239,8 @@ public static function set_path( & $array, $path, $value, $delimiter = NULL)
* // Fill an array with values 5, 10, 15, 20
* $values = Arr::range(5, 20);
*
- * @param integer stepping
- * @param integer ending number
+ * @param integer $step stepping
+ * @param integer $max ending number
* @return array
*/
public static function range($step = 10, $max = 100)
@@ -267,9 +267,9 @@ public static function range($step = 10, $max = 100)
* // Get the value "sorting" from $_GET, if it exists
* $sorting = Arr::get($_GET, 'sorting');
*
- * @param array array to extract from
- * @param string key name
- * @param mixed default value
+ * @param array $array array to extract from
+ * @param string $key key name
+ * @param mixed $default default value
* @return mixed
*/
public static function get($array, $key, $default = NULL)
@@ -284,9 +284,9 @@ public static function get($array, $key, $default = NULL)
* // Get the values "username", "password" from $_POST
* $auth = Arr::extract($_POST, array('username', 'password'));
*
- * @param array array to extract keys from
- * @param array list of key names
- * @param mixed default value
+ * @param array $array array to extract keys from
+ * @param array $keys list of key names
+ * @param mixed $default default value
* @return array
*/
public static function extract($array, array $keys, $default = NULL)
@@ -308,8 +308,8 @@ public static function extract($array, array $keys, $default = NULL)
*
* [!!] A list of arrays is an array that contains arrays, eg: array(array $a, array $b, array $c, ...)
*
- * @param array list of arrays to check
- * @param string key to pluck
+ * @param array $array list of arrays to check
+ * @param string $key key to pluck
* @return array
*/
public static function pluck($array, $key)
@@ -334,9 +334,9 @@ public static function pluck($array, $key)
* // Add an empty value to the start of a select list
* Arr::unshift($array, 'none', 'Select a value');
*
- * @param array array to modify
- * @param string array key name
- * @param mixed array value
+ * @param array $array array to modify
+ * @param string $key array key name
+ * @param mixed $val array value
* @return array
*/
public static function unshift( array & $array, $key, $val)
@@ -349,40 +349,49 @@ public static function unshift( array & $array, $key, $val)
}
/**
- * Recursive version of [array_map](http://php.net/array_map), applies the
- * same callback to all elements in an array, including sub-arrays.
+ * Recursive version of [array_map](http://php.net/array_map), applies one or more
+ * callbacks to all elements in an array, including sub-arrays.
*
* // Apply "strip_tags" to every element in the array
* $array = Arr::map('strip_tags', $array);
*
+ * // Apply $this->filter to every element in the array
+ * $array = Arr::map(array(array($this,'filter')), $array);
+ *
+ * // Apply strip_tags and $this->filter to every element
+ * $array = Arr::map(array('strip_tags',array($this,'filter')), $array);
+ *
+ * [!!] Because you can pass an array of callbacks, if you wish to use an array-form callback
+ * you must nest it in an additional array as above. Calling Arr::map(array($this,'filter'), $array)
+ * will cause an error.
* [!!] Unlike `array_map`, this method requires a callback and will only map
* a single array.
*
- * @param mixed callback applied to every element in the array
- * @param array array to map
- * @param array array of keys to apply to
+ * @param mixed $callbacks array of callbacks to apply to every element in the array
+ * @param array $array array to map
+ * @param array $keys array of keys to apply to
* @return array
*/
- public static function map($callback, $array, $keys = NULL)
+ public static function map($callbacks, $array, $keys = NULL)
{
foreach ($array as $key => $val)
{
if (is_array($val))
{
- $array[$key] = Arr::map($callback, $array[$key]);
+ $array[$key] = Arr::map($callbacks, $array[$key]);
}
elseif ( ! is_array($keys) or in_array($key, $keys))
{
- if (is_array($callback))
+ if (is_array($callbacks))
{
- foreach ($callback as $cb)
+ foreach ($callbacks as $cb)
{
$array[$key] = call_user_func($cb, $array[$key]);
}
}
else
{
- $array[$key] = call_user_func($callback, $array[$key]);
+ $array[$key] = call_user_func($callbacks, $array[$key]);
}
}
}
@@ -403,9 +412,8 @@ public static function map($callback, $array, $keys = NULL)
* // The output of $john will now be:
* array('name' => 'mary', 'children' => array('fred', 'paul', 'sally', 'jane'))
*
- * @param array initial array
- * @param array array to merge
- * @param array ...
+ * @param array $a1 initial array
+ * @param array $a2,... array to merge
* @return array
*/
public static function merge(array $a1, array $a2)
@@ -477,8 +485,8 @@ public static function merge(array $a1, array $a2)
* // The output of $array will now be:
* array('name' => 'jack', 'mood' => 'happy', 'food' => 'tacos')
*
- * @param array master array
- * @param array input arrays that will overwrite existing values
+ * @param array $array1 master array
+ * @param array $array2 input arrays that will overwrite existing values
* @return array
*/
public static function overwrite($array1, $array2)
@@ -512,7 +520,7 @@ public static function overwrite($array1, $array2)
* // Get the result of the callback
* $result = call_user_func_array($func, $params);
*
- * @param string callback string
+ * @param string $str callback string
* @return array function, params
*/
public static function callback($str)
@@ -561,22 +569,31 @@ public static function callback($str)
*
* [!!] The keys of array values will be discarded.
*
- * @param array array to flatten
+ * @param array $array array to flatten
* @return array
* @since 3.0.6
*/
public static function flatten($array)
{
+ $is_assoc = Arr::is_assoc($array);
+
$flat = array();
foreach ($array as $key => $value)
{
if (is_array($value))
{
- $flat += Arr::flatten($value);
+ $flat = array_merge($flat, Arr::flatten($value));
}
else
{
- $flat[$key] = $value;
+ if ($is_assoc)
+ {
+ $flat[$key] = $value;
+ }
+ else
+ {
+ $flat[] = $value;
+ }
}
}
return $flat;
View
7 classes/kohana/cli.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2009-2011 Kohana Team
+ * @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_CLI {
@@ -19,11 +19,10 @@ class Kohana_CLI {
* // Get the values of "username" and "password"
* $auth = CLI::options('username', 'password');
*
- * @param string option name
- * @param ...
+ * @param string $options,... option name
* @return array
*/
- public static function options($options)
+ public static function options()
{
// Get all of the requested options
$options = func_get_args();
View
20 classes/kohana/config.php
@@ -12,7 +12,7 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
- * @copyright (c) 2009-2011 Kohana Team
+ * @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Config {
@@ -28,8 +28,8 @@ class Kohana_Config {
* $config->attach($reader); // Try first
* $config->attach($reader, FALSE); // Try last
*
- * @param object Kohana_Config_Source instance
- * @param boolean add the reader as the first used object
+ * @param Kohana_Config_Source $source instance
+ * @param boolean $first add the reader as the first used object
* @return $this
*/
public function attach(Kohana_Config_Source $source, $first = TRUE)
@@ -53,7 +53,7 @@ public function attach(Kohana_Config_Source $source, $first = TRUE)
*
* $config->detach($reader);
*
- * @param object Kohana_Config_Source instance
+ * @param Kohana_Config_Source $source instance
* @return $this
*/
public function detach(Kohana_Config_Source $source)
@@ -76,8 +76,8 @@ public function detach(Kohana_Config_Source $source)
*
* See [Kohana_Config_Group] for more info
*
- * @param string configuration group name
- * @return object Kohana_Config_Group
+ * @param string $group configuration group name
+ * @return Kohana_Config_Group
* @throws Kohana_Exception
*/
public function load($group)
@@ -143,7 +143,7 @@ public function load($group)
*
* $config->copy($name);
*
- * @param string configuration group name
+ * @param string $group configuration group name
* @return $this
*/
public function copy($group)
@@ -162,9 +162,9 @@ public function copy($group)
/**
* Callback used by the config group to store changes made to configuration
*
- * @param string Group name
- * @param string Variable name
- * @param mixed The new value
+ * @param string $group Group name
+ * @param string $key Variable name
+ * @param mixed $value The new value
* @return Kohana_Config Chainable instance
*/
public function _write_config($group, $key, $value)
View
2 classes/kohana/config/file.php
@@ -6,7 +6,7 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
- * @copyright (c) 2009-2011 Kohana Team
+ * @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Config_File extends Kohana_Config_File_Reader
View
6 classes/kohana/config/file/reader.php
@@ -6,7 +6,7 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
- * @copyright (c) 2009-2010 Kohana Team
+ * @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Config_File_Reader implements Kohana_Config_Reader {
@@ -20,7 +20,7 @@ class Kohana_Config_File_Reader implements Kohana_Config_Reader {
/**
* Creates a new file reader using the given directory as a config source
*
- * @param string Configuration directory to search
+ * @param string $directory Configuration directory to search
*/
public function __construct($directory = 'config')
{
@@ -33,7 +33,7 @@ public function __construct($directory = 'config')
*
* $config->load($name);
*
- * @param string configuration group name
+ * @param string $group configuration group name
* @return $this current object
* @uses Kohana::load
*/
View
10 classes/kohana/config/group.php
@@ -11,7 +11,7 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
- * @copyright (c) 2010 Kohana Team
+ * @copyright (c) 2012 Kohana Team
* @license http://kohanaphp.com/license
*/
class Kohana_Config_Group extends ArrayObject {
@@ -83,8 +83,8 @@ public function group_name()
*
* $value = $config->get($key);
*
- * @param string array key
- * @param mixed default value
+ * @param string $key array key
+ * @param mixed $default default value
* @return mixed
*/
public function get($key, $default = NULL)
@@ -97,8 +97,8 @@ public function get($key, $default = NULL)
*
* $config->set($key, $new_value);
*
- * @param string array key
- * @param mixed array value
+ * @param string $key array key
+ * @param mixed $value array value
* @return $this
*/
public function set($key, $value)
View
2 classes/kohana/config/reader.php
@@ -6,7 +6,7 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
interface Kohana_Config_Reader extends Kohana_Config_Source
View
2 classes/kohana/config/source.php
@@ -7,7 +7,7 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
- * @copyright (c) 2010 Kohana Team
+ * @copyright (c) 2012 Kohana Team
* @license http://kohanaphp.com/license
*/
View
2 classes/kohana/config/writer.php
@@ -7,7 +7,7 @@
*
* @package Kohana
* @author Kohana Team
- * @copyright (c) 2008-2010 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaphp.com/license
*/
interface Kohana_Config_Writer extends Kohana_Config_Source
View
2 classes/kohana/controller.php
@@ -17,7 +17,7 @@
* @package Kohana
* @category Controller
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
abstract class Kohana_Controller {
View
2 classes/kohana/controller/template.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Controller
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
abstract class Kohana_Controller_Template extends Controller {
View
18 classes/kohana/cookie.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Cookie {
@@ -48,8 +48,8 @@ class Kohana_Cookie {
* // Get the "theme" cookie, or use "blue" if the cookie does not exist
* $theme = Cookie::get('theme', 'blue');
*
- * @param string cookie name
- * @param mixed default value to return
+ * @param string $key cookie name
+ * @param mixed $default default value to return
* @return string
*/
public static function get($key, $default = NULL)
@@ -91,9 +91,9 @@ public static function get($key, $default = NULL)
* // Set the "theme" cookie
* Cookie::set('theme', 'red');
*
- * @param string name of cookie
- * @param string value of cookie
- * @param integer lifetime in seconds
+ * @param string $name name of cookie
+ * @param string $value value of cookie
+ * @param integer $expiration lifetime in seconds
* @return boolean
* @uses Cookie::salt
*/
@@ -122,7 +122,7 @@ public static function set($name, $value, $expiration = NULL)
*
* Cookie::delete('theme');
*
- * @param string cookie name
+ * @param string $name cookie name
* @return boolean
* @uses Cookie::set
*/
@@ -140,8 +140,8 @@ public static function delete($name)
*
* $salt = Cookie::salt('theme', 'red');
*
- * @param string name of cookie
- * @param string value of cookie
+ * @param string $name name of cookie
+ * @param string $value value of cookie
* @return string
*/
public static function salt($name, $value)
View
66 classes/kohana/core.php
@@ -10,7 +10,7 @@
* @package Kohana
* @category Base
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Core {
@@ -26,7 +26,7 @@ class Kohana_Core {
const DEVELOPMENT = 40;
// Security check that is added to all generated PHP files
- const FILE_SECURITY = '<?php defined(\'SYSPATH\') or die(\'No direct script access.\');';
+ const FILE_SECURITY = '<?php defined(\'SYSPATH\') OR die(\'No direct script access.\');';
// Format of cache files: header, cache name, and data
const FILE_CACHE = ":header \n\n// :name\n\n:data\n";
@@ -180,10 +180,12 @@ class Kohana_Core {
* `string` | cache_dir | Kohana's cache directory. Used by [Kohana::cache] for simple internal caching, like [Fragments](kohana/fragments) and **\[caching database queries](this should link somewhere)**. This has nothing to do with the [Cache module](cache). | `APPPATH."cache"`
* `integer` | cache_life | Lifetime, in seconds, of items cached by [Kohana::cache] | `60`
* `boolean` | errors | Should Kohana catch PHP errors and uncaught Exceptions and show the `error_view`. See [Error Handling](kohana/errors) for more info. <br /> <br /> Recommended setting: `TRUE` while developing, `FALSE` on production servers. | `TRUE`
- * `boolean` | profile | Whether to enable the [Profiler](kohana/profiling). <br /> <br />Recommended setting: `TRUE` while developing, `FALSE` on production servers. | `TRUE` * `boolean` | caching | Cache file locations to speed up [Kohana::find_file]. This has nothing to do with [Kohana::cache], [Fragments](kohana/fragments) or the [Cache module](cache). <br /> <br /> Recommended setting: `FALSE` while developing, `TRUE` on production servers. | `FALSE`
+ * `boolean` | profile | Whether to enable the [Profiler](kohana/profiling). <br /> <br />Recommended setting: `TRUE` while developing, `FALSE` on production servers. | `TRUE`
+ * `boolean` | caching | Cache file locations to speed up [Kohana::find_file]. This has nothing to do with [Kohana::cache], [Fragments](kohana/fragments) or the [Cache module](cache). <br /> <br /> Recommended setting: `FALSE` while developing, `TRUE` on production servers. | `FALSE`
+ * `boolean` | expose | Set the X-Powered-By header
*
* @throws Kohana_Exception
- * @param array Array of settings. See above.
+ * @param array $settings Array of settings. See above.
* @return void
* @uses Kohana::globals
* @uses Kohana::sanitize
@@ -325,18 +327,24 @@ public static function init(array $settings = NULL)
}
// Determine if the extremely evil magic quotes are enabled
- Kohana::$magic_quotes = (bool) get_magic_quotes_gpc();
+ Kohana::$magic_quotes = version_compare(PHP_VERSION, '5.4') < 0 AND get_magic_quotes_gpc();
// Sanitize all request variables
$_GET = Kohana::sanitize($_GET);
$_POST = Kohana::sanitize($_POST);
$_COOKIE = Kohana::sanitize($_COOKIE);
- // Load the logger
- Kohana::$log = Log::instance();
+ // Load the logger if one doesn't already exist
+ if ( ! Kohana::$log instanceof Log)
+ {
+ Kohana::$log = Log::instance();
+ }
- // Load the config
- Kohana::$config = new Kohana_Config;
+ // Load the config if one doesn't already exist
+ if ( ! Kohana::$config instanceof Config)
+ {
+ Kohana::$config = new Config;
+ }
}
/**
@@ -431,8 +439,8 @@ public static function globals()
* - Strips slashes if magic quotes are enabled
* - Normalizes all newlines to LF
*
- * @param mixed any variable
- * @return mixed sanitized variable
+ * @param mixed $value any variable
+ * @return mixed sanitized variable
*/
public static function sanitize($value)
{
@@ -480,7 +488,7 @@ public static function sanitize($value)
*
* spl_autoload_register(array('Kohana', 'auto_load'));
*
- * @param string class name
+ * @param string $class class name
* @return boolean
*/
public static function auto_load($class)
@@ -515,8 +523,8 @@ public static function auto_load($class)
*
* Kohana::modules(array('modules/foo', MODPATH.'bar'));
*
- * @param array list of module paths
- * @return array enabled modules
+ * @param array $modules list of module paths
+ * @return array enabled modules
*/
public static function modules(array $modules = NULL)
{
@@ -602,12 +610,12 @@ public static function include_paths()
* // Returns an array of all the "mimes" configuration files
* Kohana::find_file('config', 'mimes');
*
- * @param string directory name (views, i18n, classes, extensions, etc.)
- * @param string filename with subdirectory
- * @param string extension to search for
- * @param boolean return an array of files?
- * @return array a list of files when $array is TRUE
- * @return string single file path
+ * @param string $dir directory name (views, i18n, classes, extensions, etc.)
+ * @param string $file filename with subdirectory
+ * @param string $ext extension to search for
+ * @param boolean $array return an array of files?
+ * @return array a list of files when $array is TRUE
+ * @return string single file path
*/
public static function find_file($dir, $file, $ext = NULL, $array = FALSE)
{
@@ -703,8 +711,8 @@ public static function find_file($dir, $file, $ext = NULL, $array = FALSE)
* // Find all view files.
* $views = Kohana::list_files('views');
*
- * @param string directory name
- * @param array list of paths to search
+ * @param string $directory directory name
+ * @param array $paths list of paths to search
* @return array
*/
public static function list_files($directory = NULL, array $paths = NULL)
@@ -784,7 +792,7 @@ public static function list_files($directory = NULL, array $paths = NULL)
*
* $foo = Kohana::load('foo.php');
*
- * @param string
+ * @param string $file
* @return mixed
*/
public static function load($file)
@@ -810,9 +818,9 @@ public static function load($file)
* [ref-var]: http://php.net/var_export
*
* @throws Kohana_Exception
- * @param string name of the cache
- * @param mixed data to cache
- * @param integer number of seconds the cache is valid for
+ * @param string $name name of the cache
+ * @param mixed $data data to cache
+ * @param integer $lifetime number of seconds the cache is valid for
* @return mixed for getting
* @return boolean for setting
*/
@@ -898,9 +906,9 @@ public static function cache($name, $data = NULL, $lifetime = NULL)
* // Get "username" from messages/text.php
* $username = Kohana::message('text', 'username');
*
- * @param string file name
- * @param string key path to get
- * @param mixed default value if the path does not exist
+ * @param string $file file name
+ * @param string $path key path to get
+ * @param mixed $default default value if the path does not exist
* @return string message string for the given path
* @return array complete message list, when no path is specified
* @uses Arr::merge
View
79 classes/kohana/date.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Date {
@@ -44,9 +44,9 @@ class Kohana_Date {
* [!!] A list of time zones that PHP supports can be found at
* <http://php.net/timezones>.
*
- * @param string timezone that to find the offset of
- * @param string timezone used as the baseline
- * @param mixed UNIX timestamp or date string
+ * @param string $remote timezone that to find the offset of
+ * @param string $local timezone used as the baseline
+ * @param mixed $now UNIX timestamp or date string
* @return integer
*/
public static function offset($remote, $local = NULL, $now = NULL)
@@ -83,10 +83,10 @@ public static function offset($remote, $local = NULL, $now = NULL)
*
* $seconds = Date::seconds(); // 01, 02, 03, ..., 58, 59, 60
*
- * @param integer amount to increment each step by, 1 to 30
- * @param integer start value
- * @param integer end value
- * @return array A mirrored (foo => foo) array from 1-60.
+ * @param integer $step amount to increment each step by, 1 to 30
+ * @param integer $start start value
+ * @param integer $end end value
+ * @return array A mirrored (foo => foo) array from 1-60.
*/
public static function seconds($step = 1, $start = 0, $end = 60)
{
@@ -110,8 +110,8 @@ public static function seconds($step = 1, $start = 0, $end = 60)
* $minutes = Date::minutes(); // 05, 10, 15, ..., 50, 55, 60
*
* @uses Date::seconds
- * @param integer amount to increment each step by, 1 to 30
- * @return array A mirrored (foo => foo) array from 1-60.
+ * @param integer $step amount to increment each step by, 1 to 30
+ * @return array A mirrored (foo => foo) array from 1-60.
*/
public static function minutes($step = 5)
{
@@ -128,10 +128,10 @@ public static function minutes($step = 5)
*
* $hours = Date::hours(); // 01, 02, 03, ..., 10, 11, 12
*
- * @param integer amount to increment each step by
- * @param boolean use 24-hour time
- * @param integer the hour to start at
- * @return array A mirrored (foo => foo) array from start-12 or start-23.
+ * @param integer $step amount to increment each step by
+ * @param boolean $long use 24-hour time
+ * @param integer $start the hour to start at
+ * @return array A mirrored (foo => foo) array from start-12 or start-23.
*/
public static function hours($step = 1, $long = FALSE, $start = NULL)
{
@@ -165,7 +165,7 @@ public static function hours($step = 1, $long = FALSE, $start = NULL)
* $type = Date::ampm(12); // PM
* $type = Date::ampm(1); // AM
*
- * @param integer number of the hour
+ * @param integer $hour number of the hour
* @return string
*/
public static function ampm($hour)
@@ -181,8 +181,8 @@ public static function ampm($hour)
*
* $hour = Date::adjust(3, 'pm'); // 15
*
- * @param integer hour to adjust
- * @param string AM or PM
+ * @param integer $hour hour to adjust
+ * @param string $ampm AM or PM
* @return string
*/
public static function adjust($hour, $ampm)
@@ -215,9 +215,9 @@ public static function adjust($hour, $ampm)
*
* Date::days(4, 2010); // 1, 2, 3, ..., 28, 29, 30
*
- * @param integer number of month
- * @param integer number of year to check month, defaults to the current year
- * @return array A mirrored (foo => foo) array of the days.
+ * @param integer $month number of month
+ * @param integer $year number of year to check month, defaults to the current year
+ * @return array A mirrored (foo => foo) array of the days.
*/
public static function days($month, $year = FALSE)
{
@@ -270,8 +270,8 @@ public static function days($month, $year = FALSE)
* // array(1 => 'Jan', 2 => 'Feb', ..., 12 => 'Dec')
*
* @uses Date::hours
- * @param string The format to use for months
- * @return array An array of months based on the specified format
+ * @param string $format The format to use for months
+ * @return array An array of months based on the specified format
*/
public static function months($format = NULL)
{
@@ -299,8 +299,8 @@ public static function months($format = NULL)
*
* $years = Date::years(2000, 2010); // 2000, 2001, ..., 2009, 2010
*
- * @param integer starting year (default is current year - 5)
- * @param integer ending year (default is current year + 5)
+ * @param integer $start starting year (default is current year - 5)
+ * @param integer $end ending year (default is current year + 5)
* @return array
*/
public static function years($start = FALSE, $end = FALSE)
@@ -327,9 +327,9 @@ public static function years($start = FALSE, $end = FALSE)
* $span = Date::span(60, 182, 'minutes,seconds'); // array('minutes' => 2, 'seconds' => 2)
* $span = Date::span(60, 182, 'minutes'); // 2
*
- * @param integer timestamp to find the span of
- * @param integer timestamp to use as the baseline
- * @param string formatting string
+ * @param integer $remote timestamp to find the span of
+ * @param integer $local timestamp to use as the baseline
+ * @param string $output formatting string
* @return string when only a single output is requested
* @return array associative list of all outputs requested
*/
@@ -419,8 +419,8 @@ public static function span($remote, $local = NULL, $output = 'years,months,week
* however this parameter shouldn't be needed in normal usage and is only
* included for unit tests
*
- * @param integer "remote" timestamp
- * @param integer "local" timestamp, defaults to time()
+ * @param integer $timestamp "remote" timestamp
+ * @param integer $local_timestamp "local" timestamp, defaults to time()
* @return string
*/
public static function fuzzy_span($timestamp, $local_timestamp = NULL)
@@ -530,7 +530,7 @@ public static function fuzzy_span($timestamp, $local_timestamp = NULL)
*
* $dos = Date::unix2dos($unix);
*
- * @param integer UNIX timestamp
+ * @param integer $timestamp UNIX timestamp
* @return integer
*/
public static function unix2dos($timestamp = FALSE)
@@ -558,7 +558,7 @@ public static function unix2dos($timestamp = FALSE)
*
* $unix = Date::dos2unix($dos);
*
- * @param integer DOS timestamp
+ * @param integer $timestamp DOS timestamp
* @return integer
*/
public static function dos2unix($timestamp = FALSE)
@@ -578,19 +578,24 @@ public static function dos2unix($timestamp = FALSE)
*
* $time = Date::formatted_time('5 minutes ago');
*
- * @see http://php.net/manual/en/datetime.construct.php
- * @param string datetime_str datetime string
- * @param string timestamp_format timestamp format
+ * @link http://www.php.net/manual/datetime.construct
+ * @param string $datetime_str datetime string
+ * @param string $timestamp_format timestamp format
+ * @param string $timezone timezone identifier
* @return string
*/
public static function formatted_time($datetime_str = 'now', $timestamp_format = NULL, $timezone = NULL)
{
$timestamp_format = ($timestamp_format == NULL) ? Date::$timestamp_format : $timestamp_format;
$timezone = ($timezone === NULL) ? Date::$timezone : $timezone;
- $time = new DateTime($datetime_str, new DateTimeZone(
- $timezone ? $timezone : date_default_timezone_get()
- ));
+ $tz = new DateTimeZone($timezone ? $timezone : date_default_timezone_get());
+ $time = new DateTime($datetime_str, $tz);
+
+ if ($time->getTimeZone()->getName() !== $tz->getName())
+ {
+ $time->setTimeZone($tz);
+ }
return $time->format($timestamp_format);
}
View
29 classes/kohana/debug.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Base
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaphp.com/license
*/
class Kohana_Debug {
@@ -17,8 +17,7 @@ class Kohana_Debug {
* // Displays the type and value of each variable
* echo Debug::vars($foo, $bar, $baz);
*
- * @param mixed variable to debug
- * @param ...
+ * @param mixed $var,... variable to debug
* @return string
*/
public static function vars()
@@ -43,9 +42,9 @@ public static function vars()
*
* Borrows heavily on concepts from the Debug class of [Nette](http://nettephp.com/).
*
- * @param mixed variable to dump
- * @param integer maximum length of strings
- * @param integer recursion limit
+ * @param mixed $value variable to dump
+ * @param integer $length maximum length of strings
+ * @param integer $level_recursion recursion limit
* @return string
*/
public static function dump($value, $length = 128, $level_recursion = 10)
@@ -56,10 +55,10 @@ public static function dump($value, $length = 128, $level_recursion = 10)
/**
* Helper for Debug::dump(), handles recursion in arrays and objects.
*
- * @param mixed variable to dump
- * @param integer maximum length of strings
- * @param integer recursion limit
- * @param integer current recursion level (internal usage only!)
+ * @param mixed $var variable to dump
+ * @param integer $length maximum length of strings
+ * @param integer $limit recursion limit
+ * @param integer $level current recursion level (internal usage only!)
* @return string
*/
protected static function _dump( & $var, $length = 128, $limit = 10, $level = 0)
@@ -244,7 +243,7 @@ protected static function _dump( & $var, $length = 128, $limit = 10, $level = 0)
* // Displays SYSPATH/classes/kohana.php
* echo Debug::path(Kohana::find_file('classes', 'kohana'));
*
- * @param string path to debug
+ * @param string $file path to debug
* @return string
*/
public static function path($file)
@@ -276,9 +275,9 @@ public static function path($file)
* // Highlights the current line of the current file
* echo Debug::source(__FILE__, __LINE__);
*
- * @param string file to open
- * @param integer line number to highlight
- * @param integer number of padding lines
+ * @param string $file file to open
+ * @param integer $line_number line number to highlight
+ * @param integer $padding number of padding lines
* @return string source of file
* @return FALSE file is unreadable
*/
@@ -342,7 +341,7 @@ public static function source($file, $line_number, $padding = 5)
* // Displays the entire current backtrace
* echo implode('<br/>', Debug::trace());
*
- * @param string path to debug
+ * @param array $trace
* @return string
*/
public static function trace(array $trace = NULL)
View
14 classes/kohana/encrypt.php
@@ -20,7 +20,7 @@
* @package Kohana
* @category Security
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Encrypt {
@@ -46,7 +46,7 @@ class Kohana_Encrypt {
*
* $encrypt = Encrypt::instance();
*
- * @param string configuration group name
+ * @param string $name configuration group name
* @return Encrypt
*/
public static function instance($name = NULL)
@@ -91,9 +91,9 @@ public static function instance($name = NULL)
/**
* Creates a new mcrypt wrapper.
*
- * @param string encryption key
- * @param string mcrypt mode
- * @param string mcrypt cipher
+ * @param string $key encryption key
+ * @param string $mode mcrypt mode
+ * @param string $cipher mcrypt cipher
*/
public function __construct($key, $mode, $cipher)
{
@@ -124,7 +124,7 @@ public function __construct($key, $mode, $cipher)
* to convert it to a string. This string can be stored in a database,
* displayed, and passed using most other means without corruption.
*
- * @param string data to be encrypted
+ * @param string $data data to be encrypted
* @return string
*/
public function encode($data)
@@ -179,7 +179,7 @@ public function encode($data)
*
* $data = $encrypt->decode($data);
*
- * @param string encoded string to be decrypted
+ * @param string $data encoded string to be decrypted
* @return FALSE if decryption fails
* @return string
*/
View
14 classes/kohana/feed.php
@@ -5,16 +5,16 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Feed {
/**
* Parses a remote feed into an array.
*
- * @param string remote feed URL
- * @param integer item limit to fetch
+ * @param string $feed remote feed URL
+ * @param integer $limit item limit to fetch
* @return array
*/
public static function parse($feed, $limit = 0)
@@ -70,10 +70,10 @@ public static function parse($feed, $limit = 0)
/**
* Creates a feed from the given parameters.
*
- * @param array feed information
- * @param array items to add to the feed
- * @param string define which format to use (only rss2 is supported)
- * @param string define which encoding to use
+ * @param array $info feed information
+ * @param array $items items to add to the feed
+ * @param string $format define which format to use (only rss2 is supported)
+ * @param string $encoding define which encoding to use
* @return string
*/
public static function create($info, $items, $format = 'rss2', $encoding = 'UTF-8')
View
18 classes/kohana/file.php
@@ -5,7 +5,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_File {
@@ -17,7 +17,7 @@ class Kohana_File {
*
* $mime = File::mime($file);
*
- * @param string file name or path
+ * @param string $filename file name or path
* @return string mime type on success
* @return FALSE on failure
*/
@@ -66,7 +66,7 @@ public static function mime($filename)
*
* $mime = File::mime_by_ext('png'); // "image/png"
*
- * @param string extension: php, pdf, txt, etc
+ * @param string $extension php, pdf, txt, etc
* @return string mime type on success
* @return FALSE on failure
*/
@@ -148,10 +148,9 @@ public static function ext_by_mime($type)
*
* $count = File::split($file);
*
- * @param string file to be split
- * @param string directory to output to, defaults to the same directory as the file
- * @param integer size, in MB, for each piece to be
- * @return integer The number of pieces that were created
+ * @param string $filename file to be split
+ * @param integer $piece_size size, in MB, for each piece to be
+ * @return integer The number of pieces that were created
*/
public static function split($filename, $piece_size = 10)
{
@@ -204,9 +203,8 @@ public static function split($filename, $piece_size = 10)
*
* $count = File::join($file);
*
- * @param string split filename, without .000 extension
- * @param string output filename, if different then an the filename
- * @return integer The number of pieces that were joined.
+ * @param string $filename split filename, without .000 extension
+ * @return integer The number of pieces that were joined.
*/
public static function join($filename)
{
View
86 classes/kohana/form.php
@@ -8,7 +8,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Form {
@@ -25,8 +25,8 @@ class Kohana_Form {
* // When "file" inputs are present, you must include the "enctype"
* echo Form::open(NULL, array('enctype' => 'multipart/form-data'));
*
- * @param mixed form action, defaults to the current request URI, or [Request] class to use
- * @param array html attributes
+ * @param mixed $action form action, defaults to the current request URI, or [Request] class to use
+ * @param array $attributes html attributes
* @return string
* @uses Request::instance
* @uses URL::site
@@ -84,9 +84,9 @@ public static function close()
*
* echo Form::input('username', $username);
*
- * @param string input name
- * @param string input value
- * @param array html attributes
+ * @param string $name input name
+ * @param string $value input value
+ * @param array $attributes html attributes
* @return string
* @uses HTML::attributes
*/
@@ -112,9 +112,9 @@ public static function input($name, $value = NULL, array $attributes = NULL)
*
* echo Form::hidden('csrf', $token);
*
- * @param string input name
- * @param string input value
- * @param array html attributes
+ * @param string $name input name
+ * @param string $value input value
+ * @param array $attributes html attributes
* @return string
* @uses Form::input
*/
@@ -130,9 +130,9 @@ public static function hidden($name, $value = NULL, array $attributes = NULL)
*
* echo Form::password('password');
*
- * @param string input name
- * @param string input value
- * @param array html attributes
+ * @param string $name input name
+ * @param string $value input value
+ * @param array $attributes html attributes
* @return string
* @uses Form::input
*/
@@ -148,8 +148,8 @@ public static function password($name, $value = NULL, array $attributes = NULL)
*
* echo Form::file('image');
*
- * @param string input name
- * @param array html attributes
+ * @param string $name input name
+ * @param array $attributes html attributes
* @return string
* @uses Form::input
*/
@@ -165,10 +165,10 @@ public static function file($name, array $attributes = NULL)
*
* echo Form::checkbox('remember_me', 1, (bool) $remember);
*
- * @param string input name
- * @param string input value
- * @param boolean checked status
- * @param array html attributes
+ * @param string $name input name
+ * @param string $value input value
+ * @param boolean $checked checked status
+ * @param array $attributes html attributes
* @return string
* @uses Form::input
*/
@@ -191,10 +191,10 @@ public static function checkbox($name, $value = NULL, $checked = FALSE, array $a
* echo Form::radio('like_cats', 1, $cats);
* echo Form::radio('like_cats', 0, ! $cats);
*
- * @param string input name
- * @param string input value
- * @param boolean checked status
- * @param array html attributes
+ * @param string $name input name
+ * @param string $value input value
+ * @param boolean $checked checked status
+ * @param array $attributes html attributes
* @return string
* @uses Form::input
*/
@@ -216,10 +216,10 @@ public static function radio($name, $value = NULL, $checked = FALSE, array $attr
*
* echo Form::textarea('about', $about);
*
- * @param string textarea name
- * @param string textarea body
- * @param array html attributes
- * @param boolean encode existing HTML characters
+ * @param string $name textarea name
+ * @param string $body textarea body
+ * @param array $attributes html attributes
+ * @param boolean $double_encode encode existing HTML characters
* @return string
* @uses HTML::attributes
* @uses HTML::chars
@@ -242,10 +242,10 @@ public static function textarea($name, $body = '', array $attributes = NULL, $do
*
* [!!] Support for multiple selected options was added in v3.0.7.
*
- * @param string input name
- * @param array available options
- * @param mixed selected option string, or an array of selected options
- * @param array html attributes
+ * @param string $name input name
+ * @param array $options available options
+ * @param mixed $selected selected option string, or an array of selected options
+ * @param array $attributes html attributes
* @return string
* @uses HTML::attributes
*/
@@ -345,9 +345,9 @@ public static function select($name, array $options = NULL, $selected = NULL, ar
*
* echo Form::submit(NULL, 'Login');
*
- * @param string input name
- * @param string input value
- * @param array html attributes
+ * @param string $name input name
+ * @param string $value input value
+ * @param array $attributes html attributes
* @return string
* @uses Form::input
*/
@@ -363,10 +363,10 @@ public static function submit($name, $value, array $attributes = NULL)
*
* echo Form::image(NULL, NULL, array('src' => 'media/img/login.png'));
*
- * @param string input name
- * @param string input value
- * @param array html attributes
- * @param boolean add index file to URL?
+ * @param string $name input name
+ * @param string $value input value
+ * @param array $attributes html attributes
+ * @param boolean $index add index file to URL?
* @return string
* @uses Form::input
*/
@@ -392,9 +392,9 @@ public static function image($name, $value, array $attributes = NULL, $index = F
*
* echo Form::button('save', 'Save Profile', array('type' => 'submit'));
*
- * @param string input name
- * @param string input value
- * @param array html attributes
+ * @param string $name input name
+ * @param string $body input value
+ * @param array $attributes html attributes
* @return string
* @uses HTML::attributes
*/
@@ -411,9 +411,9 @@ public static function button($name, $body, array $attributes = NULL)
*
* echo Form::label('username', 'Username');
*
- * @param string target input
- * @param string label text
- * @param array html attributes
+ * @param string $input target input
+ * @param string $text label text
+ * @param array $attributes html attributes
* @return string
* @uses HTML::attributes
*/
View
16 classes/kohana/fragment.php
@@ -13,7 +13,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2009-2011 Kohana Team
+ * @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
* @uses Kohana::cache
*/
@@ -39,8 +39,8 @@ class Kohana_Fragment {
*
* $key = Fragment::_cache_key('footer', TRUE);
*
- * @param string fragment name
- * @param boolean multilingual fragment support
+ * @param string $name fragment name
+ * @param boolean $i18n multilingual fragment support
* @return string
* @uses I18n::lang
* @since 3.0.4
@@ -69,9 +69,9 @@ protected static function _cache_key($name, $i18n = NULL)
* Fragment::save();
* }
*
- * @param string fragment name
- * @param integer fragment cache lifetime
- * @param boolean multilingual fragment support
+ * @param string $name fragment name
+ * @param integer $lifetime fragment cache lifetime
+ * @param boolean $i18n multilingual fragment support
* @return boolean
*/
public static function load($name, $lifetime = NULL, $i18n = NULL)
@@ -134,8 +134,8 @@ public static function save()
*
* Fragment::delete($key);
*
- * @param string fragment name
- * @param boolean multilingual fragment support
+ * @param string $name fragment name
+ * @param boolean $i18n multilingual fragment support
* @return void
*/
public static function delete($name, $i18n = NULL)
View
70 classes/kohana/html.php
@@ -6,7 +6,7 @@
* @package Kohana
* @category Helpers
* @author Kohana Team
- * @copyright (c) 2007-2011 Kohana Team
+ * @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_HTML {
@@ -57,8 +57,8 @@ class Kohana_HTML {
*
* echo HTML::chars($username);
*
- * @param string string to convert
- * @param boolean encode existing entities
+ * @param string $value string to convert
+ * @param boolean $double_encode encode existing entities
* @return string
*/
public static function chars($value, $double_encode = TRUE)
@@ -73,8 +73,8 @@ public static function chars($value, $double_encode = TRUE)
*
* echo HTML::entities($username);
*
- * @param string string to convert
- * @param boolean encode existing entities
+ * @param string $value string to convert
+ * @param boolean $double_encode encode existing entities
* @return string
*/
public static function entities($value, $double_encode = TRUE)
@@ -88,11 +88,11 @@ public static function entities($value, $double_encode = TRUE)
*
* echo HTML::anchor('/user/profile', 'My Profile');
*
- * @param string URL or URI string
- * @param string link text
- * @param array HTML anchor attributes
- * @param mixed protocol to pass to URL::base()
- * @param boolean include the index page
+ * @param string $uri URL or URI string
+ * @param string $title link text
+ * @param array $attributes HTML anchor attributes
+ * @param mixed $protocol protocol to pass to URL::base()
+ * @param boolean $index include the index page
* @return string
* @uses URL::base
* @uses URL::site
@@ -140,11 +140,11 @@ public static function anchor($uri, $title = NULL, array $attributes = NULL, $pr
*
* echo HTML::file_anchor('media/doc/user_guide.pdf', 'User Guide');
*
- * @param string name of file to link to
- * @param string link text
- * @param array HTML anchor attributes
- * @param mixed protocol to pass to URL::base()
- * @param boolean include the index page
+ * @param string $file name of file to link to
+ * @param string $title link text
+ * @param array $attributes HTML anchor attributes
+ * @param mixed $protocol protocol to pass to URL::base()
+ * @param boolean $index include the index page
* @return string
* @uses URL::base
* @uses HTML::attributes
@@ -158,7 +158,7 @@ public static function file_anchor($file, $title = NULL, array $attributes = NUL
}
// Add the file link to the attributes
- $attributes['href'] = URL::base($protocol, $index).$file;
+ $attributes['href'] = URL::site($file, $protocol, $index);
return '<a'.HTML::attributes($attributes).'>'.$title.'</a>';
}
@@ -169,9 +169,9 @@ public static function file_anchor($file, $title = NULL, array $attributes = NUL
*
* echo HTML::mailto($address);
*
- * @param string email address to send to
- * @param string link text
- * @param array HTML anchor attributes
+ * @param string $email email address to send to
+ * @param string $title link text
+ * @param array $attributes HTML anchor attributes
* @return string
* @uses HTML::attributes
*/
@@ -191,10 +191,10 @@ public static function mailto($email, $title = NULL, array $attributes = NULL)
*
* echo HTML::style('media/css/screen.css');
*
- * @param string file name
- * @param array default attributes
- * @param mixed protocol to pass to URL::base()
- * @param boolean include the index page
+ * @param string $file file name
+ * @param array $attributes default attributes
+ * @param mixed $protocol protocol to pass to URL::base()
+ * @param boolean $index include the index page
* @return string
* @uses URL::base
* @uses HTML::attributes
@@ -204,7 +204,7 @@ public static function style($file, array $attributes = NULL, $protocol = NULL,
if (strpos($file, '://') === FALSE)
{
// Add the base URL
- $file = URL::base($protocol, $index).$file;
+ $file = URL::site($file, $protocol, $index);
}
// Set the stylesheet link
@@ -224,10 +224,10 @@ public static function style($file, array $attributes = NULL, $protocol = NULL,
*
* echo HTML::script('media/js/jquery.min.js');
*
- * @param string file name
- * @param array default attributes
- * @param mixed protocol to pass to URL::base()
- * @param boolean include the index page
+ * @param string $file file name
+ * @param array $attributes default attributes
+ * @param mixed $protocol protocol to pass to URL::base()
+ * @param boolean $index include the index page
* @return string
* @uses URL::base
* @uses HTML::attributes
@@ -237,7 +237,7 @@ public static function script($file, array $attributes = NULL, $protocol = NULL,
if (strpos($file, '://') === FALSE)
{
// Add the base URL
- $file = URL::base($protocol, $index).$file;
+ $file = URL::site($file, $protocol, $index);
}
// Set the script link
@@ -254,10 +254,10 @@ public static function script($file, array $attributes = NULL, $protocol = NULL,
*
* echo HTML::image('media/img/logo.png', array('alt' => 'My Company'));
*
- * @param string file name
- * @param array default attributes
- * @param mixed protocol to pass to URL::base()
- * @param boolean include the index page
+ * @param string $file file name
+ * @param array $attributes default attributes
+ * @param mixed $protocol protocol to pass to URL::base()
+ * @param boolean $index include the index page
* @return string
* @uses URL::base
* @uses HTML::attributes
@@ -267,7 +267,7 @@ public static function image($file, array $attributes = NULL, $protocol = NULL,
if (strpos($file, '://') === FALSE)
{
// Add the base URL
- $file = URL::base($protocol, $index).$file;
+ $file = URL::site($file, $protocol, $index);
}
// Add the image link
@@ -282,7 +282,7 @@ public static function image($file, array $attributes = NULL, $protocol = NULL,
*
* echo '<div'.HTML::attributes($attrs).'>'.$content.'</div>';
*
- * @param array attribute list
+ * @param array $attributes attribute list
* @return string
*/
public static function attributes(array $attributes = NULL)
View
2 classes/kohana/http.php
@@ -11,7 +11,7 @@
* @category HTTP
* @author Kohana Team
* @since 3.1.0
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaphp.com/license
*/
abstract class Kohana_HTTP {
View
32 classes/kohana/http/cache.php
@@ -7,7 +7,7 @@
* @package Kohana
* @category Base
* @author Kohana Team
- * @copyright (c) 2008-2011 Kohana Team
+ * @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaframework.org/license
* @since 3.2.0
*/
@@ -37,8 +37,8 @@ class Kohana_HTTP_Cache {
* );
*
* @uses [Cache]
- * @param mixed cache engine to use
- * @param array options to set to this class
+ * @param mixed $cache cache engine to use
+ * @param array $options options to set to this class
* @return HTTP_Cache
*/
public static function factory($cache, array $options = array())
@@ -61,7 +61,7 @@ public static function factory($cache, array $options = array())
* // Generate cache key
* $cache_key = HTTP_Cache::basic_cache_key_generator($request);
*
- * @param Request request
+ * @param Request $request
* @return string
*/
public static function basic_cache_key_generator(Request $request)
@@ -86,7 +86,7 @@ public static function basic_cache_key_generator(Request $request)
/**