svn: /pear/pear-core/trunk/PEAR/ Start/CLI.php Start.php
| From: | Helgi Þormar Þorbjörnsson | Date: | Mon, 26 Apr 2010 22:56:43 +0000 |
| Subject: | svn: /pear/pear-core/trunk/PEAR/ Start/CLI.php Start.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-9380@lists.php.net to get a copy of this message | ||
dufuz Mon, 26 Apr 2010 22:56:43 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298621
Log:
Proper slashes for windows in the start cli client and a few cosmetics
Changed paths:
U pear/pear-core/trunk/PEAR/Start/CLI.php
U pear/pear-core/trunk/PEAR/Start.php
Modified: pear/pear-core/trunk/PEAR/Start/CLI.php
===================================================================
--- pear/pear-core/trunk/PEAR/Start/CLI.php 2010-04-26 21:39:56 UTC (rev 298620)
+++ pear/pear-core/trunk/PEAR/Start/CLI.php 2010-04-26 22:56:43 UTC (rev 298621)
@@ -126,6 +126,7 @@
$current = $this->$var;
if (WIN32GUI && $var != 'pear_conf'){
$tmp = $this->win32BrowseForFolder("Choose a Folder for $desc
[$current] :");
+ $tmp.= '\\';
} else {
print "(Use \$prefix as a shortcut for '$this->prefix', etc.)
$desc [$current] : ";
@@ -599,7 +600,7 @@
echo "
* WINDOWS ENVIRONMENT VARIABLES *
-For convenience, a REG file is available under $this->prefix\\PEAR_ENV.reg .
+For convenience, a REG file is available under $this->prefixPEAR_ENV.reg .
This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry.
Modified: pear/pear-core/trunk/PEAR/Start.php
===================================================================
--- pear/pear-core/trunk/PEAR/Start.php 2010-04-26 21:39:56 UTC (rev 298620)
+++ pear/pear-core/trunk/PEAR/Start.php 2010-04-26 22:56:43 UTC (rev 298621)
@@ -67,9 +67,11 @@
'test_dir' => 'Tests directory',
'pear_conf' => 'Name of configuration file',
);
+
var $localInstall;
var $PEARConfig;
var $tarball = array();
+
function PEAR_Start()
{
parent::PEAR();
@@ -173,6 +175,7 @@
if (is_array($_ENV) && isset($_ENV[$var])) {
return $_ENV[$var];
}
+
return getenv($var);
}
@@ -188,6 +191,7 @@
return PEAR::raiseError("while locating packages to install: opendir('"
.
dirname(__FILE__) . "/go-pear-tarballs') failed");
}
+
$potentials = array();
while (false !== ($entry = readdir($dp))) {
if ($entry{0} == '.' || !in_array(substr($entry, -4), array('.tar',
'.tgz'))) {
@@ -195,6 +199,7 @@
}
$potentials[] = $entry;
}
+
closedir($dp);
$notfound = array();
foreach ($this->corePackages as $package) {
@@ -206,12 +211,15 @@
continue 2;
}
}
+
$notfound[] = $package;
}
+
if (count($notfound)) {
return PEAR::raiseError("No tarballs found for core packages: " .
implode(', ', $notfound));
}
+
$this->tarball = array_merge($this->tarball, $potentials);
}
@@ -223,8 +231,8 @@
if (!$res) {
return PEAR::raiseError('mkdir ' . $this->prefix . '/tmp ...
failed');
}
+
$_temp = tempnam($this->prefix . '/tmp', 'gope');
-
System::rm(array('-rf', $_temp));
System::mkdir(array('-p','-m', '0700', $_temp));
$this->ptmp = $this->prefix . '/tmp';
@@ -259,20 +267,24 @@
} else {
exec('"' . $this->php_bin . '/php" -v', $res);
}
+
if (is_array($res)) {
if (isset($res[0]) && strpos($res[0],"(cli)")) {
return 'cli';
}
+
if (isset($res[0]) && strpos($res[0],"cgi")) {
return 'cgi';
}
+
if (isset($res[0]) && strpos($res[0],"cgi-fcgi")) {
return 'cgi';
- } else {
- return 'unknown';
}
+
+ return 'unknown';
}
}
+
return 'unknown';
}