RE: [PHP] Side Comment (was: Newbie Question: Converting PHP3 files to PHP4?)

2001-09-03 Thread Christopher William Wesley

On Tue, 4 Sep 2001, Jason Murray wrote:
> But then, the right tools make the job easy regardless of
> platform.

For sure!  I don't bother with all that clicking ... now you [Unix folk]
don't have to either :)

#!/bin/sh
for PHP3FILE in `find . -type f -name "*.php3" -print`
do
PHP4FILE=`echo ${PHP3FILE} | sed 's/\.php3/\.php/g'`
sed 's/\.php3/\.php/g' ${PHP3FILE} > ${PHP4FILE}
done
#END OF SCRIPT

That recursively finds all files starting in whatever directory you like,
and creates the newly-named files with all the references corrected as
desired (with a small addition, the old files can be archived or removed).

I just had some fun with that script and a copy of an old doc root ... 17
directories, deepest directory was at 3 levels, and 216 .php3 files (from
1998 :) ... took a few seconds to make all the modifications.

~Chris   /"\
 \ / Pine Ribbon Campaign
Microsoft Security Specialist X  Against Outlook
The moron in Oxymoron.   / \ http://www.thebackrow.net



-- 
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]




RE: [PHP] Side Comment (was: Newbie Question: Converting PHP3 files to PHP4?)

2001-09-03 Thread Jason Murray

> Rather than the web server config, I was referring to renaming 
> all the .php3 files to have .php extensions, and combing through 
> all the files, finding all references to .php3 files, and changing 
> them to refer to .php files.  I know exactly how to do it ...  I 
> do similar tasks routinely ... on my Linux servers.  I don't know 
> how to make that task easy in Illegal Monopoly OS.

Whoops, my mistake ... got into my server config mindset and I
was off and racing. :)

Incidentally, what you ARE talking about is very easy in IMOS, 
with the right tool.

Homesite.

Open all the files, replace ".php3" with ".php" in "All Open
Documents"... save 'em all and change the filenames in the file
list and you're done.

But then, the right tools make the job easy regardless of
platform.

J

-- 
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]




Re: [PHP] Side Comment (was: Newbie Question: Converting PHP3 files to PHP4?)

2001-09-03 Thread Joel Ricker

: On Tue, 4 Sep 2001, Jason Murray wrote:
:
: > Nah, in Illegal Monopoly OS, its just as easy as Apache.
:
: Rather than the web server config, I was referring to renaming all the
: .php3 files to have .php extensions, and combing through all the files,
: finding all references to .php3 files, and changing them to refer to .php
: files.  I know exactly how to do it ...  I do similar tasks routinely ...
: on my Linux servers.  I don't know how to make that task easy in Illegal
: Monopoly OS.

I do.  I have to do it all the time (actually sometimes its to regress from
php back to php3).

from the command line: rename *.php3 *.php

Then I use my text editor which has global file find and replace to make the
changes.

Joel


-- 
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]