HOR-3474
update update udpate udpate
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once "HTTP/WebDAV/Server.php";
|
require_once "HTTP/WebDAV/Server.php";
|
||||||
require_once "System.php";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filesystem access using WebDAV
|
* Filesystem access using WebDAV
|
||||||
@@ -479,7 +478,7 @@
|
|||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
$query = "DELETE FROM properties WHERE path LIKE '".$this->_slashify($options["path"])."%'";
|
$query = "DELETE FROM properties WHERE path LIKE '".$this->_slashify($options["path"])."%'";
|
||||||
mysql_query($query);
|
mysql_query($query);
|
||||||
System::rm("-rf $path");
|
PearSystem::rm("-rf $path");
|
||||||
} else {
|
} else {
|
||||||
unlink ($path);
|
unlink ($path);
|
||||||
}
|
}
|
||||||
@@ -577,7 +576,7 @@
|
|||||||
mysql_query($query);
|
mysql_query($query);
|
||||||
} else {
|
} else {
|
||||||
if (is_dir($source)) {
|
if (is_dir($source)) {
|
||||||
$files = System::find($source);
|
$files = PearSystem::find($source);
|
||||||
$files = array_reverse($files);
|
$files = array_reverse($files);
|
||||||
} else {
|
} else {
|
||||||
$files = array($source);
|
$files = array($source);
|
||||||
|
|||||||
4
thirdparty/pear/OS/Guess.php
vendored
4
thirdparty/pear/OS/Guess.php
vendored
@@ -159,8 +159,8 @@ class OS_Guess
|
|||||||
{
|
{
|
||||||
// Use glibc's <features.h> header file to
|
// Use glibc's <features.h> header file to
|
||||||
// get major and minor version number:
|
// get major and minor version number:
|
||||||
include_once "System.php";
|
include_once "PearSystem.php";
|
||||||
$tmpfile = System::mktemp("glibctest");
|
$tmpfile = PearSystem::mktemp("glibctest");
|
||||||
$fp = fopen($tmpfile, "w");
|
$fp = fopen($tmpfile, "w");
|
||||||
fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n");
|
fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|||||||
4
thirdparty/pear/PEAR/Builder.php
vendored
4
thirdparty/pear/PEAR/Builder.php
vendored
@@ -245,9 +245,9 @@ class PEAR_Builder extends PEAR_Common
|
|||||||
$build_dir = "$build_basedir/$info[package]-$info[version]";
|
$build_dir = "$build_basedir/$info[package]-$info[version]";
|
||||||
$this->log(1, "building in $build_dir");
|
$this->log(1, "building in $build_dir");
|
||||||
if (is_dir($build_dir)) {
|
if (is_dir($build_dir)) {
|
||||||
System::rm("-rf $build_dir");
|
PearSystem::rm("-rf $build_dir");
|
||||||
}
|
}
|
||||||
if (!System::mkDir("-p $build_dir")) {
|
if (!PearSystem::mkDir("-p $build_dir")) {
|
||||||
return $this->raiseError("could not create build dir: $build_dir");
|
return $this->raiseError("could not create build dir: $build_dir");
|
||||||
}
|
}
|
||||||
$this->addTempFile($build_dir);
|
$this->addTempFile($build_dir);
|
||||||
|
|||||||
15
thirdparty/pear/PEAR/Command/Package.php
vendored
15
thirdparty/pear/PEAR/Command/Package.php
vendored
@@ -531,9 +531,9 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
|||||||
return $this->raiseError($info);
|
return $this->raiseError($info);
|
||||||
}
|
}
|
||||||
include_once "Archive/Tar.php";
|
include_once "Archive/Tar.php";
|
||||||
include_once "System.php";
|
include_once "PearSystem.php";
|
||||||
$tar = new Archive_Tar($params[0]);
|
$tar = new Archive_Tar($params[0]);
|
||||||
$tmpdir = System::mktemp('-d pearsign');
|
$tmpdir = PearSystem::mktemp('-d pearsign');
|
||||||
if (!$tar->extractList('package.xml package.sig', $tmpdir)) {
|
if (!$tar->extractList('package.xml package.sig', $tmpdir)) {
|
||||||
return $this->raiseError("failed to extract tar file");
|
return $this->raiseError("failed to extract tar file");
|
||||||
}
|
}
|
||||||
@@ -569,10 +569,10 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
|||||||
}
|
}
|
||||||
include_once "Archive/Tar.php";
|
include_once "Archive/Tar.php";
|
||||||
include_once "PEAR/Installer.php";
|
include_once "PEAR/Installer.php";
|
||||||
include_once "System.php";
|
include_once "PearSystem.php";
|
||||||
$tar = new Archive_Tar($params[0]);
|
$tar = new Archive_Tar($params[0]);
|
||||||
$tmpdir = System::mktemp('-d pear2rpm');
|
$tmpdir = PearSystem::mktemp('-d pear2rpm');
|
||||||
$instroot = System::mktemp('-d pear2rpm');
|
$instroot = PearSystem::mktemp('-d pear2rpm');
|
||||||
$tmp = $this->config->get('verbose');
|
$tmp = $this->config->get('verbose');
|
||||||
$this->config->set('verbose', 0);
|
$this->config->set('verbose', 0);
|
||||||
$installer = new PEAR_Installer($this->ui);
|
$installer = new PEAR_Installer($this->ui);
|
||||||
@@ -592,10 +592,7 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
|||||||
if (!file_exists("$tmpdir/package.xml")) {
|
if (!file_exists("$tmpdir/package.xml")) {
|
||||||
return $this->raiseError("no package.xml found in $params[0]");
|
return $this->raiseError("no package.xml found in $params[0]");
|
||||||
}
|
}
|
||||||
// System::mkdir("-p $instroot$info[rpm_xml_dir]");
|
|
||||||
// if (!@copy("$tmpdir/package.xml", "$instroot$info[rpm_xml_dir]/$info[package].xml")) {
|
|
||||||
// return $this->raiseError("could not copy package.xml file: $php_errormsg");
|
|
||||||
// }
|
|
||||||
if (isset($options['spec-template'])) {
|
if (isset($options['spec-template'])) {
|
||||||
$spec_template = $options['spec-template'];
|
$spec_template = $options['spec-template'];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
11
thirdparty/pear/PEAR/Common.php
vendored
11
thirdparty/pear/PEAR/Common.php
vendored
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
require_once 'PEAR.php';
|
require_once 'PEAR.php';
|
||||||
require_once 'Archive/Tar.php';
|
require_once 'Archive/Tar.php';
|
||||||
require_once 'System.php';
|
|
||||||
require_once 'PEAR/Config.php';
|
require_once 'PEAR/Config.php';
|
||||||
|
|
||||||
// {{{ constants and globals
|
// {{{ constants and globals
|
||||||
@@ -156,7 +155,7 @@ class PEAR_Common extends PEAR
|
|||||||
$tempfiles =& $GLOBALS['_PEAR_Common_tempfiles'];
|
$tempfiles =& $GLOBALS['_PEAR_Common_tempfiles'];
|
||||||
while ($file = array_shift($tempfiles)) {
|
while ($file = array_shift($tempfiles)) {
|
||||||
if (@is_dir($file)) {
|
if (@is_dir($file)) {
|
||||||
System::rm("-rf $file");
|
PearSystem::rm("-rf $file");
|
||||||
} elseif (file_exists($file)) {
|
} elseif (file_exists($file)) {
|
||||||
unlink($file);
|
unlink($file);
|
||||||
}
|
}
|
||||||
@@ -186,7 +185,7 @@ class PEAR_Common extends PEAR
|
|||||||
// {{{ mkDirHier()
|
// {{{ mkDirHier()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper to System::mkDir(), creates a directory as well as
|
* Wrapper to PearSystem::mkDir(), creates a directory as well as
|
||||||
* any necessary parent directories.
|
* any necessary parent directories.
|
||||||
*
|
*
|
||||||
* @param string $dir directory name
|
* @param string $dir directory name
|
||||||
@@ -198,7 +197,7 @@ class PEAR_Common extends PEAR
|
|||||||
function mkDirHier($dir)
|
function mkDirHier($dir)
|
||||||
{
|
{
|
||||||
$this->log(2, "+ create dir $dir");
|
$this->log(2, "+ create dir $dir");
|
||||||
return System::mkDir("-p $dir");
|
return PearSystem::mkDir("-p $dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
@@ -246,7 +245,7 @@ class PEAR_Common extends PEAR
|
|||||||
} else {
|
} else {
|
||||||
$topt = '';
|
$topt = '';
|
||||||
}
|
}
|
||||||
if (!$tmpdir = System::mktemp($topt . '-d pear')) {
|
if (!$tmpdir = PearSystem::mktemp($topt . '-d pear')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->addTempFile($tmpdir);
|
$this->addTempFile($tmpdir);
|
||||||
@@ -686,7 +685,7 @@ class PEAR_Common extends PEAR
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tmpdir = System::mkTemp('-d pear');
|
$tmpdir = PearSystem::mkTemp('-d pear');
|
||||||
$this->addTempFile($tmpdir);
|
$this->addTempFile($tmpdir);
|
||||||
if (!$xml || !$tar->extractList($xml, $tmpdir)) {
|
if (!$xml || !$tar->extractList($xml, $tmpdir)) {
|
||||||
return $this->raiseError('could not extract the package.xml file');
|
return $this->raiseError('could not extract the package.xml file');
|
||||||
|
|||||||
7
thirdparty/pear/PEAR/Config.php
vendored
7
thirdparty/pear/PEAR/Config.php
vendored
@@ -19,7 +19,6 @@
|
|||||||
// $Id: Config.php,v 1.43 2003/03/18 12:06:06 ssb Exp $
|
// $Id: Config.php,v 1.43 2003/03/18 12:06:06 ssb Exp $
|
||||||
|
|
||||||
require_once 'PEAR.php';
|
require_once 'PEAR.php';
|
||||||
require_once 'System.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Last created PEAR_Config instance.
|
* Last created PEAR_Config instance.
|
||||||
@@ -112,7 +111,7 @@ if (getenv('PHP_PEAR_CACHE_DIR')) {
|
|||||||
define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR'));
|
define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR'));
|
||||||
} else {
|
} else {
|
||||||
define('PEAR_CONFIG_DEFAULT_CACHE_DIR',
|
define('PEAR_CONFIG_DEFAULT_CACHE_DIR',
|
||||||
System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
|
PearSystem::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
|
||||||
DIRECTORY_SEPARATOR . 'cache');
|
DIRECTORY_SEPARATOR . 'cache');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +163,7 @@ if (getenv('PHP_PEAR_SIG_BIN')) {
|
|||||||
define('PEAR_CONFIG_DEFAULT_SIG_BIN', getenv('PHP_PEAR_SIG_BIN'));
|
define('PEAR_CONFIG_DEFAULT_SIG_BIN', getenv('PHP_PEAR_SIG_BIN'));
|
||||||
} else {
|
} else {
|
||||||
define('PEAR_CONFIG_DEFAULT_SIG_BIN',
|
define('PEAR_CONFIG_DEFAULT_SIG_BIN',
|
||||||
System::which(
|
PearSystem::which(
|
||||||
'gpg', OS_WINDOWS ? 'c:\gnupg\gpg.exe' : '/usr/local/bin/gpg'));
|
'gpg', OS_WINDOWS ? 'c:\gnupg\gpg.exe' : '/usr/local/bin/gpg'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +563,7 @@ class PEAR_Config extends PEAR
|
|||||||
}
|
}
|
||||||
$data = $this->configuration[$layer];
|
$data = $this->configuration[$layer];
|
||||||
$this->_encodeOutput($data);
|
$this->_encodeOutput($data);
|
||||||
if (!@System::mkDir("-p " . dirname($file))) {
|
if (!@PearSystem::mkDir("-p " . dirname($file))) {
|
||||||
return $this->raiseError("could not create directory: " . dirname($file));
|
return $this->raiseError("could not create directory: " . dirname($file));
|
||||||
}
|
}
|
||||||
if (@is_file($file) && !@is_writeable($file)) {
|
if (@is_file($file) && !@is_writeable($file)) {
|
||||||
|
|||||||
5
thirdparty/pear/PEAR/Installer.php
vendored
5
thirdparty/pear/PEAR/Installer.php
vendored
@@ -22,7 +22,6 @@
|
|||||||
require_once 'PEAR/Common.php';
|
require_once 'PEAR/Common.php';
|
||||||
require_once 'PEAR/Registry.php';
|
require_once 'PEAR/Registry.php';
|
||||||
require_once 'PEAR/Dependency.php';
|
require_once 'PEAR/Dependency.php';
|
||||||
require_once 'System.php';
|
|
||||||
|
|
||||||
define('PEAR_INSTALLER_OK', 1);
|
define('PEAR_INSTALLER_OK', 1);
|
||||||
define('PEAR_INSTALLER_FAILED', 0);
|
define('PEAR_INSTALLER_FAILED', 0);
|
||||||
@@ -534,7 +533,7 @@ class PEAR_Installer extends PEAR_Common
|
|||||||
if ($need_download) {
|
if ($need_download) {
|
||||||
$downloaddir = $this->config->get('download_dir');
|
$downloaddir = $this->config->get('download_dir');
|
||||||
if (empty($downloaddir)) {
|
if (empty($downloaddir)) {
|
||||||
if (PEAR::isError($downloaddir = System::mktemp('-d'))) {
|
if (PEAR::isError($downloaddir = PearSystem::mktemp('-d'))) {
|
||||||
return $downloaddir;
|
return $downloaddir;
|
||||||
}
|
}
|
||||||
$this->log(2, '+ tmp dir created at ' . $downloaddir);
|
$this->log(2, '+ tmp dir created at ' . $downloaddir);
|
||||||
@@ -559,7 +558,7 @@ class PEAR_Installer extends PEAR_Common
|
|||||||
chdir($oldcwd);
|
chdir($oldcwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PEAR::isError($tmpdir = System::mktemp('-d'))) {
|
if (PEAR::isError($tmpdir = PearSystem::mktemp('-d'))) {
|
||||||
return $tmpdir;
|
return $tmpdir;
|
||||||
}
|
}
|
||||||
$this->log(2, '+ tmp dir created at ' . $tmpdir);
|
$this->log(2, '+ tmp dir created at ' . $tmpdir);
|
||||||
|
|||||||
3
thirdparty/pear/PEAR/Packager.php
vendored
3
thirdparty/pear/PEAR/Packager.php
vendored
@@ -20,7 +20,6 @@
|
|||||||
// $Id: Packager.php,v 1.46 2003/03/18 12:06:06 ssb Exp $
|
// $Id: Packager.php,v 1.46 2003/03/18 12:06:06 ssb Exp $
|
||||||
|
|
||||||
require_once 'PEAR/Common.php';
|
require_once 'PEAR/Common.php';
|
||||||
require_once 'System.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Administration class used to make a PEAR release tarball.
|
* Administration class used to make a PEAR release tarball.
|
||||||
@@ -116,7 +115,7 @@ class PEAR_Packager extends PEAR_Common
|
|||||||
chdir($oldcwd);
|
chdir($oldcwd);
|
||||||
return $this->raiseError($new_xml);
|
return $this->raiseError($new_xml);
|
||||||
}
|
}
|
||||||
if (!($tmpdir = System::mktemp('-t '.getcwd().' -d'))) {
|
if (!($tmpdir = PearSystem::mktemp('-t '.getcwd().' -d'))) {
|
||||||
chdir($oldcwd);
|
chdir($oldcwd);
|
||||||
return $this->raiseError("PEAR_Packager: mktemp failed");
|
return $this->raiseError("PEAR_Packager: mktemp failed");
|
||||||
}
|
}
|
||||||
|
|||||||
1
thirdparty/pear/PEAR/Registry.php
vendored
1
thirdparty/pear/PEAR/Registry.php
vendored
@@ -26,7 +26,6 @@ TODO:
|
|||||||
- Add application level lock (avoid change the registry from the cmdline
|
- Add application level lock (avoid change the registry from the cmdline
|
||||||
while using the GTK interface, for ex.)
|
while using the GTK interface, for ex.)
|
||||||
*/
|
*/
|
||||||
require_once "System.php";
|
|
||||||
require_once "PEAR.php";
|
require_once "PEAR.php";
|
||||||
|
|
||||||
define('PEAR_REGISTRY_ERROR_LOCK', -2);
|
define('PEAR_REGISTRY_ERROR_LOCK', -2);
|
||||||
|
|||||||
4
thirdparty/pear/PEAR/Remote.php
vendored
4
thirdparty/pear/PEAR/Remote.php
vendored
@@ -56,7 +56,7 @@ class PEAR_Remote extends PEAR
|
|||||||
$id = $this->encryptOld(serialize($args));
|
$id = $this->encryptOld(serialize($args));
|
||||||
$cachedir = $this->config->get('cache_dir');
|
$cachedir = $this->config->get('cache_dir');
|
||||||
if (!file_exists($cachedir)) {
|
if (!file_exists($cachedir)) {
|
||||||
System::mkdir('-p '.$cachedir);
|
PearSystem::mkdir('-p '.$cachedir);
|
||||||
}
|
}
|
||||||
$filename = $cachedir . DIRECTORY_SEPARATOR . 'xmlrpc_cache_' . $id;
|
$filename = $cachedir . DIRECTORY_SEPARATOR . 'xmlrpc_cache_' . $id;
|
||||||
if (!file_exists($filename)) {
|
if (!file_exists($filename)) {
|
||||||
@@ -86,7 +86,7 @@ class PEAR_Remote extends PEAR
|
|||||||
$id = $this->encryptOld(serialize($args));
|
$id = $this->encryptOld(serialize($args));
|
||||||
$cachedir = $this->config->get('cache_dir');
|
$cachedir = $this->config->get('cache_dir');
|
||||||
if (!file_exists($cachedir)) {
|
if (!file_exists($cachedir)) {
|
||||||
System::mkdir('-p '.$cachedir);
|
PearSystem::mkdir('-p '.$cachedir);
|
||||||
}
|
}
|
||||||
$filename = $cachedir.'/xmlrpc_cache_'.$id;
|
$filename = $cachedir.'/xmlrpc_cache_'.$id;
|
||||||
|
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ $GLOBALS['_System_temp_files'] = array();
|
|||||||
* http://pear.php.net/manual/
|
* http://pear.php.net/manual/
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
* if (!@System::rm('-r file1 dir1')) {
|
* if (!@PearSystem::rm('-r file1 dir1')) {
|
||||||
* print "could not delete file1 or dir1";
|
* print "could not delete file1 or dir1";
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* In case you need to to pass file names with spaces,
|
* In case you need to to pass file names with spaces,
|
||||||
* pass the params as an array:
|
* pass the params as an array:
|
||||||
*
|
*
|
||||||
* System::rm(array('-r', $file1, $dir1));
|
* PearSystem::rm(array('-r', $file1, $dir1));
|
||||||
*
|
*
|
||||||
* @package System
|
* @package System
|
||||||
* @author Tomas V.V.Cox <cox@idecnet.com>
|
* @author Tomas V.V.Cox <cox@idecnet.com>
|
||||||
@@ -52,7 +52,7 @@ $GLOBALS['_System_temp_files'] = array();
|
|||||||
* @access public
|
* @access public
|
||||||
* @see http://pear.php.net/manual/
|
* @see http://pear.php.net/manual/
|
||||||
*/
|
*/
|
||||||
class System
|
class PearSystem
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* returns the commandline arguments of a function
|
* returns the commandline arguments of a function
|
||||||
@@ -73,7 +73,7 @@ class System
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Output errors with PHP trigger_error(). You can silence the errors
|
* Output errors with PHP trigger_error(). You can silence the errors
|
||||||
* with prefixing a "@" sign to the function call: @System::mkdir(..);
|
* with prefixing a "@" sign to the function call: @PearSystem::mkdir(..);
|
||||||
*
|
*
|
||||||
* @param mixed $error a PEAR error or a string with the error message
|
* @param mixed $error a PEAR error or a string with the error message
|
||||||
* @return bool false
|
* @return bool false
|
||||||
@@ -91,7 +91,7 @@ class System
|
|||||||
/**
|
/**
|
||||||
* Creates a nested array representing the structure of a directory
|
* Creates a nested array representing the structure of a directory
|
||||||
*
|
*
|
||||||
* System::_dirToStruct('dir1', 0) =>
|
* PearSystem::_dirToStruct('dir1', 0) =>
|
||||||
* Array
|
* Array
|
||||||
* (
|
* (
|
||||||
* [dirs] => Array
|
* [dirs] => Array
|
||||||
@@ -116,7 +116,7 @@ class System
|
|||||||
{
|
{
|
||||||
$struct = array('dirs' => array(), 'files' => array());
|
$struct = array('dirs' => array(), 'files' => array());
|
||||||
if (($dir = @opendir($sPath)) === false) {
|
if (($dir = @opendir($sPath)) === false) {
|
||||||
System::raiseError("Could not open dir $sPath");
|
PearSystem::raiseError("Could not open dir $sPath");
|
||||||
return $struct; // XXX could not open error
|
return $struct; // XXX could not open error
|
||||||
}
|
}
|
||||||
$struct['dirs'][] = $sPath; // XXX don't add if '.' or '..' ?
|
$struct['dirs'][] = $sPath; // XXX don't add if '.' or '..' ?
|
||||||
@@ -132,7 +132,7 @@ class System
|
|||||||
foreach($list as $val) {
|
foreach($list as $val) {
|
||||||
$path = $sPath . DIRECTORY_SEPARATOR . $val;
|
$path = $sPath . DIRECTORY_SEPARATOR . $val;
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
$tmp = System::_dirToStruct($path, $maxinst, $aktinst+1);
|
$tmp = PearSystem::_dirToStruct($path, $maxinst, $aktinst+1);
|
||||||
$struct = array_merge_recursive($tmp, $struct);
|
$struct = array_merge_recursive($tmp, $struct);
|
||||||
} else {
|
} else {
|
||||||
$struct['files'][] = $path;
|
$struct['files'][] = $path;
|
||||||
@@ -147,7 +147,7 @@ class System
|
|||||||
*
|
*
|
||||||
* @param array $files Array listing files and dirs
|
* @param array $files Array listing files and dirs
|
||||||
* @return array
|
* @return array
|
||||||
* @see System::_dirToStruct()
|
* @see PearSystem::_dirToStruct()
|
||||||
*/
|
*/
|
||||||
function _multipleToStruct($files)
|
function _multipleToStruct($files)
|
||||||
{
|
{
|
||||||
@@ -155,7 +155,7 @@ class System
|
|||||||
settype($files, 'array');
|
settype($files, 'array');
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if (is_dir($file)) {
|
if (is_dir($file)) {
|
||||||
$tmp = System::_dirToStruct($file, 0);
|
$tmp = PearSystem::_dirToStruct($file, 0);
|
||||||
$struct = array_merge_recursive($tmp, $struct);
|
$struct = array_merge_recursive($tmp, $struct);
|
||||||
} else {
|
} else {
|
||||||
$struct['files'][] = $file;
|
$struct['files'][] = $file;
|
||||||
@@ -174,9 +174,9 @@ class System
|
|||||||
*/
|
*/
|
||||||
function rm($args)
|
function rm($args)
|
||||||
{
|
{
|
||||||
$opts = System::_parseArgs($args, 'rf'); // "f" do nothing but like it :-)
|
$opts = PearSystem::_parseArgs($args, 'rf'); // "f" do nothing but like it :-)
|
||||||
if (PEAR::isError($opts)) {
|
if (PEAR::isError($opts)) {
|
||||||
return System::raiseError($opts);
|
return PearSystem::raiseError($opts);
|
||||||
}
|
}
|
||||||
foreach($opts[0] as $opt) {
|
foreach($opts[0] as $opt) {
|
||||||
if ($opt[0] == 'r') {
|
if ($opt[0] == 'r') {
|
||||||
@@ -185,7 +185,7 @@ class System
|
|||||||
}
|
}
|
||||||
$ret = true;
|
$ret = true;
|
||||||
if (isset($do_recursive)) {
|
if (isset($do_recursive)) {
|
||||||
$struct = System::_multipleToStruct($opts[1]);
|
$struct = PearSystem::_multipleToStruct($opts[1]);
|
||||||
foreach($struct['files'] as $file) {
|
foreach($struct['files'] as $file) {
|
||||||
if (!@unlink($file)) {
|
if (!@unlink($file)) {
|
||||||
$ret = false;
|
$ret = false;
|
||||||
@@ -209,7 +209,7 @@ class System
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make directories. Note that we use call_user_func('mkdir') to avoid
|
* Make directories. Note that we use call_user_func('mkdir') to avoid
|
||||||
* a problem with ZE2 calling System::mkDir instead of the native PHP func.
|
* a problem with ZE2 calling PearSystem::mkDir instead of the native PHP func.
|
||||||
*
|
*
|
||||||
* @param string $args the name of the director(y|ies) to create
|
* @param string $args the name of the director(y|ies) to create
|
||||||
* @return bool True for success
|
* @return bool True for success
|
||||||
@@ -217,9 +217,9 @@ class System
|
|||||||
*/
|
*/
|
||||||
function mkDir($args)
|
function mkDir($args)
|
||||||
{
|
{
|
||||||
$opts = System::_parseArgs($args, 'pm:');
|
$opts = PearSystem::_parseArgs($args, 'pm:');
|
||||||
if (PEAR::isError($opts)) {
|
if (PEAR::isError($opts)) {
|
||||||
return System::raiseError($opts);
|
return PearSystem::raiseError($opts);
|
||||||
}
|
}
|
||||||
$mode = 0777; // default mode
|
$mode = 0777; // default mode
|
||||||
foreach($opts[0] as $opt) {
|
foreach($opts[0] as $opt) {
|
||||||
@@ -265,9 +265,9 @@ class System
|
|||||||
* Concatenate files
|
* Concatenate files
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
* 1) $var = System::cat('sample.txt test.txt');
|
* 1) $var = PearSystem::cat('sample.txt test.txt');
|
||||||
* 2) System::cat('sample.txt test.txt > final.txt');
|
* 2) PearSystem::cat('sample.txt test.txt > final.txt');
|
||||||
* 3) System::cat('sample.txt test.txt >> final.txt');
|
* 3) PearSystem::cat('sample.txt test.txt >> final.txt');
|
||||||
*
|
*
|
||||||
* Note: as the class use fopen, urls should work also (test that)
|
* Note: as the class use fopen, urls should work also (test that)
|
||||||
*
|
*
|
||||||
@@ -297,14 +297,14 @@ class System
|
|||||||
}
|
}
|
||||||
if (isset($mode)) {
|
if (isset($mode)) {
|
||||||
if (!$outputfd = fopen($outputfile, $mode)) {
|
if (!$outputfd = fopen($outputfile, $mode)) {
|
||||||
$err = System::raiseError("Could not open $outputfile");
|
$err = PearSystem::raiseError("Could not open $outputfile");
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
$ret = true;
|
$ret = true;
|
||||||
}
|
}
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if (!$fd = fopen($file, 'r')) {
|
if (!$fd = fopen($file, 'r')) {
|
||||||
System::raiseError("Could not open $file");
|
PearSystem::raiseError("Could not open $file");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
while ($cont = fread($fd, 2048)) {
|
while ($cont = fread($fd, 2048)) {
|
||||||
@@ -327,10 +327,10 @@ class System
|
|||||||
* the created files when the scripts finish its execution.
|
* the created files when the scripts finish its execution.
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
* 1) $tempfile = System::mktemp("prefix");
|
* 1) $tempfile = PearSystem::mktemp("prefix");
|
||||||
* 2) $tempdir = System::mktemp("-d prefix");
|
* 2) $tempdir = PearSystem::mktemp("-d prefix");
|
||||||
* 3) $tempfile = System::mktemp();
|
* 3) $tempfile = PearSystem::mktemp();
|
||||||
* 4) $tempfile = System::mktemp("-t /var/tmp prefix");
|
* 4) $tempfile = PearSystem::mktemp("-t /var/tmp prefix");
|
||||||
*
|
*
|
||||||
* prefix -> The string that will be prepended to the temp name
|
* prefix -> The string that will be prepended to the temp name
|
||||||
* (defaults to "tmp").
|
* (defaults to "tmp").
|
||||||
@@ -342,15 +342,15 @@ class System
|
|||||||
*
|
*
|
||||||
* @param string $args The arguments
|
* @param string $args The arguments
|
||||||
* @return mixed the full path of the created (file|dir) or false
|
* @return mixed the full path of the created (file|dir) or false
|
||||||
* @see System::tmpdir()
|
* @see PearSystem::tmpdir()
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function mktemp($args = null)
|
function mktemp($args = null)
|
||||||
{
|
{
|
||||||
static $first_time = true;
|
static $first_time = true;
|
||||||
$opts = System::_parseArgs($args, 't:d');
|
$opts = PearSystem::_parseArgs($args, 't:d');
|
||||||
if (PEAR::isError($opts)) {
|
if (PEAR::isError($opts)) {
|
||||||
return System::raiseError($opts);
|
return PearSystem::raiseError($opts);
|
||||||
}
|
}
|
||||||
foreach($opts[0] as $opt) {
|
foreach($opts[0] as $opt) {
|
||||||
if($opt[0] == 'd') {
|
if($opt[0] == 'd') {
|
||||||
@@ -361,16 +361,16 @@ class System
|
|||||||
}
|
}
|
||||||
$prefix = (isset($opts[1][0])) ? $opts[1][0] : 'tmp';
|
$prefix = (isset($opts[1][0])) ? $opts[1][0] : 'tmp';
|
||||||
if (!isset($tmpdir)) {
|
if (!isset($tmpdir)) {
|
||||||
$tmpdir = System::tmpdir();
|
$tmpdir = PearSystem::tmpdir();
|
||||||
}
|
}
|
||||||
if (!System::mkDir("-p $tmpdir")) {
|
if (!PearSystem::mkDir("-p $tmpdir")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$tmp = tempnam($tmpdir, $prefix);
|
$tmp = tempnam($tmpdir, $prefix);
|
||||||
if (isset($tmp_is_dir)) {
|
if (isset($tmp_is_dir)) {
|
||||||
unlink($tmp); // be careful possible race condition here
|
unlink($tmp); // be careful possible race condition here
|
||||||
if (!call_user_func('mkdir', $tmp, 0700)) {
|
if (!call_user_func('mkdir', $tmp, 0700)) {
|
||||||
return System::raiseError("Unable to create temporary directory $tmpdir");
|
return PearSystem::raiseError("Unable to create temporary directory $tmpdir");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$GLOBALS['_System_temp_files'][] = $tmp;
|
$GLOBALS['_System_temp_files'][] = $tmp;
|
||||||
@@ -392,7 +392,7 @@ class System
|
|||||||
if (count($GLOBALS['_System_temp_files'])) {
|
if (count($GLOBALS['_System_temp_files'])) {
|
||||||
$delete = $GLOBALS['_System_temp_files'];
|
$delete = $GLOBALS['_System_temp_files'];
|
||||||
array_unshift($delete, '-r');
|
array_unshift($delete, '-r');
|
||||||
System::rm($delete);
|
PearSystem::rm($delete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,12 +465,12 @@ class System
|
|||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
*
|
*
|
||||||
* System::find($dir);
|
* PearSystem::find($dir);
|
||||||
* System::find("$dir -type d");
|
* PearSystem::find("$dir -type d");
|
||||||
* System::find("$dir -type f");
|
* PearSystem::find("$dir -type f");
|
||||||
* System::find("$dir -name *.php");
|
* PearSystem::find("$dir -name *.php");
|
||||||
* System::find("$dir -name *.php -name *.htm*");
|
* PearSystem::find("$dir -name *.php -name *.htm*");
|
||||||
* System::find("$dir -maxdepth 1");
|
* PearSystem::find("$dir -maxdepth 1");
|
||||||
*
|
*
|
||||||
* Params implmented:
|
* Params implmented:
|
||||||
* $dir -> Start the search at this directory
|
* $dir -> Start the search at this directory
|
||||||
@@ -516,7 +516,7 @@ class System
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$path = System::_dirToStruct($dir, $depth);
|
$path = PearSystem::_dirToStruct($dir, $depth);
|
||||||
if ($do_files && $do_dirs) {
|
if ($do_files && $do_dirs) {
|
||||||
$files = array_merge($path['files'], $path['dirs']);
|
$files = array_merge($path['files'], $path['dirs']);
|
||||||
} elseif ($do_dirs) {
|
} elseif ($do_dirs) {
|
||||||
4
thirdparty/pear/package-PEAR.xml
vendored
4
thirdparty/pear/package-PEAR.xml
vendored
@@ -138,7 +138,7 @@ PEAR INSTALLER:
|
|||||||
* PEAR_Config class uses getenv() rather than $_ENV
|
* PEAR_Config class uses getenv() rather than $_ENV
|
||||||
to read environment variables.
|
to read environment variables.
|
||||||
|
|
||||||
* System::which() Windows fix, now looks for
|
* PearSystem::which() Windows fix, now looks for
|
||||||
exe/bat/cmd/com suffixes rather than just exe
|
exe/bat/cmd/com suffixes rather than just exe
|
||||||
|
|
||||||
* Added "pear cvsdiff" command
|
* Added "pear cvsdiff" command
|
||||||
@@ -237,7 +237,7 @@ Bugfixes, Installer:
|
|||||||
New Features, PEAR Library:
|
New Features, PEAR Library:
|
||||||
* added PEAR::loadExtension($ext)
|
* added PEAR::loadExtension($ext)
|
||||||
* added PEAR::delExpect()
|
* added PEAR::delExpect()
|
||||||
* System::mkTemp() now cleans up at shutdown
|
* PearSystem::mkTemp() now cleans up at shutdown
|
||||||
* defined PEAR_ZE2 constant (boolean)
|
* defined PEAR_ZE2 constant (boolean)
|
||||||
* added PEAR::throwError() with a simpler API
|
* added PEAR::throwError() with a simpler API
|
||||||
than raiseError()
|
than raiseError()
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ class PropelSQLExec extends TaskPhing {
|
|||||||
$this->conn->rollback();
|
$this->conn->rollback();
|
||||||
} catch (SQLException $ex) {
|
} catch (SQLException $ex) {
|
||||||
// do nothing.
|
// do nothing.
|
||||||
System::println("Rollback failed.");
|
PearSystem::println("Rollback failed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->statement) $this->statement->close();
|
if ($this->statement) $this->statement->close();
|
||||||
@@ -428,7 +428,7 @@ class PropelSQLExec extends TaskPhing {
|
|||||||
$this->conn->rollback();
|
$this->conn->rollback();
|
||||||
} catch (SQLException $ex) {
|
} catch (SQLException $ex) {
|
||||||
// do nothing.
|
// do nothing.
|
||||||
System::println("Rollback failed");
|
PearSystem::println("Rollback failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->statement) $this->statement->close();
|
if ($this->statement) $this->statement->close();
|
||||||
@@ -620,12 +620,12 @@ class PropelSQLExec extends TaskPhing {
|
|||||||
$out->newLine();
|
$out->newLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
System::println($line);
|
PearSystem::println($line);
|
||||||
$line = "";
|
$line = "";
|
||||||
} // while rs->next()
|
} // while rs->next()
|
||||||
}
|
}
|
||||||
} while ($this->statement->getMoreResults());
|
} while ($this->statement->getMoreResults());
|
||||||
System::println();
|
PearSystem::println();
|
||||||
if ($out !== null) $out->newLine();
|
if ($out !== null) $out->newLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
|
|
||||||
require_once "HTTP/WebDAV/Server.php";
|
require_once "HTTP/WebDAV/Server.php";
|
||||||
require_once "System.php";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProcessMaker Filesystem access using WebDAV
|
* ProcessMaker Filesystem access using WebDAV
|
||||||
@@ -745,7 +744,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
|||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
$query = "DELETE FROM properties WHERE path LIKE '" . $this->_slashify($options["path"]) . "%'";
|
$query = "DELETE FROM properties WHERE path LIKE '" . $this->_slashify($options["path"]) . "%'";
|
||||||
mysql_query($query);
|
mysql_query($query);
|
||||||
System::rm("-rf $path");
|
PearSystem::rm("-rf $path");
|
||||||
} else {
|
} else {
|
||||||
unlink($path);
|
unlink($path);
|
||||||
}
|
}
|
||||||
@@ -848,7 +847,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
|||||||
mysql_query($query);
|
mysql_query($query);
|
||||||
} else {
|
} else {
|
||||||
if (is_dir($source)) {
|
if (is_dir($source)) {
|
||||||
$files = System::find($source);
|
$files = PearSystem::find($source);
|
||||||
$files = array_reverse($files);
|
$files = array_reverse($files);
|
||||||
} else {
|
} else {
|
||||||
$files = array($source
|
$files = array($source
|
||||||
|
|||||||
Reference in New Issue
Block a user