diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 99db180d24c..062449c3e71 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 fb12ded5f61..a4f51400fdc 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 58e550992c3..1bf1b76436d 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 a93713f1846..96ac23087f6 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 ee892ba22d0..9949ea14232 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;