go-pear improvements
| From: | Matt Robinson | Date: | Fri, 21 Feb 2003 14:57:11 +0000 |
| Subject: | go-pear improvements | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3890@lists.php.net to get a copy of this message | ||
On line 366, go-pear attempts to guess the location of php.ini by looking in c:\winnt and c:\windows:
It strikes me that instead of the lines marked with >>>, you could put $php_ini = $_ENV['windir'] . DIRECTORY_SEPARATOR . 'php.ini'; or $php_ini = $_SERVER['WINDIR'] . DIRECTORY_SEPARATOR . 'php.ini'; IIRC, the 'windir' environment variable is set by default on Windows NT, 2000, XP, and 9x so it's a pretty safe bet that it's accessible. In fact it's a much safer bet than trying to access c:\windows :). -- Mattif (WINDOWS) {// on Windows, we can be pretty sure that there is a php.ini // file somewhere do {$php_ini = PHP_CONFIG_FILE_PATH . DIRECTORY_SEPARATOR . 'php.ini'; if (@file_exists($php_ini)) break;} while (false);if (@file_exists($php_ini)) break;$php_ini = 'c:\winnt\php.ini';$php_ini = 'c:\windows\php.ini';} else {$php_ini = PHP_CONFIG_FILE_PATH . DIRECTORY_SEPARATOR . 'php.ini';}