Bugfix: go-pear on Win32
| From: | Matt Robinson | Date: | Fri, 21 Feb 2003 14:33:39 +0000 |
| Subject: | Bugfix: go-pear on Win32 | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3887@lists.php.net to get a copy of this message | ||
Adding the following two lines to the go-pear script makes the PEAR installer use the correct drive, which fixes the problem many people (including myself) have had with installing PEAR when PHP and Windows are installed on different drives.
On line 326, change:
$install_options = array(
'nodeps' => true,
'force' => true,
);
To:
$install_options = array(
'nodeps' => true,
'force' => true,
'installroot' => (eregi("^([a-z]:[\\/])", $prefix, $tmpmatches)) ? $tmpmatches[1] : "",
);
unset($tmpmatches);
This only affects installation paths that begin with a drive letter, so unix installs should be unchanged, and I've successfully tested this by installing to c:\php4\pear, c:\php4\pear\pear\ and d:\pear
There are still other bugs to fix for PEAR installation on Windows. Namely:
1. pear.bat still doesn't replace the @VAR_NAMES@ with install variables
2. the installer still tries to rename '.tmppear' to 'pear' even though
this conflicts with the default install directory name of 'pear'
(setting the "PHP code directory" to $prefix\pearlib allows the
rename to take place, but pear.bat still doesn't get updated). The
installer should try renaming the script pear.in or something.
Maybe I can have a look at those later. Sorry for not supplying this in unified diff format, but I really can't be bothered. It's just a 20second cut & paste job anyway :)
Matt