cvs: pear /PEAR_Info Info.php

From: Date: Thu, 05 Jul 2007 09:21:14 +0000
Subject: cvs: pear /PEAR_Info Info.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-47865@lists.php.net to get a copy of this message
farell Thu Jul 5 09:21:14 2007 UTC Modified files: /pear/PEAR_Info Info.php Log: fixes for bug #11524 Fatal error with $pear_dir parameter http://cvs.php.net/viewvc.cgi/pear/PEAR_Info/Info.php?r1=1.40&r2=1.41&diff_format=u Index: pear/PEAR_Info/Info.php diff -u pear/PEAR_Info/Info.php:1.40 pear/PEAR_Info/Info.php:1.41 --- pear/PEAR_Info/Info.php:1.40 Tue Jul 3 20:37:22 2007 +++ pear/PEAR_Info/Info.php Thu Jul 5 09:21:14 2007 @@ -15,7 +15,7 @@ * @author Davey Shafik <davey@pixelated-dreams.com> * @author Laurent Laville <pear@laurent-laville.org> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Info.php,v 1.40 2007/07/03 20:37:22 fa Exp $ + * @version CVS: $Id: Info.php,v 1.41 2007/07/05 09:21:14 farell Exp $ * @since File available since Release 1.0.1 * @link http://pear.php.net/package/PEAR_Info */ @@ -184,12 +184,36 @@ $this->options = array_merge($this->options, $options); } - $this->config =& PEAR_Config::singleton($user_file, $system_file); - // to keep compatibility with version less or equal than 1.6.1 if (!empty($pear_dir) && empty($user_file) && empty($system_file)) { - $this->config->set('php_dir', $pear_dir); + // try to find a PEAR user-defined config file into $pear_dir + $user_file = $pear_dir . DIRECTORY_SEPARATOR; + if (OS_WINDOWS) { + $user_file .= 'pear.ini'; + } else { + $user_file .= '.pearrc'; + } + if (!file_exists($user_file)) { + // try to find a PEAR system-wide config file into $pear_dir + $system_file = $pear_dir . DIRECTORY_SEPARATOR; + if (OS_WINDOWS) { + $system_file .= 'pearsys.ini'; + } else { + $system_file .= 'pear.conf'; + } + + if (!file_exists($system_file)) { + trigger_error("No PEAR configuration files (" + . basename($user_file) . " or ". basename($system_file) + . ") found into '$pear_dir' directory", E_USER_ERROR); + exit(); + } + $user_file = ''; + } } + + $this->config =& PEAR_Config::singleton($user_file, $system_file); + // to keep compatibility with version less or equal than 1.6.1 if (defined('PEAR_INFO_PROXY')) { $this->config->set('http_proxy', PEAR_INFO_PROXY); @@ -1156,4 +1180,4 @@ PEAR_Info::pearImage(); exit(); } -?> +?> \ No newline at end of file

« previous php.pear.cvs (#47865) next »