From 02545895c1c6551be3b167bcada171fe9423d443 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 19 Feb 2014 23:49:31 +0200 Subject: Add compatibility layer for array_column(), array_replace(), array_replace_recursive() --- user_guide_src/source/changelog.rst | 8 +++- .../source/general/compatibility_functions.rst | 52 +++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 9ec4d0d77..ccbb950af 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -508,7 +508,13 @@ Release Date: Not Released - Changed method ``clean_string()`` to utilize ``mb_convert_encoding()`` if it is available but ``iconv()`` is not. - Renamed method ``_is_ascii()`` to ``is_ascii()`` and made it public. - - Added `compatibility layers ` for PHP's `mbstring `_ (limited support), `hash `_ and `password `_ extensions. + - Added `compatibility layers ` for: + + - `Multibyte String `_ (limited support). + - `Hash `_ (just ``hash_pbkdf2()``). + - `Password Hashing `_. + - `Array Functions `_ (``array_column()``, ``array_replace()``, ``array_replace_recursive()``). + - Removed ``CI_CORE`` boolean constant from *CodeIgniter.php* (no longer Reactor and Core versions). - Log Library will now try to create the **log_path** directory if it doesn't exist. - Added support for HTTP-Only cookies with new config option *cookie_httponly* (default FALSE). diff --git a/user_guide_src/source/general/compatibility_functions.rst b/user_guide_src/source/general/compatibility_functions.rst index 3495101ac..398403eda 100644 --- a/user_guide_src/source/general/compatibility_functions.rst +++ b/user_guide_src/source/general/compatibility_functions.rst @@ -183,4 +183,54 @@ Function reference :rtype: string For more information, please refer to the `PHP manual for - mb_substr() `_. \ No newline at end of file + mb_substr() `_. + +*************** +Array Functions +*************** + +This set of compatibility functions offers support for a few +standard `Array Functions `_ in PHP +that otherwise require a newer PHP version. + +Dependancies +============ + +- None + +Function reference +================== + +.. function:: array_column(array $array, $column_key[, $index_key = NULL]) + + :param array $array: Array to fetch results from + :param mixed $column_key: Key of the column to return values from + :param mixed $index_key: Key to use for the returned values + :returns: An array of values representing a single column from the input array + :rtype: array + + For more information, please refer to the `PHP manual for + array_column() `_. + +.. function:: array_replace(array $array1[, ...]) + + :param array $array1: Array in which to replace elements + :param array ...: Array (or multiple ones) from which to extract elements + :returns: Modified array + :rtype: array + + For more information, please refer to the `PHP manual for + array_replace() `_. + +.. function:: array_replace_recursive(array $array1[, ...]) + + :param array $array1: Array in which to replace elements + :param array ...: Array (or multiple ones) from which to extract elements + :returns: Modified array + :rtype: array + + For more information, please refer to the `PHP manual for + array_replace_recursive() `_. + + .. important:: Only PHP's native function can detect endless recursion. + Unless you are running PHP 5.3+, be careful with references! \ No newline at end of file -- cgit v1.2.3-24-g4f1b