diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-08-21 14:43:31 +0200 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-08-21 14:43:31 +0200 |
commit | 993925b47a0bfb08e79961c47bcc3d247a03a5dd (patch) | |
tree | 4012e1f02407efb333a20c67e5d7d1cac8249b9f /system/helpers/file_helper.php | |
parent | 719b65d54a85337c5616a781eff07d5031c106e9 (diff) |
whitespace fixes
a minor re-ordering of the changelog
Diffstat (limited to 'system/helpers/file_helper.php')
-rw-r--r-- | system/helpers/file_helper.php | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 86c5c09db..b59443c0e 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -262,60 +262,60 @@ 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
-*/
+* @access public
+* @param string path to file
+* @param mixed array or comma separated string of information returned
+* @return array
+*/
if ( ! function_exists('get_file_info'))
{
- function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date'))
- {
-
- if ( ! file_exists($file))
- {
- return FALSE;
- }
-
- if (is_string($returned_values))
- {
- $returned_values = explode(',', $returned_values);
- }
-
- foreach ($returned_values as $key)
- {
- switch ($key)
- {
- case 'name':
- $fileinfo['name'] = substr(strrchr($file, '/'), 1);
- break;
- case 'server_path':
- $fileinfo['server_path'] = $file;
- break;
- case 'size':
- $fileinfo['size'] = filesize($file);
- break;
- case 'date':
- $fileinfo['date'] = filectime($file);
- break;
- case 'readable':
- $fileinfo['readable'] = is_readable($file);
- break;
- case 'writable':
- // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms()
- $fileinfo['writable'] = is_writable($file);
- break;
- case 'executable':
- $fileinfo['executable'] = is_executable($file);
- break;
- case 'fileperms':
- $fileinfo['fileperms'] = fileperms($file);
- break;
- }
- }
-
- return $fileinfo;
- }
+ function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date'))
+ {
+
+ if ( ! file_exists($file))
+ {
+ return FALSE;
+ }
+
+ if (is_string($returned_values))
+ {
+ $returned_values = explode(',', $returned_values);
+ }
+
+ foreach ($returned_values as $key)
+ {
+ switch ($key)
+ {
+ case 'name':
+ $fileinfo['name'] = substr(strrchr($file, '/'), 1);
+ break;
+ case 'server_path':
+ $fileinfo['server_path'] = $file;
+ break;
+ case 'size':
+ $fileinfo['size'] = filesize($file);
+ break;
+ case 'date':
+ $fileinfo['date'] = filectime($file);
+ break;
+ case 'readable':
+ $fileinfo['readable'] = is_readable($file);
+ break;
+ case 'writable':
+ // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms()
+ $fileinfo['writable'] = is_writable($file);
+ break;
+ case 'executable':
+ $fileinfo['executable'] = is_executable($file);
+ break;
+ case 'fileperms':
+ $fileinfo['fileperms'] = fileperms($file);
+ break;
+ }
+ }
+
+ return $fileinfo;
+ }
}
// --------------------------------------------------------------------
|