From 3eb97098bb41d7c7f8fd3fbe1c902d77b44632ae Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 5 Jul 2012 22:33:13 +0100 Subject: [PATCH] Completely rewritten dir tree generator Previous dir tree was working via the usual recursive method of scandir The code was problematic as it was creating 3 dir trees and had an incorrect UL structure This now works in a completely different way, using PHPs inbuilt iterators Performance results are visibly noticable as file manager loads much quicker Tests show around a 100% increase in efficiency on servers with 1000's of files & folders There is also much less code, less repitition and it's much cleaner to work with The incorrect UL & LI structure has now been fixed and is valid Loads of junk and redundant code removed also --- files.php | 284 ++++++++++++++++++++++++------------------------------ 1 file changed, 124 insertions(+), 160 deletions(-) diff --git a/files.php b/files.php index f935f26..81287a9 100644 --- a/files.php +++ b/files.php @@ -1,173 +1,137 @@ - 2) { // To ignore . and .. directories - if($first_call) { - // Root Directory - $dirRep = str_replace("\\","/",$directory); - $link = str_replace("[link]", "$dirRep/", $return_link); - $link = str_replace("//","/",$link); - $fileAtts = ""; - - if ($serverType=="Linux") { - $chmodInfo = substr(sprintf('%o', fileperms($link)), -3); - $fileAtts = ''.$chmodInfo.''; - } - $fileManager = "\n"; + + echo "\n"; ?>