summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88068b2)
raw | patch | inline | side by side (parent: 88068b2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Jun 2005 05:45:18 +0000 (05:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Jun 2005 05:45:18 +0000 (05:45 +0000) |
For full php4 compliance
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@702 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@702 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index d6ddf0694f2e90f5168da96acd50567da7fab52d..b91a3068ea0d55fab603279598062262159634ae 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
return rmdir($path);
}
+function scandir_php4($path,$sort_desc=false)
+{
+$ret = false;
+
+/* is this a dir ? */
+if(is_dir($path)) {
+
+ /* is this path a readable one */
+ if(is_readable($path)){
+
+ /* Get contents and write it into an array */
+ $ret = array();
+
+ $dir = opendir($path);
+
+ /* Is this a correct result ?*/
+ if($dir){
+ while($fp = readdir($dir))
+ $ret[]= $fp;
+ }
+ }
+ }
+ /* Sort array ascending , like scandir */
+ sort($ret);
+
+ /* Sort descending if parameter is sort_desc is set */
+ if($sort_desc) {
+ $ret = array_reverse($ret);
+ }
+
+ return($ret);
+}
+
function clean_smarty_compile_dir($directory)
{
global $svn_revision;
# contents should match the revision number
if(!compare_revision($revision_file, $svn_revision)){
// If revision differs, clean compile directory
- foreach(scandir($directory) as $file) {
+ foreach(scandir_php4($directory) as $file) {
if( is_file($directory."/".$file) &&
is_writable($directory."/".$file)) {
// delete file