Hi all. I've recently rewritten the course search engine for the university I work for, and now I need to go through the entire website and change specific links.
To do this I thought, easy, I'll just use File_Find() to get an array of ALL the files in the website.
However, when I run the following code:
it only gives me 1650 files, and there are WAY more than 1650 files especially since this count hasn't even had the image or pdf files stripped out.
Here's the page in action:
Can anyone think of any idea why File_Find doesn't seem to be reading the directory tree correctly? I'm pointing at the right root directory, so I can't really see what the problem is. The script is running as the apache user, so permissions shouldn't be the problem.
Thanks in advance for any suggestions.
Cheers,
Pablo
To do this I thought, easy, I'll just use File_Find() to get an array of ALL the files in the website.
However, when I run the following code:
Code:
echo '<strong>rewriting links...</strong><br><br>';
include('PEAR/File/Find.php');
$f = new File_Find();
$tmp_files = $f->maptree('/path/to/site/root/');
$files = $tmp_files[1];
die('count: '.count($files));
Here's the page in action:
Can anyone think of any idea why File_Find doesn't seem to be reading the directory tree correctly? I'm pointing at the right root directory, so I can't really see what the problem is. The script is running as the apache user, so permissions shouldn't be the problem.
Thanks in advance for any suggestions.
Cheers,
Pablo