class styleFinder{
function styleFinder(){
}
function getFilesNFolders($folder){
$this->folder = $folder ;
if($this->folder==""){
$this->folder = '.';
}
if ($handle = opendir($this->folder)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file<br /> ";
if(is_dir($file)){
echo "<b>" . $file . " is a folder</b><br /> with contents ";
$this::getFilesNFolders($file);
# echo "Found folder";
}
}
}
closedir($handle);
}
}
} I wan to print out a complete tree of folders and files, the script is going into the first folders and finding the files, then finding any sub folders, but not subfolders of those (and yes there is some). Any ideas please?
::? Use$this->getFilesNFolders($file);for one thing.self::method()orparent::method(), but you can't reference object state in a static call (->is not allowed). Think of static calls as being functional: en.wikipedia.org/wiki/Functional_programmingparent::method()is not actually a static call. It's a call that depends on the access type of the original method (if the original was accessed as an instance, then the parent call will have access to$this). So that's a special case (and a non-intuitive one to say the least)...