Lines 1-6
Link Here
|
1 |
--- go-pear.orig 2013-07-18 07:18:00 UTC |
1 |
--- go-pear.orig 2017-08-03 16:38:00 UTC |
2 |
+++ go-pear |
2 |
+++ go-pear |
3 |
@@ -57,6 +57,8 @@ |
3 |
@@ -57,6 +57,8 @@ define('GO_PEAR_VER', '1.1.2'); |
4 |
|
4 |
|
5 |
define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript')); |
5 |
define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript')); |
6 |
|
6 |
|
Lines 9-15
Link Here
|
9 |
/* |
9 |
/* |
10 |
* See bug #23069 |
10 |
* See bug #23069 |
11 |
*/ |
11 |
*/ |
12 |
@@ -116,7 +118,7 @@ |
12 |
@@ -116,7 +118,7 @@ $bootstrap_pkgs = array( // uses URL like http://pear. |
13 |
); |
13 |
); |
14 |
|
14 |
|
15 |
$installer_packages = array( |
15 |
$installer_packages = array( |
Lines 18-24
Link Here
|
18 |
'Structures_Graph-stable', |
18 |
'Structures_Graph-stable', |
19 |
'Archive_Tar-stable', |
19 |
'Archive_Tar-stable', |
20 |
'Console_Getopt-stable', |
20 |
'Console_Getopt-stable', |
21 |
@@ -250,7 +252,7 @@ |
21 |
@@ -250,7 +252,7 @@ if (WEBINSTALLER) { |
22 |
} |
22 |
} |
23 |
// Anything past this step has something to do with the installation |
23 |
// Anything past this step has something to do with the installation |
24 |
} |
24 |
} |
Lines 27-33
Link Here
|
27 |
if (!WEBINSTALLER) { |
27 |
if (!WEBINSTALLER) { |
28 |
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r'); |
28 |
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r'); |
29 |
|
29 |
|
30 |
@@ -294,7 +296,7 @@ |
30 |
@@ -294,7 +296,7 @@ If you wish to abort, press Control-C now, or press En |
31 |
$http_proxy = $tmp; |
31 |
$http_proxy = $tmp; |
32 |
} |
32 |
} |
33 |
} |
33 |
} |
Lines 36-42
Link Here
|
36 |
$origpwd = getcwd(); |
36 |
$origpwd = getcwd(); |
37 |
|
37 |
|
38 |
$config_vars = array_keys($config_desc); |
38 |
$config_vars = array_keys($config_desc); |
39 |
@@ -345,7 +347,7 @@ |
39 |
@@ -345,7 +347,7 @@ we strongly recommand to use it. |
40 |
break; |
40 |
break; |
41 |
} |
41 |
} |
42 |
} |
42 |
} |
Lines 45-51
Link Here
|
45 |
while (!WEBINSTALLER) { |
45 |
while (!WEBINSTALLER) { |
46 |
print " |
46 |
print " |
47 |
Below is a suggested file layout for your new PEAR installation. To |
47 |
Below is a suggested file layout for your new PEAR installation. To |
48 |
@@ -428,7 +430,7 @@ |
48 |
@@ -428,7 +430,7 @@ If you have a CLI (or CGI) php.exe available, we stron |
49 |
} |
49 |
} |
50 |
} |
50 |
} |
51 |
} |
51 |
} |
Lines 54-60
Link Here
|
54 |
#### |
54 |
#### |
55 |
# Installation stuff |
55 |
# Installation stuff |
56 |
#### |
56 |
#### |
57 |
@@ -488,7 +490,7 @@ |
57 |
@@ -488,7 +490,7 @@ full write access to this directory and the install di |
58 |
continue; |
58 |
continue; |
59 |
} |
59 |
} |
60 |
|
60 |
|
Lines 63-69
Link Here
|
63 |
if (!@is_dir($dir)) { |
63 |
if (!@is_dir($dir)) { |
64 |
if (!mkdir_p($dir)) { |
64 |
if (!mkdir_p($dir)) { |
65 |
if (!WEBINSTALLER) { |
65 |
if (!WEBINSTALLER) { |
66 |
@@ -561,7 +563,7 @@ |
66 |
@@ -561,7 +563,7 @@ if (WEBINSTALLER) { |
67 |
ob_start(); |
67 |
ob_start(); |
68 |
} |
68 |
} |
69 |
} |
69 |
} |
Lines 72-78
Link Here
|
72 |
if (!WEBINSTALLER) { |
72 |
if (!WEBINSTALLER) { |
73 |
$msg = "The following PEAR packages are bundled with PHP: " . |
73 |
$msg = "The following PEAR packages are bundled with PHP: " . |
74 |
implode(', ', array_keys($pfc_packages)); |
74 |
implode(', ', array_keys($pfc_packages)); |
75 |
@@ -571,17 +573,19 @@ |
75 |
@@ -571,17 +573,19 @@ if (!WEBINSTALLER) { |
76 |
$install_optional_packages = array(); |
76 |
$install_optional_packages = array(); |
77 |
print "\n"; |
77 |
print "\n"; |
78 |
} |
78 |
} |
Lines 96-102
Link Here
|
96 |
if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error. |
96 |
if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error. |
97 |
if (WINDOWS) { |
97 |
if (WINDOWS) { |
98 |
@dl('php_zlib.dll'); |
98 |
@dl('php_zlib.dll'); |
99 |
@@ -606,18 +610,19 @@ |
99 |
@@ -606,18 +610,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). |
100 |
if (!$have_gzip) { |
100 |
if (!$have_gzip) { |
101 |
print "Downloading uncompressed packages\n"; |
101 |
print "Downloading uncompressed packages\n"; |
102 |
}; |
102 |
}; |
Lines 118-124
Link Here
|
118 |
} |
118 |
} |
119 |
|
119 |
|
120 |
// gopear_bundle usage |
120 |
// gopear_bundle usage |
121 |
@@ -645,19 +650,21 @@ |
121 |
@@ -645,19 +650,21 @@ displayHTMLProgress($progress = 5); |
122 |
|
122 |
|
123 |
// Bootstrap needed ? |
123 |
// Bootstrap needed ? |
124 |
$nobootstrap = false; |
124 |
$nobootstrap = false; |
Lines 142-148
Link Here
|
142 |
} |
142 |
} |
143 |
include_once 'PEAR.php'; |
143 |
include_once 'PEAR.php'; |
144 |
print "ok\n"; |
144 |
print "ok\n"; |
145 |
@@ -691,6 +698,7 @@ |
145 |
@@ -691,6 +698,7 @@ displayHTMLProgress($progress = 20); |
146 |
|
146 |
|
147 |
// Extract needed ? |
147 |
// Extract needed ? |
148 |
$noextract = false; |
148 |
$noextract = false; |
Lines 150-156
Link Here
|
150 |
if (is_dir($php_dir)) { |
150 |
if (is_dir($php_dir)) { |
151 |
$noextract = @include_once 'PEAR/Registry.php'; |
151 |
$noextract = @include_once 'PEAR/Registry.php'; |
152 |
|
152 |
|
153 |
@@ -701,6 +709,7 @@ |
153 |
@@ -701,6 +709,7 @@ if (is_dir($php_dir)) { |
154 |
} |
154 |
} |
155 |
} |
155 |
} |
156 |
} |
156 |
} |
Lines 158-164
Link Here
|
158 |
|
158 |
|
159 |
if ($noextract) { |
159 |
if ($noextract) { |
160 |
print('Using previously installed installer ... '); |
160 |
print('Using previously installed installer ... '); |
161 |
@@ -722,7 +731,7 @@ |
161 |
@@ -722,7 +731,7 @@ if ($noextract) { |
162 |
displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs))); |
162 |
displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs))); |
163 |
|
163 |
|
164 |
$fullpkg = substr($tarball, 0, strrpos($tarball, '.')); |
164 |
$fullpkg = substr($tarball, 0, strrpos($tarball, '.')); |
Lines 167-173
Link Here
|
167 |
if (!$tar->extractModify($ptmp, $fullpkg)) { |
167 |
if (!$tar->extractModify($ptmp, $fullpkg)) { |
168 |
bail("Extraction for $fullpkg failed!\n"); |
168 |
bail("Extraction for $fullpkg failed!\n"); |
169 |
} |
169 |
} |
170 |
@@ -747,12 +756,7 @@ |
170 |
@@ -747,13 +756,8 @@ include_once "PEAR/Config.php"; |
171 |
include_once "PEAR/Command.php"; |
171 |
include_once "PEAR/Command.php"; |
172 |
include_once "PEAR/Registry.php"; |
172 |
include_once "PEAR/Registry.php"; |
173 |
|
173 |
|
Lines 176-187
Link Here
|
176 |
-} else { |
176 |
-} else { |
177 |
- $config = &PEAR_Config::singleton(); |
177 |
- $config = &PEAR_Config::singleton(); |
178 |
-} |
178 |
-} |
179 |
- |
|
|
180 |
+$config = &PEAR_Config::singleton(($destdir ? $destdir : '').$prefix."/etc/pear.conf.sample", ''); |
179 |
+$config = &PEAR_Config::singleton(($destdir ? $destdir : '').$prefix."/etc/pear.conf.sample", ''); |
181 |
|
180 |
|
|
|
181 |
- |
182 |
$config->set('preferred_state', 'stable'); |
182 |
$config->set('preferred_state', 'stable'); |
183 |
foreach ($config_vars as $var) { |
183 |
foreach ($config_vars as $var) { |
184 |
@@ -765,7 +769,7 @@ |
184 |
if (isset($$var) && $$var != '') { |
|
|
185 |
@@ -765,7 +769,7 @@ $config->set('temp_dir', $temp_dir); |
185 |
$config->set('http_proxy', $http_proxy); |
186 |
$config->set('http_proxy', $http_proxy); |
186 |
$config->store(); |
187 |
$config->store(); |
187 |
|
188 |
|
Lines 190-196
Link Here
|
190 |
PEAR_Command::setFrontendType('CLI'); |
191 |
PEAR_Command::setFrontendType('CLI'); |
191 |
|
192 |
|
192 |
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently |
193 |
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently |
193 |
@@ -787,6 +791,11 @@ |
194 |
@@ -787,6 +791,11 @@ foreach ($to_install as $pkg) { |
194 |
} else { |
195 |
} else { |
195 |
$options = array('onlyreqdeps' => true); |
196 |
$options = array('onlyreqdeps' => true); |
196 |
} |
197 |
} |
Lines 202-208
Link Here
|
202 |
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) { |
203 |
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) { |
203 |
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n"); |
204 |
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n"); |
204 |
displayHTMLProgress($progress += round(50 / count($to_install))); |
205 |
displayHTMLProgress($progress += round(50 / count($to_install))); |
205 |
@@ -821,7 +830,7 @@ |
206 |
@@ -821,7 +830,7 @@ displayHTMLProgress($progress = 99); |
206 |
|
207 |
|
207 |
|
208 |
|
208 |
// Base installation finished |
209 |
// Base installation finished |
Lines 211-217
Link Here
|
211 |
ini_restore("include_path"); |
212 |
ini_restore("include_path"); |
212 |
|
213 |
|
213 |
if (!WEBINSTALLER) { |
214 |
if (!WEBINSTALLER) { |
214 |
@@ -980,6 +989,7 @@ |
215 |
@@ -980,6 +989,7 @@ if ( WINDOWS ) { |
215 |
if (WINDOWS && !WEBINSTALLER) { |
216 |
if (WINDOWS && !WEBINSTALLER) { |
216 |
win32CreateRegEnv(); |
217 |
win32CreateRegEnv(); |
217 |
} |
218 |
} |
Lines 219-225
Link Here
|
219 |
// Set of functions following |
220 |
// Set of functions following |
220 |
/** |
221 |
/** |
221 |
* Parse the given dirname |
222 |
* Parse the given dirname |
222 |
@@ -1418,19 +1428,17 @@ |
223 |
@@ -1134,7 +1144,7 @@ function which($program, $dont_search_in = false) |
|
|
224 |
if (!strlen($dir)) { |
225 |
continue; |
226 |
} |
227 |
- if ($dir{strlen($dir) - 1} != '\\') { |
228 |
+ if ($dir[strlen($dir) - 1] != '\\') { |
229 |
$dir .= '\\'; |
230 |
} |
231 |
$tmp = $dir . $program; |
232 |
@@ -1418,19 +1428,17 @@ function detect_install_dirs($_prefix = null) { |
223 |
} |
233 |
} |
224 |
} else { |
234 |
} else { |
225 |
if ($_prefix === null) { |
235 |
if ($_prefix === null) { |
Lines 244-250
Link Here
|
244 |
// check if the user has installed PHP with PHP or GNU layout |
254 |
// check if the user has installed PHP with PHP or GNU layout |
245 |
if (@is_dir("$prefix/lib/php/.registry")) { |
255 |
if (@is_dir("$prefix/lib/php/.registry")) { |
246 |
$php_dir = '$prefix/lib/php'; |
256 |
$php_dir = '$prefix/lib/php'; |
247 |
@@ -1442,6 +1450,7 @@ |
257 |
@@ -1442,6 +1450,7 @@ function detect_install_dirs($_prefix = null) { |
248 |
} elseif (@is_dir("$prefix/share/php/.registry")) { |
258 |
} elseif (@is_dir("$prefix/share/php/.registry")) { |
249 |
$php_dir = '$prefix/share/php'; |
259 |
$php_dir = '$prefix/share/php'; |
250 |
} |
260 |
} |