Lines 1-15
Link Here
|
1 |
--- go-pear.orig 2017-08-03 16:38:00 UTC |
1 |
--- go-pear.orig 2022-09-21 07:50:47 UTC |
2 |
+++ go-pear |
2 |
+++ go-pear |
3 |
@@ -57,6 +57,8 @@ define('GO_PEAR_VER', '1.1.2'); |
3 |
@@ -47,6 +47,8 @@ if (!$safe_mode) { |
4 |
|
4 |
ob_implicit_flush(true); |
5 |
define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript')); |
5 |
define('WEBINSTALLER', ($sapi_name != 'cli' && !(substr($sapi_name,0,3)=='cgi' && !isset($_SERVER['GATEWAY_INTERFACE'])))); |
6 |
|
6 |
|
7 |
+$destdir = getenv('DESTDIR'); |
7 |
+$destdir = getenv('DESTDIR'); |
8 |
+ |
8 |
+ |
9 |
/* |
9 |
ini_set('track_errors', true); |
10 |
* See bug #23069 |
10 |
ini_set('html_errors', WEBINSTALLER); |
11 |
*/ |
11 |
ini_set('magic_quotes_runtime', false); |
12 |
@@ -116,7 +118,7 @@ $bootstrap_pkgs = array( // uses URL like http://pear. |
12 |
@@ -88,6 +90,7 @@ if (WEBINSTALLER && isset($_GET['action']) && $_GET['a |
|
|
13 |
|
14 |
// Check if PHP version is sufficient |
15 |
$phpVersion = phpversion(); |
16 |
+/* |
17 |
if (function_exists("version_compare") && version_compare($phpVersion, "4.4",'<')) { |
18 |
die("Sorry! Your PHP version is too old. PEAR and this script requires at |
19 |
least PHP 4.4.0 for stable operation. |
20 |
@@ -109,11 +112,10 @@ version of go-pear, more suited to your PHP version. |
21 |
Thank you for your coopertion and sorry for the inconvenience! |
22 |
"); |
23 |
} |
24 |
- |
25 |
+*/ |
26 |
$gopear_bundle_dir = dirname(__FILE__).'/go-pear-bundle'; |
27 |
|
28 |
$bootstrap_files = array( |
29 |
- 'PEAR5.php' => 'https://raw.github.com/pear/pear-core/master/PEAR5.php', |
30 |
'PEAR.php' => 'https://raw.github.com/pear/pear-core/master/PEAR.php', |
31 |
'Archive/Tar.php' => 'https://raw.github.com/pear/Archive_Tar/master/Archive/Tar.php', |
32 |
'Console/Getopt.php' => 'https://raw.github.com/pear/Console_Getopt/trunk/Console/Getopt.php', |
33 |
@@ -125,7 +127,7 @@ $bootstrap_pkgs = array( // uses URL like http://pear. |
13 |
); |
34 |
); |
14 |
|
35 |
|
15 |
$installer_packages = array( |
36 |
$installer_packages = array( |
Lines 18-33
Link Here
|
18 |
'Structures_Graph-stable', |
39 |
'Structures_Graph-stable', |
19 |
'Archive_Tar-stable', |
40 |
'Archive_Tar-stable', |
20 |
'Console_Getopt-stable', |
41 |
'Console_Getopt-stable', |
21 |
@@ -250,7 +252,7 @@ if (WEBINSTALLER) { |
42 |
@@ -259,7 +261,7 @@ if (WEBINSTALLER) { |
22 |
} |
43 |
} |
23 |
// Anything past this step has something to do with the installation |
44 |
// Anything past this step has something to do with the installation |
24 |
} |
45 |
} |
25 |
- |
46 |
- |
26 |
+/* |
47 |
+/* |
27 |
if (!WEBINSTALLER) { |
48 |
if (!WEBINSTALLER) { |
28 |
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r'); |
49 |
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r'); |
29 |
|
50 |
|
30 |
@@ -294,7 +296,7 @@ If you wish to abort, press Control-C now, or press En |
51 |
@@ -303,7 +305,7 @@ If you wish to abort, press Control-C now, or press En |
31 |
$http_proxy = $tmp; |
52 |
$http_proxy = $tmp; |
32 |
} |
53 |
} |
33 |
} |
54 |
} |
Lines 36-42
Link Here
|
36 |
$origpwd = getcwd(); |
57 |
$origpwd = getcwd(); |
37 |
|
58 |
|
38 |
$config_vars = array_keys($config_desc); |
59 |
$config_vars = array_keys($config_desc); |
39 |
@@ -345,7 +347,7 @@ we strongly recommand to use it. |
60 |
@@ -354,7 +356,7 @@ we strongly recommand to use it. |
40 |
break; |
61 |
break; |
41 |
} |
62 |
} |
42 |
} |
63 |
} |
Lines 45-51
Link Here
|
45 |
while (!WEBINSTALLER) { |
66 |
while (!WEBINSTALLER) { |
46 |
print " |
67 |
print " |
47 |
Below is a suggested file layout for your new PEAR installation. To |
68 |
Below is a suggested file layout for your new PEAR installation. To |
48 |
@@ -428,7 +430,7 @@ If you have a CLI (or CGI) php.exe available, we stron |
69 |
@@ -437,7 +439,7 @@ If you have a CLI (or CGI) php.exe available, we stron |
49 |
} |
70 |
} |
50 |
} |
71 |
} |
51 |
} |
72 |
} |
Lines 54-60
Link Here
|
54 |
#### |
75 |
#### |
55 |
# Installation stuff |
76 |
# Installation stuff |
56 |
#### |
77 |
#### |
57 |
@@ -488,7 +490,7 @@ full write access to this directory and the install di |
78 |
@@ -497,7 +499,7 @@ full write access to this directory and the install di |
58 |
continue; |
79 |
continue; |
59 |
} |
80 |
} |
60 |
|
81 |
|
Lines 63-69
Link Here
|
63 |
if (!@is_dir($dir)) { |
84 |
if (!@is_dir($dir)) { |
64 |
if (!mkdir_p($dir)) { |
85 |
if (!mkdir_p($dir)) { |
65 |
if (!WEBINSTALLER) { |
86 |
if (!WEBINSTALLER) { |
66 |
@@ -561,7 +563,7 @@ if (WEBINSTALLER) { |
87 |
@@ -570,7 +572,7 @@ if (WEBINSTALLER) { |
67 |
ob_start(); |
88 |
ob_start(); |
68 |
} |
89 |
} |
69 |
} |
90 |
} |
Lines 72-78
Link Here
|
72 |
if (!WEBINSTALLER) { |
93 |
if (!WEBINSTALLER) { |
73 |
$msg = "The following PEAR packages are bundled with PHP: " . |
94 |
$msg = "The following PEAR packages are bundled with PHP: " . |
74 |
implode(', ', array_keys($pfc_packages)); |
95 |
implode(', ', array_keys($pfc_packages)); |
75 |
@@ -571,17 +573,19 @@ if (!WEBINSTALLER) { |
96 |
@@ -580,17 +582,17 @@ if (!WEBINSTALLER) { |
76 |
$install_optional_packages = array(); |
97 |
$install_optional_packages = array(); |
77 |
print "\n"; |
98 |
print "\n"; |
78 |
} |
99 |
} |
Lines 82-89
Link Here
|
82 |
# Download |
103 |
# Download |
83 |
#### |
104 |
#### |
84 |
|
105 |
|
85 |
+dl('xml.so'); |
|
|
86 |
+ |
87 |
if (function_exists('set_include_path')) { |
106 |
if (function_exists('set_include_path')) { |
88 |
- set_include_path($ptmp); |
107 |
- set_include_path($ptmp); |
89 |
+ set_include_path($ptmp . PATH_SEPARATOR . "%%BUNDLEDIR%%"); |
108 |
+ set_include_path($ptmp . PATH_SEPARATOR . "%%BUNDLEDIR%%"); |
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. |
115 |
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) { |
116 |
if (WINDOWS) { |
98 |
@dl('php_zlib.dll'); |
117 |
@dl('php_zlib.dll'); |
99 |
@@ -606,18 +610,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). |
118 |
@@ -615,18 +617,19 @@ print "Loading zlib: ".($have_gzip ? 'ok' : 'failed'). |
100 |
if (!$have_gzip) { |
119 |
if (!$have_gzip) { |
101 |
print "Downloading uncompressed packages\n"; |
120 |
print "Downloading uncompressed packages\n"; |
102 |
}; |
121 |
}; |
Lines 118-124
Link Here
|
118 |
} |
137 |
} |
119 |
|
138 |
|
120 |
// gopear_bundle usage |
139 |
// gopear_bundle usage |
121 |
@@ -645,19 +650,21 @@ displayHTMLProgress($progress = 5); |
140 |
@@ -654,19 +657,20 @@ displayHTMLProgress($progress = 5); |
122 |
|
141 |
|
123 |
// Bootstrap needed ? |
142 |
// Bootstrap needed ? |
124 |
$nobootstrap = false; |
143 |
$nobootstrap = false; |
Lines 129-136
Link Here
|
129 |
$nobootstrap &= is_file($php_dir.'/'.$file); |
148 |
$nobootstrap &= is_file($php_dir.'/'.$file); |
130 |
} |
149 |
} |
131 |
} |
150 |
} |
|
|
151 |
- |
132 |
+*/ |
152 |
+*/ |
133 |
|
|
|
134 |
if ($nobootstrap) { |
153 |
if ($nobootstrap) { |
135 |
print('Using previously install ... '); |
154 |
print('Using previously install ... '); |
136 |
if (function_exists('set_include_path')) { |
155 |
if (function_exists('set_include_path')) { |
Lines 142-173
Link Here
|
142 |
} |
161 |
} |
143 |
include_once 'PEAR.php'; |
162 |
include_once 'PEAR.php'; |
144 |
print "ok\n"; |
163 |
print "ok\n"; |
145 |
@@ -691,6 +698,7 @@ displayHTMLProgress($progress = 20); |
164 |
@@ -700,6 +704,7 @@ displayHTMLProgress($progress = 20); |
146 |
|
165 |
|
147 |
// Extract needed ? |
166 |
// Extract needed ? |
148 |
$noextract = false; |
167 |
$noextract = false; |
149 |
+/* |
168 |
+/* |
150 |
if (is_dir($php_dir)) { |
169 |
if (is_dir($php_dir)) { |
151 |
$noextract = @include_once 'PEAR/Registry.php'; |
170 |
$noextract = @include_once 'PEAR/Registry.php'; |
152 |
|
171 |
|
153 |
@@ -701,6 +709,7 @@ if (is_dir($php_dir)) { |
172 |
@@ -710,7 +715,7 @@ if (is_dir($php_dir)) { |
154 |
} |
173 |
} |
155 |
} |
174 |
} |
156 |
} |
175 |
} |
|
|
176 |
- |
157 |
+*/ |
177 |
+*/ |
158 |
|
|
|
159 |
if ($noextract) { |
178 |
if ($noextract) { |
160 |
print('Using previously installed installer ... '); |
179 |
print('Using previously installed installer ... '); |
161 |
@@ -722,7 +731,7 @@ if ($noextract) { |
180 |
print "ok\n"; |
162 |
displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs))); |
181 |
@@ -756,13 +761,8 @@ include_once "PEAR/Config.php"; |
163 |
|
|
|
164 |
$fullpkg = substr($tarball, 0, strrpos($tarball, '.')); |
165 |
- $tar = &new Archive_Tar($tarball, $have_gzip); |
166 |
+ $tar = new Archive_Tar($tarball, $have_gzip); |
167 |
if (!$tar->extractModify($ptmp, $fullpkg)) { |
168 |
bail("Extraction for $fullpkg failed!\n"); |
169 |
} |
170 |
@@ -747,13 +756,8 @@ include_once "PEAR/Config.php"; |
171 |
include_once "PEAR/Command.php"; |
182 |
include_once "PEAR/Command.php"; |
172 |
include_once "PEAR/Registry.php"; |
183 |
include_once "PEAR/Registry.php"; |
173 |
|
184 |
|
Lines 182-188
Link Here
|
182 |
$config->set('preferred_state', 'stable'); |
193 |
$config->set('preferred_state', 'stable'); |
183 |
foreach ($config_vars as $var) { |
194 |
foreach ($config_vars as $var) { |
184 |
if (isset($$var) && $$var != '') { |
195 |
if (isset($$var) && $$var != '') { |
185 |
@@ -765,7 +769,7 @@ $config->set('temp_dir', $temp_dir); |
196 |
@@ -774,7 +774,7 @@ $config->set('temp_dir', $temp_dir); |
186 |
$config->set('http_proxy', $http_proxy); |
197 |
$config->set('http_proxy', $http_proxy); |
187 |
$config->store(); |
198 |
$config->store(); |
188 |
|
199 |
|
Lines 191-197
Link Here
|
191 |
PEAR_Command::setFrontendType('CLI'); |
202 |
PEAR_Command::setFrontendType('CLI'); |
192 |
|
203 |
|
193 |
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently |
204 |
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently |
194 |
@@ -787,6 +791,11 @@ foreach ($to_install as $pkg) { |
205 |
@@ -796,6 +796,11 @@ foreach ($to_install as $pkg) { |
195 |
} else { |
206 |
} else { |
196 |
$options = array('onlyreqdeps' => true); |
207 |
$options = array('onlyreqdeps' => true); |
197 |
} |
208 |
} |
Lines 203-209
Link Here
|
203 |
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) { |
214 |
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) { |
204 |
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n"); |
215 |
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n"); |
205 |
displayHTMLProgress($progress += round(50 / count($to_install))); |
216 |
displayHTMLProgress($progress += round(50 / count($to_install))); |
206 |
@@ -821,7 +830,7 @@ displayHTMLProgress($progress = 99); |
217 |
@@ -830,7 +835,7 @@ displayHTMLProgress($progress = 99); |
207 |
|
218 |
|
208 |
|
219 |
|
209 |
// Base installation finished |
220 |
// Base installation finished |
Lines 212-218
Link Here
|
212 |
ini_restore("include_path"); |
223 |
ini_restore("include_path"); |
213 |
|
224 |
|
214 |
if (!WEBINSTALLER) { |
225 |
if (!WEBINSTALLER) { |
215 |
@@ -980,6 +989,7 @@ if ( WINDOWS ) { |
226 |
@@ -993,6 +998,7 @@ if ( WINDOWS ) { |
216 |
if (WINDOWS && !WEBINSTALLER) { |
227 |
if (WINDOWS && !WEBINSTALLER) { |
217 |
win32CreateRegEnv(); |
228 |
win32CreateRegEnv(); |
218 |
} |
229 |
} |
Lines 220-226
Link Here
|
220 |
// Set of functions following |
231 |
// Set of functions following |
221 |
/** |
232 |
/** |
222 |
* Parse the given dirname |
233 |
* Parse the given dirname |
223 |
@@ -1134,7 +1144,7 @@ function which($program, $dont_search_in = false) |
234 |
@@ -1179,7 +1185,7 @@ function which($program, $dont_search_in = false) |
224 |
if (!strlen($dir)) { |
235 |
if (!strlen($dir)) { |
225 |
continue; |
236 |
continue; |
226 |
} |
237 |
} |
Lines 229-241
Link Here
|
229 |
$dir .= '\\'; |
240 |
$dir .= '\\'; |
230 |
} |
241 |
} |
231 |
$tmp = $dir . $program; |
242 |
$tmp = $dir . $program; |
232 |
@@ -1418,19 +1428,17 @@ function detect_install_dirs($_prefix = null) { |
243 |
@@ -1463,19 +1469,17 @@ function detect_install_dirs($_prefix = null) { |
233 |
} |
244 |
} |
234 |
} else { |
245 |
} else { |
235 |
if ($_prefix === null) { |
246 |
if ($_prefix === null) { |
236 |
- #$prefix = dirname(PHP_BINDIR); |
247 |
- #$prefix = dirname(PHP_BINDIR); |
237 |
- $prefix = dirname(__FILE__); |
248 |
- $prefix = dirname(__FILE__); |
238 |
+ $prefix = '%%PREFIX%%'; |
249 |
+ $prefix = '%%PREFIX%%'; |
239 |
} else { |
250 |
} else { |
240 |
$prefix = $_prefix; |
251 |
$prefix = $_prefix; |
241 |
} |
252 |
} |
Lines 249-260
Link Here
|
249 |
$test_dir = '$php_dir/tests'; |
260 |
$test_dir = '$php_dir/tests'; |
250 |
- $temp_dir = '$prefix/temp'; |
261 |
- $temp_dir = '$prefix/temp'; |
251 |
- |
262 |
- |
252 |
+ $temp_dir = '%%TMPDIR%%'; |
263 |
+ $temp_dir = '%%TMPDIR%%'; |
253 |
+/* |
264 |
+/* |
254 |
// check if the user has installed PHP with PHP or GNU layout |
265 |
// check if the user has installed PHP with PHP or GNU layout |
255 |
if (@is_dir("$prefix/lib/php/.registry")) { |
266 |
if (@is_dir("$prefix/lib/php/.registry")) { |
256 |
$php_dir = '$prefix/lib/php'; |
267 |
$php_dir = '$prefix/lib/php'; |
257 |
@@ -1442,6 +1450,7 @@ function detect_install_dirs($_prefix = null) { |
268 |
@@ -1487,6 +1491,7 @@ function detect_install_dirs($_prefix = null) { |
258 |
} elseif (@is_dir("$prefix/share/php/.registry")) { |
269 |
} elseif (@is_dir("$prefix/share/php/.registry")) { |
259 |
$php_dir = '$prefix/share/php'; |
270 |
$php_dir = '$prefix/share/php'; |
260 |
} |
271 |
} |