Page 1 of 1

Query::Directory Traversing

Posted: Tue May 18, 2004 5:08 pm
by randomblink
I have looked around the forums...
And I have looked around PHPClasses...
And I am stumped...

What I would LIKE is a Class that simply traverses Directories...
A PERFECT Class would be given a root directory...
And it would go through ALL of the folders and subfolders in those directories and return an array of $files.

$file['path'] would include the path to the file...
$file['name'] would be the name of the file...
etc... Each array key would hold a piece of file information...

I want to use this for a massive INCLUDE...
I want to be able to point to:
public_html/libraries/<libraryname>/classes

Then I want to include all files in THAT folder that start with:
class_*.php

This way I just name all of my class files ' class_<filename>.php ' and then I can tell it to grab the classes from a <certain library>... and voila!

Any help would be appreciated... Thanks...

Posted: Tue May 18, 2004 5:47 pm
by feyd
using opendir()/readdir() or glob() will help you create such an array.

Your Assistance Is Appreciated

Posted: Wed May 19, 2004 8:17 am
by randomblink
Thanks Feyd -

I will have to look into glob(). I have seen you mention it on several other posts, I am not even sure if I run the most current version of PHP... Have to check if glob() is even in there... Thanks tho...