summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2003-08-03 19:32:07 +0000
committerTomas V.V.Cox <cox@php.net>2003-08-03 19:32:07 +0000
commit7d67054891182206d712d5d92d7d05688f17d91b (patch)
treeabb2c94f8a065ba1f85ed89c13d42164e3fee511
parentea12731b4e7e1ac92677d8f62282b2653ce26686 (diff)
downloadphp-git-7d67054891182206d712d5d92d7d05688f17d91b.tar.gz
Added support for spaces in path names (thanks Greg!)
-rw-r--r--pear/PEAR/Common.php17
-rw-r--r--pear/PEAR/Config.php3
-rw-r--r--pear/PEAR/Packager.php4
-rw-r--r--pear/PEAR/Registry.php2
-rw-r--r--pear/PEAR/Remote.php6
5 files changed, 17 insertions, 15 deletions
diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php
index 99db180d24..062449c3e7 100644
--- a/pear/PEAR/Common.php
+++ b/pear/PEAR/Common.php
@@ -156,7 +156,7 @@ class PEAR_Common extends PEAR
$tempfiles =& $GLOBALS['_PEAR_Common_tempfiles'];
while ($file = array_shift($tempfiles)) {
if (@is_dir($file)) {
- System::rm("-rf $file");
+ System::rm(array('-rf', $file));
} elseif (file_exists($file)) {
unlink($file);
}
@@ -198,7 +198,7 @@ class PEAR_Common extends PEAR
function mkDirHier($dir)
{
$this->log(2, "+ create dir $dir");
- return System::mkDir("-p $dir");
+ return System::mkDir(array('-p', $dir));
}
// }}}
@@ -242,11 +242,12 @@ class PEAR_Common extends PEAR
function mkTempDir($tmpdir = '')
{
if ($tmpdir) {
- $topt = "-t $tmpdir ";
+ $topt = array('-t', $tmpdir);
} else {
- $topt = '';
+ $topt = array();
}
- if (!$tmpdir = System::mktemp($topt . '-d pear')) {
+ $topt = array_merge($topt, array('-d', 'pear'));
+ if (!$tmpdir = System::mktemp($topt)) {
return false;
}
$this->addTempFile($tmpdir);
@@ -1155,7 +1156,7 @@ class PEAR_Common extends PEAR
* Build a "provides" array from data returned by
* analyzeSourceCode(). The format of the built array is like
* this:
- *
+ *
* array(
* 'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'),
* ...
@@ -1168,7 +1169,7 @@ class PEAR_Common extends PEAR
* @return void
*
* @access public
- *
+ *
*/
function buildProvidesArray($srcinfo)
{
@@ -1597,7 +1598,7 @@ class PEAR_Common extends PEAR
$errno, $errstr));
}
return PEAR::raiseError("Connection to `$host:$port' failed: $errstr", $errno);
- }
+ }
$request = "GET $path HTTP/1.0\r\n";
}
$request .= "Host: $host:$port\r\n".
diff --git a/pear/PEAR/Config.php b/pear/PEAR/Config.php
index fb12ded5f6..a4f51400fd 100644
--- a/pear/PEAR/Config.php
+++ b/pear/PEAR/Config.php
@@ -577,7 +577,8 @@ class PEAR_Config extends PEAR
}
$data = ($data === null) ? $this->configuration[$layer] : $data;
$this->_encodeOutput($data);
- if (!@System::mkDir("-p " . dirname($file))) {
+ $opt = array('-p', dirname($file));
+ if (!@System::mkDir($opt)) {
return $this->raiseError("could not create directory: " . dirname($file));
}
if (@is_file($file) && !@is_writeable($file)) {
diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php
index 58e550992c..1bf1b76436 100644
--- a/pear/PEAR/Packager.php
+++ b/pear/PEAR/Packager.php
@@ -116,7 +116,7 @@ class PEAR_Packager extends PEAR_Common
chdir($oldcwd);
return $this->raiseError($new_xml);
}
- if (!($tmpdir = System::mktemp('-t '.getcwd().' -d'))) {
+ if (!($tmpdir = System::mktemp(array('-t', getcwd(), '-d')))) {
chdir($oldcwd);
return $this->raiseError("PEAR_Packager: mktemp failed");
}
@@ -135,7 +135,7 @@ class PEAR_Packager extends PEAR_Common
$tar =& new Archive_Tar($dest_package, $compress);
$tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors
// ----- Creates with the package.xml file
- $ok = $tar->createModify($newpkgfile, '', $tmpdir);
+ $ok = $tar->createModify(array($newpkgfile), '', $tmpdir);
if (PEAR::isError($ok)) {
chdir($oldcwd);
return $this->raiseError($ok);
diff --git a/pear/PEAR/Registry.php b/pear/PEAR/Registry.php
index a93713f184..96ac23087f 100644
--- a/pear/PEAR/Registry.php
+++ b/pear/PEAR/Registry.php
@@ -146,7 +146,7 @@ class PEAR_Registry extends PEAR
function _assertStateDir()
{
if (!@is_dir($this->statedir)) {
- if (!System::mkdir("-p {$this->statedir}")) {
+ if (!System::mkdir(array('-p', $this->statedir))) {
return $this->raiseError("could not create directory '{$this->statedir}'");
}
}
diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php
index ee892ba22d..9949ea1423 100644
--- a/pear/PEAR/Remote.php
+++ b/pear/PEAR/Remote.php
@@ -56,14 +56,14 @@ class PEAR_Remote extends PEAR
$id = md5(serialize($args));
$cachedir = $this->config->get('cache_dir');
if (!file_exists($cachedir)) {
- System::mkdir('-p '.$cachedir);
+ System::mkdir(array('-p', $cachedir));
}
$filename = $cachedir . DIRECTORY_SEPARATOR . 'xmlrpc_cache_' . $id;
if (!file_exists($filename)) {
return null;
};
- $fp = fopen($filename, "rb");
+ $fp = fopen($filename, 'rb');
if ($fp === null) {
return null;
}
@@ -86,7 +86,7 @@ class PEAR_Remote extends PEAR
$id = md5(serialize($args));
$cachedir = $this->config->get('cache_dir');
if (!file_exists($cachedir)) {
- System::mkdir('-p '.$cachedir);
+ System::mkdir(array('-p', $cachedir));
}
$filename = $cachedir.'/xmlrpc_cache_'.$id;