Permalink
Browse files

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

  • Loading branch information...
2 parents 44fcb1b + 4c554da commit f31beb7011cad0b3eb67816e07967b52598a97a7 @zombor zombor committed Aug 24, 2012
Showing with 1,698 additions and 1,004 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. +39 −31 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
@@ -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
@@ -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
@@ -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)
@@ -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
@@ -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
*/
@@ -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)
@@ -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
@@ -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
*/
Oops, something went wrong.

0 comments on commit f31beb7

Please sign in to comment.