> I'm recursivley reading and editing every .htm and .html file in a 500
page
> website and upgrading it to contain linked CSS, Javascript includes and
PHP
> includes. i can't use a pre_pend file as there's more than one website on
> the server, and the changes are embedded in the document rather than just
> the header/footer. the script works fine and all, trouble is that PHP
> doesn't.
>
> Sometimes the script will run fine, other times PHP will decide to read
the
> same file 10-20 times and then do the same for everyfile in certain
> directories. it's really annoying as some changes will be made over and
over
> and over, also with 500 files being read 5-10 times each, the page times
out
> after about 5000 reads...
>
> is this a PHP bug? or an Microsoft bug? or something else...
>
> i'm running PHP verson 4.0.4pl1 off a 2000 server and IIS

First, are you 100% sure you are correctly recursing through directories?
Show us the source.

Second: It *may* be possible that modifying the files in the midst of
opendir/readdir is shuffling enough things around on the hard drive that you
are confusing the OS.  (It is Windows, after all)

What you might try would be to use opendir/readdir to create a monster array
of every path you want to alter.  Then, walk through that array and do the
alterations.

You can even dump out the array first and check it by hand to be sure it's
want you think it should be, and then turn on the code in a second run to do
the alteration.

If all else fails -- If you're able to add this stuff into the file, you can
probably detect if it's already been added, and skip a file you already
edited...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to