From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/helpers/file_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/file_helper.php') diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 2d4b10e37..3fd6b82e1 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From b2518645404fcafa17f4cfcb8689dce845c90b75 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 26 Mar 2012 21:44:08 +0300 Subject: Remove access description lines and cleanup the file and email helpers --- system/helpers/file_helper.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'system/helpers/file_helper.php') diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 3fd6b82e1..6e8a4ded1 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter File Helpers * @@ -44,7 +42,6 @@ * * Opens the file specfied in the path and returns it as a string. * - * @access public * @param string path to file * @return string */ @@ -90,7 +87,6 @@ if ( ! function_exists('read_file')) * Writes data to the file specified in the path. * Creates a new file if non-existent. * - * @access public * @param string path to file * @param string file data * @return bool @@ -123,7 +119,6 @@ if ( ! function_exists('write_file')) * If the second parameter is set to TRUE, any directories contained * within the supplied base directory will be nuked as well. * - * @access public * @param string path to file * @param bool whether to delete any directories found in the path * @return bool @@ -142,7 +137,7 @@ if ( ! function_exists('delete_files')) while (FALSE !== ($filename = @readdir($current_dir))) { - if ($filename !== '.' and $filename !== '..') + if ($filename !== '.' && $filename !== '..') { if (is_dir($path.DIRECTORY_SEPARATOR.$filename) && $filename[0] !== '.') { @@ -150,13 +145,13 @@ if ( ! function_exists('delete_files')) } else { - unlink($path.DIRECTORY_SEPARATOR.$filename); + @unlink($path.DIRECTORY_SEPARATOR.$filename); } } } @closedir($current_dir); - if ($del_dir == TRUE AND $level > 0) + if ($del_dir == TRUE && $level > 0) { return @rmdir($path); } @@ -173,7 +168,6 @@ if ( ! function_exists('delete_files')) * Reads the specified directory and builds an array containing the filenames. * Any sub-folders contained within the specified path are read as well. * - * @access public * @param string path to source * @param bool whether to include the path as part of the filename * @param bool internal variable to determine recursion status - do not use in calls @@ -224,7 +218,6 @@ if ( ! function_exists('get_filenames')) * * Any sub-folders contained within the specified path are read as well. * - * @access public * @param string path to source * @param bool Look only at the top level directory specified? * @param bool internal variable to determine recursion status - do not use in calls @@ -278,7 +271,6 @@ if ( ! function_exists('get_dir_file_info')) * Options are: name, server_path, size, date, readable, writable, executable, fileperms * Returns FALSE if the file cannot be found. * -* @access public * @param string path to file * @param mixed array or comma separated string of information returned * @return array @@ -345,7 +337,6 @@ if ( ! function_exists('get_file_info')) * Note: this is NOT an accurate way of determining file mime types, and is here strictly as a convenience * It should NOT be trusted, and should certainly NOT be used for security * - * @access public * @param string path to file * @return mixed */ @@ -399,7 +390,6 @@ if ( ! function_exists('get_mime_by_extension')) * Takes a numeric value representing a file's permissions and returns * standard symbolic notation representing that value * - * @access public * @param int * @return string */ @@ -467,7 +457,6 @@ if ( ! function_exists('symbolic_permissions')) * Takes a numeric value representing a file's permissions and returns * a three character string representing the file's octal permissions * - * @access public * @param int * @return string */ @@ -480,4 +469,4 @@ if ( ! function_exists('octal_permissions')) } /* End of file file_helper.php */ -/* Location: ./system/helpers/file_helper.php */ +/* Location: ./system/helpers/file_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From fd6c2bc7ed0ce474ac08fefb3efe88288368da98 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 16:21:48 +0300 Subject: Fix issue #1238 --- system/helpers/file_helper.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'system/helpers/file_helper.php') diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 6e8a4ded1..3a373efd3 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -121,11 +121,13 @@ if ( ! function_exists('write_file')) * * @param string path to file * @param bool whether to delete any directories found in the path + * @param int + * @param bool whether to skip deleting .htaccess and index page files * @return bool */ if ( ! function_exists('delete_files')) { - function delete_files($path, $del_dir = FALSE, $level = 0) + function delete_files($path, $del_dir = FALSE, $level = 0, $htdocs = FALSE) { // Trim the trailing slash $path = rtrim($path, DIRECTORY_SEPARATOR); @@ -141,9 +143,9 @@ if ( ! function_exists('delete_files')) { if (is_dir($path.DIRECTORY_SEPARATOR.$filename) && $filename[0] !== '.') { - delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1); + delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1, $htdocs); } - else + elseif ($htdocs === TRUE && ! preg_match('/^(\.htaccess|index\.(html|htm|php))$/', $filename)) { @unlink($path.DIRECTORY_SEPARATOR.$filename); } -- cgit v1.2.3-24-g4f1b From 14c350c77c232ab7a5cf68c30fdbab5cdac2d403 Mon Sep 17 00:00:00 2001 From: st2 Date: Wed, 25 Apr 2012 02:48:49 +0800 Subject: Update system/helpers/file_helper.php --- system/helpers/file_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/file_helper.php') diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 3a373efd3..a5aabecd6 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -145,7 +145,7 @@ if ( ! function_exists('delete_files')) { delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $level + 1, $htdocs); } - elseif ($htdocs === TRUE && ! preg_match('/^(\.htaccess|index\.(html|htm|php))$/', $filename)) + elseif ($htdocs === TRUE && ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { @unlink($path.DIRECTORY_SEPARATOR.$filename); } -- cgit v1.2.3-24-g4f1b