Using PHP for search and replace
| From: | Jean-Michel Dault | Date: | Sat, 04 Jan 2003 21:32:10 +0000 |
| Subject: | Using PHP for search and replace | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-93130@lists.php.net to get a copy of this message | ||
Hello all,
Currently, both Mandrake and RedHat use the following trick:
perl -pi -e "s|^;extension=mysql.so|extension=mysql.so|" /etc/php.ini
This sucks, because you then need perl to install a PHP extension.
We sure could use sed, but this requires a temporary file, and this
creates some security risks.
Is there a quick and easy way to do this kind of thing in PHP? Or would
this be something that we could integrate?
And I know there's a new solution with the new config-file-scan-dir, but
my question is a general search-and-replace solution.
Any thoughts?
Jean-Michel