cvs: pearweb /public_html go-pear
| From: | Stig Bakken | Date: | Sat, 15 Jun 2002 02:13:04 +0000 |
| Subject: | cvs: pearweb /public_html go-pear | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4629@lists.php.net to get a copy of this message | ||
ssb Fri Jun 14 22:13:04 2002 EDT
Modified files:
/pearweb/public_html go-pear
Log:
* better default Windows settings
Index: pearweb/public_html/go-pear
diff -u pearweb/public_html/go-pear:1.13 pearweb/public_html/go-pear:1.14
--- pearweb/public_html/go-pear:1.13 Fri Jun 14 10:32:18 2002
+++ pearweb/public_html/go-pear Fri Jun 14 22:13:04 2002
@@ -1,5 +1,5 @@
-<?php // -*- PHP -*-
-//; echo; echo "YOU NEED TO RUN THIS SCRIPT WITH PHP NOW!"; echo; echo "Try this:
lynx -source http://pear.php.net/go-pear | php -q";
echo; exit
+<?php //; echo; echo "YOU NEED TO RUN THIS SCRIPT WITH PHP NOW!"; echo; echo "Try
this: lynx -source http://pear.php.net/go-pear | php
-q"; echo; exit
+// -*- PHP -*-
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# +----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
# | Stig Sæther Bakken <stig@php.net> |
# +----------------------------------------------------------------------+
#
-# $Id: go-pear,v 1.13 2002/06/14 14:32:18 ssb Exp $
+# $Id: go-pear,v 1.14 2002/06/15 02:13:04 ssb Exp $
#
# Automatically download all the files needed to run the "pear" command
# (the PEAR package installer)
@@ -74,6 +74,14 @@
");
}
+set_time_limit(0);
+ob_implicit_flush(true);
+ini_set('track_errors', true);
+ini_set('implicit_flush', true);
+ini_set('html_errors', false);
+ini_set('magic_quotes_runtime', false);
+error_reporting(E_ALL & ~E_NOTICE);
+
define('WINDOWS', (substr(PHP_OS, 0, 3) == 'WIN'));
if (WINDOWS) {
@@ -117,12 +125,21 @@
} else {
$http_proxy = '';
}
-$prefix = dirname(PHP_BINDIR);
-$bin_dir = '$prefix/bin';
-$php_dir = '$prefix/share/pear';
-$doc_dir = '$prefix/share/pear/docs';
-$data_dir = '$prefix/share/pear/data';
-$tests_dir = '$prefix/share/pear/tests';
+if (WINDOWS) {
+ $prefix = PHP_BINDIR;
+ $bin_dir = '$prefix';
+ $php_dir = '$prefix\pear';
+ $doc_dir = '$php_dir\docs';
+ $data_dir = '$php_dir\data';
+ $tests_dir = '$php_dir\tests';
+} else {
+ $prefix = dirname(PHP_BINDIR);
+ $bin_dir = '$prefix/bin';
+ $php_dir = '$prefix/share/pear';
+ $doc_dir = '$php_dir/docs';
+ $data_dir = '$php_dir/data';
+ $tests_dir = '$php_dir/tests';
+}
$origpwd = getcwd();
@@ -376,8 +393,11 @@
$fp = @fopen($pear_cmd, "r");
$wp = @fopen($tmpfile, "w");
if ($fp && $wp) {
- $hashbang = rtrim(fgets($fp, 1024)) . "d include_path=$php_dir\n";
- fwrite($wp, $hashbang);
+ $hashbang = rtrim(fgets($fp, 1024));
+ if (!strstr($hashbang, "include_path=")) {
+ $hashbang .= "d include_path=$php_dir";
+ }
+ fwrite($wp, "$hashbang\n");
while ($data = fread($fp, 2048)) {
fwrite($wp, $data);
}