From 94a2182c95cc95646ad582616d335bce62152c86 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Thu, 8 May 2008 15:00:28 +0000
Subject: added symbolic_permissions() and octal_permissions() to the File
helper
---
user_guide/changelog.html | 1 +
user_guide/helpers/file_helper.html | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
(limited to 'user_guide')
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 07637db08..7ce672710 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -90,6 +90,7 @@ SVN Commit: not currently released
Helpers
- Added a Compatibility Helper for using some common PHP 5 functions safely in applications that might run on PHP 4 servers (thanks Seppo for the hard work and code contribution!)
+ - Added symbolic_permissions() and octal_permissions() to the File helper.
- Added form_button() in the Form helper.
- Changed the radio() and checkbox() functions to default to not checked by default.
- Added the ability to include an optional HTTP Response Code in the redirect() function of the URL Helper.
diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html
index 3fa92462b..13d0beb97 100644
--- a/user_guide/helpers/file_helper.html
+++ b/user_guide/helpers/file_helper.html
@@ -142,7 +142,25 @@ can optionally be added to the file names by setting the second parameter to TRU
echo $file . ' is has a mime type of ' . get_mime_by_extension($file);
Note: This is not an accurate way of determining file mime types, and is here strictly as a convenience. It should not be used for security.
+
+symbolic_permissions($perms)
+
+Takes numeric permissions (such as is returned by fileperms() and returns standard symbolic notation of file permissions.
+
+echo symbolic_permissions(fileperms('./index.php'));
+
+// -rw-r--r--
+
+octal_permissions($perms)
+
+Takes numeric permissions (such as is returned by fileperms() and returns a three character octal notation of file permissions.
+
+echo octal_permissions(fileperms('./index.php'));
+
+// 644
+
+
--
cgit v1.2.3-24-g4f1b