]> granicus.if.org Git - php/commitdiff
Remove $_ENV usages
authorPierre Joye <pajoye@php.net>
Sun, 25 Aug 2002 18:21:10 +0000 (18:21 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 25 Aug 2002 18:21:10 +0000 (18:21 +0000)
Remove $env arg in all functions and uses getenv instead
Note only 'USER' env var is used

pear/scripts/pearize.in

index 0a9beec459f3cc39a911409cc007232e39946dea..490b49d1e804e592fd34a02f3e38bbbde27f9ccd 100644 (file)
@@ -1,22 +1,22 @@
 #!@prefix@/bin/php -Cq
 <?php // -*- PHP -*-
-main($argc, $argv, $_ENV);
+main($argc, $argv);
 
 // {{{ main()
 
-function main(&$argc, &$argv, &$env)
+function main(&$argc, &$argv)
 {
        global $debug;
        $debug = false;
-       $file = check_options($argc, $argv, $env);
+       $file = check_options($argc, $argv);
        parse_package_file($file);
-       make_makefile_in($env);
+       make_makefile_in();
 }
 
 // }}}
 // {{{ check_options()
 
-function check_options($argc, $argv, $env)
+function check_options($argc, $argv)
 {
        global $debug;
        array_shift($argv);
@@ -47,7 +47,7 @@ function check_options($argc, $argv, $env)
 // }}}
 // {{{ make_makefile_in()
 
-function make_makefile_in(&$env)
+function make_makefile_in()
 {
        global $libdata, $debug;
        if (sizeof($libdata) > 1) {
@@ -66,7 +66,7 @@ function make_makefile_in(&$env)
                die("Could not create Makefile.in in current directory.\n");
        }
 
-       $who = $env["USER"];
+       $who = getenv("USER");
        $when = gmdate('Y-m-d h:i');
        fwrite($wp, "# This file was generated by `pearize' by $who at $when GMT\n\n");
 
@@ -95,7 +95,7 @@ function parse_package_file($file)
 {
        global $in_file, $curlib, $curelem, $libdata, $cdata;
        global $currinstalldir, $baseinstalldir;
-       
+
        $in_file = false;
        $curlib = '';
        $curelem = '';
@@ -103,12 +103,12 @@ function parse_package_file($file)
        $cdata = array();
        $baseinstalldir = array();
        $currinstalldir = array();
-       
+
        $xp = xml_parser_create();
        xml_set_element_handler($xp, "start_handler", "end_handler");
        xml_set_character_data_handler($xp, "cdata_handler");
        xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, false);
-       
+
        $fp = @fopen($file, "r");
        if (!is_resource($fp)) {
                die("Could not open file `$file'.\n");