From 0f0b76980cb07f39b20c8591882aeae3854f016c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 7 Jun 2012 14:57:04 +0300 Subject: Deprecated do_hash() and read_file() in favor of hash() and file_get_contents() respectively --- user_guide_src/source/changelog.rst | 20 +++++++++++--------- user_guide_src/source/helpers/file_helper.rst | 3 +++ user_guide_src/source/helpers/security_helper.rst | 6 ++++-- user_guide_src/source/helpers/string_helper.rst | 3 +-- 4 files changed, 19 insertions(+), 13 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 211e9acc9..7180c2d07 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -44,19 +44,21 @@ Release Date: Not Released - Helpers - - create_captcha() accepts additional colors parameter, allowing for color customization - - url_title() will now trim extra dashes from beginning and end. + - ``create_captcha()`` accepts additional colors parameter, allowing for color customization. + - ``url_title()`` will now trim extra dashes from beginning and end. - Added XHTML Basic 1.1 doctype to :doc:`HTML Helper `. - - Changed humanize() to include a second param for the separator. + - Changed ``humanize()`` to include a second param for the separator. - Refactored ``plural()`` and ``singular()`` to avoid double pluralization and support more words. - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). - Added an optional third parameter to ``timespan()`` that constrains the number of time units displayed. - - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - - form_dropdown() will now also take an array for unity with other form helpers. - - set_realpath() can now also handle file paths as opposed to just directories. - - do_hash() now uses PHP's native hash() function, supporting more algorithms. - - Added an optional paramater to ``delete_files()`` to enable it to skip deleting files such as .htaccess and index.html. - - Removed deprecated helper function ``js_insert_smiley()`` from smiley helper. + - Added a work-around in ``force_download()`` for a bug Android <= 2.1, where the filename extension needs to be in uppercase. + - ``form_dropdown()`` will now also take an array for unity with other form helpers. + - ``do_hash()`` now uses PHP's native ``hash()`` function (supporting more algorithms) and is deprecated. + - Removed previously deprecated helper function ``js_insert_smiley()`` from smiley helper. + - :doc:`File Helper ` changes include: + - ``set_realpath()`` can now also handle file paths as opposed to just directories. + - Added an optional paramater to ``delete_files()`` to enable it to skip deleting files such as .htaccess and index.html. + - ``read_file()`` is now a deprecated alias of ``file_get_contents()``. - Database diff --git a/user_guide_src/source/helpers/file_helper.rst b/user_guide_src/source/helpers/file_helper.rst index bfc271eb3..60c5aa98c 100644 --- a/user_guide_src/source/helpers/file_helper.rst +++ b/user_guide_src/source/helpers/file_helper.rst @@ -32,6 +32,9 @@ The path can be a relative or full server path. Returns FALSE (boolean) on failu controller or view files. CodeIgniter uses a front controller so paths are always relative to the main site index. +.. note:: This function is DEPRECATED. Use the native ``file_get_contents()`` + instead. + If your server is running an `open_basedir` restriction this function might not work if you are trying to access a file above the calling script. write_file('path', $data) diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index b1bcf2b4a..ec0be28b3 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -43,8 +43,10 @@ for a full list of supported algorithms. $str = do_hash($str); // SHA1 $str = do_hash($str, 'md5'); // MD5 -.. note:: This function was formerly named dohash(), which has been - removed in favor of `do_hash()`. +.. note:: This function was formerly named ``dohash()``, which has been + removed in favor of ``do_hash()``. + +.. note:: This function is DEPRECATED. Use the native ``hash()`` instead. strip_image_tags() ================== diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index 2d23fb00c..19500aa0d 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -36,8 +36,7 @@ alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1 - **unique**: Encrypted with MD5 and uniqid(). Note: The length parameter is not available for this type. Returns a fixed length 32 character string. -- **sha1**: An encrypted random number based on do_hash() from the - :doc:`security helper `. +- **sha1**: An encrypted random number based on ``sha1()``. Usage example -- cgit v1.2.3-24-g4f1b