summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerenc Kovacs <tyrael@php.net>2015-06-16 17:59:27 +0200
committerFerenc Kovacs <tyrael@php.net>2015-06-18 16:46:22 +0200
commitff3ee75d91a6b8794d75e9aef6179d895cc2ca3e (patch)
tree2b3a34cef54cd8b76dda1231bec3535e476b74c7
parent7a02d138a6ccb5495bb69ec526a4e9bf890a5044 (diff)
downloadphp-git-ff3ee75d91a6b8794d75e9aef6179d895cc2ca3e.tar.gz
add a freshly built pear/install-pear-nozlib.phar. created from the current stable branch of pear-core and using the trunk from PHP_Archive where the ereg_ calls are removed already
-rw-r--r--pear/install-pear-nozlib.phar8328
1 files changed, 2846 insertions, 5482 deletions
diff --git a/pear/install-pear-nozlib.phar b/pear/install-pear-nozlib.phar
index f018d863ed..2f77855924 100644
--- a/pear/install-pear-nozlib.phar
+++ b/pear/install-pear-nozlib.phar
@@ -23,11 +23,11 @@ if (!class_exists('PHP_Archive')) {/**
* @author Davey Shafik <davey@synapticmedia.net>
* @author Greg Beaver <cellog@php.net>
* @link http://www.synapticmedia.net Synaptic Media
- * @version Id: Archive.php,v 1.52 2007/09/01 20:28:14 cellog Exp $
+ * @version Id$
* @package PHP_Archive
* @category PHP
*/
-
+
class PHP_Archive
{
const GZ = 0x00001000;
@@ -35,6 +35,9 @@ class PHP_Archive
const SIG = 0x00010000;
const SHA1 = 0x0002;
const MD5 = 0x0001;
+ const SHA256 = 0x0003;
+ const SHA512 = 0x0004;
+ const OPENSSL = 0x0010;
/**
* Whether this archive is compressed with zlib
*
@@ -56,6 +59,11 @@ class PHP_Archive
*/
protected $internalFileLength = null;
/**
+ * true if the current file is an empty directory
+ * @var string
+ */
+ protected $isDir = false;
+ /**
* Current file statistics (size, creation date, etc.)
* @var string
*/
@@ -78,7 +86,7 @@ class PHP_Archive
* require_once 'phar://PEAR.phar/PEAR/Installer.php';
* </code>
* then the alias is "PEAR.phar"
- *
+ *
* Information stored is a boolean indicating whether this .phar is compressed
* with zlib, another for bzip2, phar-specific meta-data, and
* the precise offset of internal files
@@ -94,9 +102,9 @@ class PHP_Archive
private static $_pharFiles = array();
/**
* File listing for the .phar
- *
+ *
* The manifest is indexed per phar.
- *
+ *
* Files within the .phar are indexed by their relative path within the
* .phar. Each file has this information in its internal array
*
@@ -209,7 +217,7 @@ class PHP_Archive
header("HTTP/1.0 404 Not Found");
return false;
}
-
+
}
public static function introspect($archive, $dir)
@@ -382,7 +390,7 @@ class PHP_Archive
* Any attempt to call from outside the .phar or to re-alias the .phar will fail
* as a security measure.
* @param string $alias
- * @param int $dataoffset the value of 42421
+ * @param int $dataoffset the value of 43613
*/
public static final function mapPhar($alias = NULL, $dataoffset = NULL)
{
@@ -439,7 +447,7 @@ class PHP_Archive
$manifest .= $last;
}
if (strlen($manifest) < $manifest_length['len']) {
- throw new Exception('ERROR: manifest length read was "' .
+ throw new Exception('ERROR: manifest length read was "' .
strlen($manifest) .'" should be "' .
$manifest_length['len'] . '"');
}
@@ -563,7 +571,7 @@ class PHP_Archive
return '';
}
$std = str_replace("\\", "/", $path);
- while ($std != ($std = ereg_replace("[^\/:?]+/\.\./", "", $std))) ;
+ while ($std != ($std = preg_replace("/[^\/:?]+\/\.\.\//", "", $std))) ;
$std = str_replace("/./", "", $std);
if (strlen($std) > 1 && $std[0] == '/') {
$std = substr($std, 1);
@@ -583,7 +591,15 @@ class PHP_Archive
{
$std = self::processFile($path);
if (isset(self::$_manifest[$this->_archiveName][$path])) {
- $this->_setCurrentFile($path);
+ if ($path[strlen($path)-1] == '/') {
+ // directory
+ if (!$allowdirs) {
+ return 'Error: "' . $path . '" is a directory in phar "' . $this->_basename . '"';
+ }
+ $this->_setCurrentFile($path, true);
+ } else {
+ $this->_setCurrentFile($path);
+ }
return true;
}
if (!$allowdirs) {
@@ -600,17 +616,30 @@ class PHP_Archive
return 'Error: "' . $path . '" not found in phar "' . $this->_basename . '"';
}
- private function _setCurrentFile($path)
+ private function _setCurrentFile($path, $dir = false)
{
- $this->currentStat = array(
- 2 => 0100444, // file mode, readable by all, writeable by none
- 4 => 0, // uid
- 5 => 0, // gid
- 7 => self::$_manifest[$this->_archiveName][$path][0], // size
- 9 => self::$_manifest[$this->_archiveName][$path][1], // creation time
- );
+ if ($dir) {
+ $this->currentStat = array(
+ 2 => 040777, // directory mode, readable by all, writeable by none
+ 4 => 0, // uid
+ 5 => 0, // gid
+ 7 => 0, // size
+ 9 => self::$_manifest[$this->_archiveName][$path][1], // creation time
+ );
+ $this->internalFileLength = 0;
+ $this->isDir = true;
+ } else {
+ $this->currentStat = array(
+ 2 => 0100444, // file mode, readable by all, writeable by none
+ 4 => 0, // uid
+ 5 => 0, // gid
+ 7 => self::$_manifest[$this->_archiveName][$path][0], // size
+ 9 => self::$_manifest[$this->_archiveName][$path][1], // creation time
+ );
+ $this->internalFileLength = self::$_manifest[$this->_archiveName][$path][2];
+ $this->isDir = false;
+ }
$this->currentFilename = $path;
- $this->internalFileLength = self::$_manifest[$this->_archiveName][$path][2];
// seek to offset of file header within the .phar
if (is_resource(@$this->fp)) {
fseek($this->fp, self::$_fileStart[$this->_archiveName] + self::$_manifest[$this->_archiveName][$path][7]);
@@ -687,7 +716,7 @@ class PHP_Archive
return false;
}
$file = substr($file, 7);
-
+
$ret = array('scheme' => 'phar');
$pos_p = strpos($file, '.phar.php');
$pos_z = strpos($file, '.phar.gz');
@@ -715,7 +744,7 @@ class PHP_Archive
}
return $ret;
}
-
+
/**
* Locate the .phar archive in the include_path and detect the file to open within
* the archive.
@@ -811,7 +840,7 @@ class PHP_Archive
return false;
}
}
-
+
/**
* Read the data - PHP streams API
*
@@ -824,7 +853,7 @@ class PHP_Archive
$this->position += strlen($ret);
return $ret;
}
-
+
/**
* Whether we've hit the end of the file - PHP streams API
* @access private
@@ -833,7 +862,7 @@ class PHP_Archive
{
return $this->position >= $this->currentStat[7];
}
-
+
/**
* For seeking the stream - PHP streams API
* @param int
@@ -866,7 +895,7 @@ class PHP_Archive
}
return true;
}
-
+
/**
* The current position in the stream - PHP streams API
* @access private
@@ -992,6 +1021,9 @@ class PHP_Archive
}
} elseif (strpos($file, $path) === 0) {
$fname = substr($file, strlen($path) + 1);
+ if ($fname == '/' || $fname[strlen($fname)-1] == '/') {
+ continue; // empty directory
+ }
if (strpos($fname, '/')) {
// this is a directory
$a = explode('/', $fname);
@@ -1102,18 +1134,21 @@ class PHP_Archive
/**
* @return list of supported signature algorithmns.
*/
- public static function getsupportedsignatures()
+ public static function getSupportedSignatures()
{
$ret = array('MD5', 'SHA-1');
if (extension_loaded('hash')) {
$ret[] = 'SHA-256';
$ret[] = 'SHA-512';
}
+ if (extension_loaded('openssl')) {
+ $ret[] = 'OpenSSL';
+ }
return $ret;
}
}}
if (!class_exists('Phar')) {
- PHP_Archive::mapPhar(null, 42421 );
+ PHP_Archive::mapPhar(null, 43613 );
} else {
try {
Phar::mapPhar();
@@ -1234,9 +1269,10 @@ if (extension_loaded('phar')) {if (isset($_SERVER) && isset($_SERVER['REQUEST_UR
require_once 'phar://install-pear-nozlib.phar/index.php';
-__HALT_COMPILER();
-0¤/m
-
+__HALT_COMPILER();Û
+?
+?
+
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
@@ -1948,7 +1984,7 @@ class Archive_Tar extends PEAR
break;
default :
- $this->_error('Unknow attribute code ' . $v_att_list[$i] . '');
+ $this->_error('Unknown attribute code ' . $v_att_list[$i] . '');
return false;
}
@@ -2956,7 +2992,7 @@ class Archive_Tar extends PEAR
}
// ----- Extract the properties
- $v_header['filename'] = $v_data['filename'];
+ $v_header['filename'] = rtrim($v_data['filename'], "\0");
if ($this->_maliciousFilename($v_header['filename'])) {
$this->_error(
'Malicious .tar detected, file "' . $v_header['filename'] .
@@ -3014,6 +3050,7 @@ class Archive_Tar extends PEAR
function _readLongHeader(&$v_header)
{
$v_filename = '';
+ $v_filesize = $v_header['size'];
$n = floor($v_header['size'] / 512);
for ($i = 0; $i < $n; $i++) {
$v_content = $this->_readBlock();
@@ -3021,7 +3058,7 @@ class Archive_Tar extends PEAR
}
if (($v_header['size'] % 512) != 0) {
$v_content = $this->_readBlock();
- $v_filename .= trim($v_content);
+ $v_filename .= $v_content;
}
// ----- Read the next header
@@ -3031,7 +3068,7 @@ class Archive_Tar extends PEAR
return false;
}
- $v_filename = trim($v_filename);
+ $v_filename = rtrim(substr($v_filename, 0, $v_filesize), "\0");
$v_header['filename'] = $v_filename;
if ($this->_maliciousFilename($v_filename)) {
$this->_error(
@@ -3658,7 +3695,7 @@ class Archive_Tar extends PEAR
}
?>
-package.xml
+package.xml
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>Archive_Tar</name>
<channel>pear.php.net</channel>
@@ -3691,24 +3728,23 @@ loaded. Bz2 compression is also supported with the bz2 extension loaded.</descri
<email>stig@php.net</email>
<active>no</active>
</helper>
- <date>2014-09-02</date>
- <time>07:33:00</time>
+ <date>2015-04-14</date>
+ <time>12:24:12</time>
<version>
- <release>1.3.13</release>
+ <release>1.3.16</release>
<api>1.3.1</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD
- License</license>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
<notes>
-* Fix Bug #20382: gzopen fix [mrook]
+* Fix Bug #20514: invalid package.xml; not installable with pyrus [mrook]
</notes>
<contents>
<dir name="/">
- <file baseinstalldir="/" md5sum="5abc21a68853f801a4ba7b6ff0918d5b" name="Archive/Tar.php" role="php" />
+ <file baseinstalldir="/" md5sum="d8be5182769eaa7fa3fc2596473f4838" name="Archive/Tar.php" role="php" />
<file baseinstalldir="/" md5sum="2fb90f0be7089a45c09a0d1182792419" name="docs/Archive_Tar.txt" role="doc" />
</dir>
</contents>
@@ -3732,6 +3768,52 @@ loaded. Bz2 compression is also supported with the bz2 extension loaded.</descri
<changelog>
<release>
<version>
+ <release>1.3.15</release>
+ <api>1.3.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2015-03-05</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
+ <notes>
+* Fixes composer.json parse error
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.3.14</release>
+ <api>1.3.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2015-02-26</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
+ <notes>
+* Fix Bug #18505: Possible incorrect handling of file names in TAR [mrook]
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>1.3.13</release>
+ <api>1.3.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2014-09-02</date>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD
+ License</license>
+ <notes>
+* Fix Bug #20382: gzopen fix [mrook]
+ </notes>
+ </release>
+ <release>
+ <version>
<release>1.3.12</release>
<api>1.3.1</api>
</version>
@@ -4088,7 +4170,7 @@ Windows bugfix: used wrong directory separators
</release>
</changelog>
</package>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
@@ -4800,7 +4882,7 @@ class Archive_Tar extends PEAR
break;
default :
- $this->_error('Unknow attribute code ' . $v_att_list[$i] . '');
+ $this->_error('Unknown attribute code ' . $v_att_list[$i] . '');
return false;
}
@@ -5808,7 +5890,7 @@ class Archive_Tar extends PEAR
}
// ----- Extract the properties
- $v_header['filename'] = $v_data['filename'];
+ $v_header['filename'] = rtrim($v_data['filename'], "\0");
if ($this->_maliciousFilename($v_header['filename'])) {
$this->_error(
'Malicious .tar detected, file "' . $v_header['filename'] .
@@ -5866,6 +5948,7 @@ class Archive_Tar extends PEAR
function _readLongHeader(&$v_header)
{
$v_filename = '';
+ $v_filesize = $v_header['size'];
$n = floor($v_header['size'] / 512);
for ($i = 0; $i < $n; $i++) {
$v_content = $this->_readBlock();
@@ -5873,7 +5956,7 @@ class Archive_Tar extends PEAR
}
if (($v_header['size'] % 512) != 0) {
$v_content = $this->_readBlock();
- $v_filename .= trim($v_content);
+ $v_filename .= $v_content;
}
// ----- Read the next header
@@ -5883,7 +5966,7 @@ class Archive_Tar extends PEAR
return false;
}
- $v_filename = trim($v_filename);
+ $v_filename = rtrim(substr($v_filename, 0, $v_filesize), "\0");
$v_header['filename'] = $v_filename;
if ($this->_maliciousFilename($v_filename)) {
$this->_error(
@@ -6510,7 +6593,7 @@ class Archive_Tar extends PEAR
}
?>
-
+
===================================
Last update : 2001-08-15
@@ -7004,7 +7087,7 @@ How it works :
* @package Console_Getopt
* @author Andrei Zmievski <andrei@php.net>
* @license http://www.php.net/license/3_0.txt PHP 3.0
- * @version CVS: $Id: Getopt.php 306067 2010-12-08 00:13:31Z dufuz $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Console_Getopt
*/
@@ -7055,9 +7138,8 @@ class Console_Getopt
*
* @return array two-element array containing the list of parsed options and
* the non-option arguments
- * @access public
*/
- function getopt2($args, $short_options, $long_options = null, $skip_unknown = false)
+ public static function getopt2($args, $short_options, $long_options = null, $skip_unknown = false)
{
return Console_Getopt::doGetopt(2, $args, $short_options, $long_options, $skip_unknown);
}
@@ -7074,7 +7156,7 @@ class Console_Getopt
* @return array two-element array containing the list of parsed options and
* the non-option arguments
*/
- function getopt($args, $short_options, $long_options = null, $skip_unknown = false)
+ public static function getopt($args, $short_options, $long_options = null, $skip_unknown = false)
{
return Console_Getopt::doGetopt(1, $args, $short_options, $long_options, $skip_unknown);
}
@@ -7090,7 +7172,7 @@ class Console_Getopt
*
* @return array
*/
- function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false)
+ public static function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false)
{
// in case you pass directly readPHPArgv() as the first arg
if (PEAR::isError($args)) {
@@ -7169,10 +7251,9 @@ class Console_Getopt
* @param string[] &$args
* @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option
*
- * @access private
* @return void
*/
- function _parseShortOption($arg, $short_options, &$opts, &$args, $skip_unknown)
+ protected static function _parseShortOption($arg, $short_options, &$opts, &$args, $skip_unknown)
{
for ($i = 0; $i < strlen($arg); $i++) {
$opt = $arg{$i};
@@ -7207,11 +7288,11 @@ class Console_Getopt
if (Console_Getopt::_isShortOpt($opt_arg)
|| Console_Getopt::_isLongOpt($opt_arg)) {
$msg = "option requires an argument --$opt";
- return PEAR::raiseError("Console_Getopt:" . $msg);
+ return PEAR::raiseError("Console_Getopt: " . $msg);
}
} else {
$msg = "option requires an argument --$opt";
- return PEAR::raiseError("Console_Getopt:" . $msg);
+ return PEAR::raiseError("Console_Getopt: " . $msg);
}
}
}
@@ -7225,10 +7306,9 @@ class Console_Getopt
*
* @param string $arg Argument to check
*
- * @access private
* @return bool
*/
- function _isShortOpt($arg)
+ protected static function _isShortOpt($arg)
{
return strlen($arg) == 2 && $arg[0] == '-'
&& preg_match('/[a-zA-Z]/', $arg[1]);
@@ -7239,10 +7319,9 @@ class Console_Getopt
*
* @param string $arg Argument to check
*
- * @access private
* @return bool
*/
- function _isLongOpt($arg)
+ protected static function _isLongOpt($arg)
{
return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' &&
preg_match('/[a-zA-Z]+$/', substr($arg, 2));
@@ -7256,10 +7335,9 @@ class Console_Getopt
* @param string[][] &$opts
* @param string[] &$args
*
- * @access private
* @return void|PEAR_Error
*/
- function _parseLongOption($arg, $long_options, &$opts, &$args, $skip_unknown)
+ protected static function _parseLongOption($arg, $long_options, &$opts, &$args, $skip_unknown)
{
@list($opt, $opt_arg) = explode('=', $arg, 2);
@@ -7331,10 +7409,9 @@ class Console_Getopt
* Safely read the $argv PHP array across different PHP configurations.
* Will take care on register_globals and register_argc_argv ini directives
*
- * @access public
* @return mixed the $argv PHP array or PEAR error if not registered
*/
- function readPHPArgv()
+ public static function readPHPArgv()
{
global $argv;
if (!is_array($argv)) {
@@ -7350,8 +7427,8 @@ class Console_Getopt
return $argv;
}
-}package.xml
-<package packagerversion="1.9.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+}package.xml
+<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>Console_Getopt</name>
<channel>pear.php.net</channel>
<summary>Command-line option parser</summary>
@@ -7361,7 +7438,7 @@ short and long options.</description>
<name>Andrei Zmievski</name>
<user>andrei</user>
<email>andrei@php.net</email>
- <active>yes</active>
+ <active>no</active>
</lead>
<developer>
<name>Stig Bakken</name>
@@ -7375,35 +7452,37 @@ short and long options.</description>
<email>cellog@php.net</email>
<active>yes</active>
</helper>
- <date>2011-03-07</date>
- <time>22:58:21</time>
+ <date>2015-02-22</date>
+ <time>13:25:49</time>
<version>
- <release>1.3.1</release>
- <api>1.3.0</api>
+ <release>1.4.0</release>
+ <api>1.4.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
- <license uri="http://www.php.net/license">PHP License</license>
+ <license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
<notes>
-* Change the minimum PEAR installer dep to be lower
+* Change license to BSD-2-Clause
+* Set minimum PHP version to 5.4.0
+* Mark static methods with &quot;static&quot; keyword
</notes>
<contents>
<dir name="/">
- <file md5sum="ed666da6b1c5d01c3ecbf1f588a70a60" name="Console/Getopt.php" role="php" />
+ <file md5sum="013530beb065fb8885f70af40b6c91fa" name="Console/Getopt.php" role="php" />
</dir>
</contents>
<compatible>
<name>PEAR</name>
<channel>pear.php.net</channel>
<min>1.4.0</min>
- <max>1.10.0</max>
+ <max>1.999.999</max>
</compatible>
<dependencies>
<required>
<php>
- <min>4.3.0</min>
+ <min>5.4.0</min>
</php>
<pearinstaller>
<min>1.8.0</min>
@@ -7413,6 +7492,38 @@ short and long options.</description>
<phprelease />
<changelog>
<release>
+ <date>2015-02-22</date>
+ <version>
+ <release>1.3.1</release>
+ <api>1.3.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://opensource.org/licenses/bsd-license.php">BSD-2-Clause</license>
+ <notes>
+* Change license to BSD-2-Clause
+* Set minimum PHP version to 5.4.0
+* Mark static methods with &quot;static&quot; keyword
+ </notes>
+ </release>
+ <release>
+ <date>2011-03-07</date>
+ <version>
+ <release>1.3.1</release>
+ <api>1.3.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>
+* Change the minimum PEAR installer dep to be lower
+ </notes>
+ </release>
+ <release>
<date>2010-12-11</date>
<time>20:20:13</time>
<version>
@@ -7552,7 +7663,7 @@ Initial release
</release>
</changelog>
</package>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* PHP Version 5
@@ -7571,7 +7682,7 @@ Initial release
* @package Console_Getopt
* @author Andrei Zmievski <andrei@php.net>
* @license http://www.php.net/license/3_0.txt PHP 3.0
- * @version CVS: $Id: Getopt.php 306067 2010-12-08 00:13:31Z dufuz $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Console_Getopt
*/
@@ -7622,9 +7733,8 @@ class Console_Getopt
*
* @return array two-element array containing the list of parsed options and
* the non-option arguments
- * @access public
*/
- function getopt2($args, $short_options, $long_options = null, $skip_unknown = false)
+ public static function getopt2($args, $short_options, $long_options = null, $skip_unknown = false)
{
return Console_Getopt::doGetopt(2, $args, $short_options, $long_options, $skip_unknown);
}
@@ -7641,7 +7751,7 @@ class Console_Getopt
* @return array two-element array containing the list of parsed options and
* the non-option arguments
*/
- function getopt($args, $short_options, $long_options = null, $skip_unknown = false)
+ public static function getopt($args, $short_options, $long_options = null, $skip_unknown = false)
{
return Console_Getopt::doGetopt(1, $args, $short_options, $long_options, $skip_unknown);
}
@@ -7657,7 +7767,7 @@ class Console_Getopt
*
* @return array
*/
- function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false)
+ public static function doGetopt($version, $args, $short_options, $long_options = null, $skip_unknown = false)
{
// in case you pass directly readPHPArgv() as the first arg
if (PEAR::isError($args)) {
@@ -7736,10 +7846,9 @@ class Console_Getopt
* @param string[] &$args
* @param boolean $skip_unknown suppresses Console_Getopt: unrecognized option
*
- * @access private
* @return void
*/
- function _parseShortOption($arg, $short_options, &$opts, &$args, $skip_unknown)
+ protected static function _parseShortOption($arg, $short_options, &$opts, &$args, $skip_unknown)
{
for ($i = 0; $i < strlen($arg); $i++) {
$opt = $arg{$i};
@@ -7774,11 +7883,11 @@ class Console_Getopt
if (Console_Getopt::_isShortOpt($opt_arg)
|| Console_Getopt::_isLongOpt($opt_arg)) {
$msg = "option requires an argument --$opt";
- return PEAR::raiseError("Console_Getopt:" . $msg);
+ return PEAR::raiseError("Console_Getopt: " . $msg);
}
} else {
$msg = "option requires an argument --$opt";
- return PEAR::raiseError("Console_Getopt:" . $msg);
+ return PEAR::raiseError("Console_Getopt: " . $msg);
}
}
}
@@ -7792,10 +7901,9 @@ class Console_Getopt
*
* @param string $arg Argument to check
*
- * @access private
* @return bool
*/
- function _isShortOpt($arg)
+ protected static function _isShortOpt($arg)
{
return strlen($arg) == 2 && $arg[0] == '-'
&& preg_match('/[a-zA-Z]/', $arg[1]);
@@ -7806,10 +7914,9 @@ class Console_Getopt
*
* @param string $arg Argument to check
*
- * @access private
* @return bool
*/
- function _isLongOpt($arg)
+ protected static function _isLongOpt($arg)
{
return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' &&
preg_match('/[a-zA-Z]+$/', substr($arg, 2));
@@ -7823,10 +7930,9 @@ class Console_Getopt
* @param string[][] &$opts
* @param string[] &$args
*
- * @access private
* @return void|PEAR_Error
*/
- function _parseLongOption($arg, $long_options, &$opts, &$args, $skip_unknown)
+ protected static function _parseLongOption($arg, $long_options, &$opts, &$args, $skip_unknown)
{
@list($opt, $opt_arg) = explode('=', $arg, 2);
@@ -7898,10 +8004,9 @@ class Console_Getopt
* Safely read the $argv PHP array across different PHP configurations.
* Will take care on register_globals and register_argc_argv ini directives
*
- * @access public
* @return mixed the $argv PHP array or PEAR error if not registered
*/
- function readPHPArgv()
+ public static function readPHPArgv()
{
global $argv;
if (!is_array($argv)) {
@@ -7917,13 +8022,11 @@ class Console_Getopt
return $argv;
}
-}
-
-/* $Id$ */
+}
error_reporting(1803);
-if (ini_get('date.timezone') === '' && function_exists('date_default_timezone_set')) {
+if (ini_get('date.timezone') === '') {
date_default_timezone_set('UTC');
}
@@ -7953,10 +8056,10 @@ if (!$a) {
}
$force = false;
-$install_files = array('Archive_Tar' => 'phar://install-pear-nozlib.phar/Archive_Tar-1.3.13.tar',
-'Console_Getopt' => 'phar://install-pear-nozlib.phar/Console_Getopt-1.3.1.tar',
-'Structures_Graph' => 'phar://install-pear-nozlib.phar/Structures_Graph-1.0.4.tar',
-'XML_Util' => 'phar://install-pear-nozlib.phar/XML_Util-1.2.3.tar',
+$install_files = array('Archive_Tar' => 'phar://install-pear-nozlib.phar/Archive_Tar-1.3.16.tar',
+'Console_Getopt' => 'phar://install-pear-nozlib.phar/Console_Getopt-1.4.0.tar',
+'Structures_Graph' => 'phar://install-pear-nozlib.phar/Structures_Graph-1.1.0.tar',
+'XML_Util' => 'phar://install-pear-nozlib.phar/XML_Util-1.3.0.tar',
'PEAR' => 'phar://install-pear-nozlib.phar/PEAR-1.9.5.tar',
);
array_shift($argv);
@@ -8230,7 +8333,6 @@ foreach ($install_files as $package => $instfile) {
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since PEAR 0.1
*/
@@ -8319,7 +8421,7 @@ class OS_Guess
var $release;
var $extra;
- function OS_Guess($uname = null)
+ function __construct($uname = null)
{
list($this->sysname,
$this->release,
@@ -8555,7 +8657,8 @@ class OS_Guess
* indent-tabs-mode: nil
* c-basic-offset: 4
* End:
- */package.xml
+ */
+package.xml
<package packagerversion="1.9.5" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>PEAR</name>
<channel>pear.php.net</channel>
@@ -8644,8 +8747,8 @@ class OS_Guess
<email>mj@php.net</email>
<active>no</active>
</helper>
- <date>2015-02-10</date>
- <time>09:27:31</time>
+ <date>2015-06-16</date>
+ <time>15:53:26</time>
<version>
<release>1.9.5</release>
<api>1.9.5</api>
@@ -8677,230 +8780,229 @@ Bug fixes in 1.9.5.dev1:
</notes>
<contents>
<dir name="/">
- <file md5sum="a2aa07e80374c8cbc72229b5e7c28975" name="OS/Guess.php" role="php">
+ <file md5sum="871ed3c14b667b22765eb3ba6618246e" name="OS/Guess.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="e891645bd254d8ae9953fc2b571c076a" name="PEAR/ChannelFile/Parser.php" role="php">
+ <file md5sum="a27ac7bbcd59575bd7eb47c26f393fb7" name="PEAR/ChannelFile/Parser.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="8fd87e64002e11fd86eb2f3fbfee6599" name="PEAR/Command/Auth.xml" role="php" />
- <file md5sum="160fab095b97a42e16e62741a7eb0ad1" name="PEAR/Command/Auth.php" role="php">
+ <file md5sum="7cc172f1aab717868cfb9182bffc1bd6" name="PEAR/Command/Auth.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="73602fd7f051eaf8d37452d0e3063bdb" name="PEAR/Command/Build.xml" role="php" />
- <file md5sum="c7919396329a85e869523a9427fa5fa7" name="PEAR/Command/Build.php" role="php">
+ <file md5sum="87f08181b04413e4f85eda31e3470813" name="PEAR/Command/Build.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="6d5aab4d4308c3005b5f584c7783a031" name="PEAR/Command/Channels.xml" role="php" />
- <file md5sum="9a67344b6adfcb21d0110e6c9aff4ee8" name="PEAR/Command/Channels.php" role="php">
+ <file md5sum="3be1244fe9d3f98a2ecbd09e6a7f4de5" name="PEAR/Command/Channels.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="27146b078d36e65ee09ee26e152fa186" name="PEAR/Command/Common.php" role="php">
+ <file md5sum="eaa3bd88483a7c1ca2c5773f2e228d5a" name="PEAR/Command/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="91f189cb9423b5e87ee0abc5ea1a2be3" name="PEAR/Command/Config.xml" role="php" />
- <file md5sum="7f5308dddc223db88c08247853b5405c" name="PEAR/Command/Config.php" role="php">
+ <file md5sum="45f29ee1f0fb1292c19d4611faa4f77c" name="PEAR/Command/Config.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="2db0386b865d3f9a29f9126728722ece" name="PEAR/Command/Install.xml" role="php" />
- <file md5sum="86dbc400d1ce627129fb9e3006b456bd" name="PEAR/Command/Install.php" role="php">
+ <file md5sum="8c2e07d70a1efae5f87a629899192019" name="PEAR/Command/Install.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="5cb62a04c0a268f4edd64a49a3895c92" name="PEAR/Command/Mirror.xml" role="php" />
- <file md5sum="2f9f9c377012970ebb7a9adf2624115c" name="PEAR/Command/Mirror.php" role="php">
+ <file md5sum="90d4d159c03bd83e62ac899e1b4e05c6" name="PEAR/Command/Mirror.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="9367dcd7e4dbdde423f9c4c7d3f3a919" name="PEAR/Command/Package.xml" role="php" />
- <file md5sum="1a48bf3b518b7294dcce9c63282c281d" name="PEAR/Command/Package.php" role="php">
+ <file md5sum="9434e3ae9d2cd10e83978d8d6213ace4" name="PEAR/Command/Package.php" role="php">
<tasks:replace from="@DATA-DIR@" to="data_dir" type="pear-config" />
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="28dc842ea725d8787b9f9c3dbca5aa22" name="PEAR/Command/Pickle.xml" role="php" />
- <file md5sum="a9efe0702637c6473147811064171553" name="PEAR/Command/Pickle.php" role="php">
+ <file md5sum="a856882b752fe97c0fc38783640a6134" name="PEAR/Command/Pickle.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="49b046cfc14747f0365e02e9c3f0e6dc" name="PEAR/Command/Registry.xml" role="php" />
- <file md5sum="17d2a14999e1b27f41bd18e186b17c1d" name="PEAR/Command/Registry.php" role="php">
+ <file md5sum="034741c88bef7b1c92d54ce455794a4f" name="PEAR/Command/Registry.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="29c02e823879b4e3e291f6b36fb339f1" name="PEAR/Command/Remote.xml" role="php" />
- <file md5sum="5554fadcaff58b8e5ae47212f886ffd5" name="PEAR/Command/Remote.php" role="php">
+ <file md5sum="a55391003d9ad29467600db1fcc43113" name="PEAR/Command/Remote.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="a50c32015005e0761cc3b04679b29ed0" name="PEAR/Command/Test.xml" role="php" />
- <file md5sum="c16c4e903074889c452a688e70155906" name="PEAR/Command/Test.php" role="php">
+ <file md5sum="42db7eda8715aa7194178624cb26b53a" name="PEAR/Command/Test.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="83140fa3349b06d973f6fd1e16029a3c" name="PEAR/Downloader/Package.php" role="php">
+ <file md5sum="0b3ff65f17d62f534f6693bed15fae4d" name="PEAR/Downloader/Package.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="7ea1b98ead05f4ab87f5c29a98dd2668" name="PEAR/Frontend/CLI.php" role="php">
+ <file md5sum="f4b9edf9424fedbf45f7ac735c8ebd26" name="PEAR/Frontend/CLI.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="e7cc23f09da3a5824edf2af36d776c1a" name="PEAR/Installer/Role/Common.php" role="php">
+ <file md5sum="0e081c9e1ffccde9904e61aeaaf60d71" name="PEAR/Installer/Role/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="d8c62e6275e3aaa7784290912406092c" name="PEAR/Installer/Role/Cfg.xml" role="php" />
- <file md5sum="7db2651b25fc75f1f98c661de113151a" name="PEAR/Installer/Role/Cfg.php" role="php">
+ <file md5sum="be739bdd6d7163dc10fb5d76729c017b" name="PEAR/Installer/Role/Cfg.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="89a4a2a286e842d45a98974f40a0565c" name="PEAR/Installer/Role/Data.xml" role="php" />
- <file md5sum="2e33d055744fea9a7ca5a92bcc26f548" name="PEAR/Installer/Role/Data.php" role="php">
+ <file md5sum="e213b6b24ef779fbf5075e9380f86bd2" name="PEAR/Installer/Role/Data.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="b1ce0fe105251c3b75209d6518ee69ac" name="PEAR/Installer/Role/Doc.xml" role="php" />
- <file md5sum="74ca9bea65232478649bea1ea34506b5" name="PEAR/Installer/Role/Doc.php" role="php">
+ <file md5sum="cbb1e4f1fc51e8af2a48eae136225aa4" name="PEAR/Installer/Role/Doc.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="af71c0ad42d16a323afe24a4f884ef15" name="PEAR/Installer/Role/Ext.xml" role="php" />
- <file md5sum="ae27b5854e7ead2cd779bdeb240ad1d2" name="PEAR/Installer/Role/Ext.php" role="php">
+ <file md5sum="2e4679ad94c986076a540e8b45b347ef" name="PEAR/Installer/Role/Ext.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="ef88f0321d3e481c2130c95122cf76d8" name="PEAR/Installer/Role/Php.xml" role="php" />
- <file md5sum="f0f86659fad9779e1e30045bcda61ed1" name="PEAR/Installer/Role/Php.php" role="php">
+ <file md5sum="9054354283bd5ecba5dac88915b3f434" name="PEAR/Installer/Role/Php.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="746461dc3b48af6d24094cb0211608f2" name="PEAR/Installer/Role/Script.xml" role="php" />
- <file md5sum="466117b0ea5f5bf6e908b73c990ebbc8" name="PEAR/Installer/Role/Script.php" role="php">
+ <file md5sum="f1b4ce343083971fd0c1b61a907e5a9c" name="PEAR/Installer/Role/Script.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="e147d63f168ea156fc2be38caaa63804" name="PEAR/Installer/Role/Src.xml" role="php" />
- <file md5sum="206ed934576b6c5c21b50b1ff306d12c" name="PEAR/Installer/Role/Src.php" role="php">
+ <file md5sum="582701788601cfde7e292af975eb3848" name="PEAR/Installer/Role/Src.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="a24b596ec987aa5688fc19e8ed4e97ea" name="PEAR/Installer/Role/Test.xml" role="php" />
- <file md5sum="433a4a5596adcab73403147cc6e54d25" name="PEAR/Installer/Role/Test.php" role="php">
+ <file md5sum="959d481cbf9e1d9aa3680fbc584f112e" name="PEAR/Installer/Role/Test.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="7641e71c5785bb33a4261ebe25ed0fd7" name="PEAR/Installer/Role/Www.xml" role="php" />
- <file md5sum="ae677650efc29afd38910ea9bd59d639" name="PEAR/Installer/Role/Www.php" role="php">
+ <file md5sum="5b19f05b56a686d063989c4f5a0a0e07" name="PEAR/Installer/Role/Www.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="94b8312236702f8eca3be8707dc1251f" name="PEAR/Installer/Role.php" role="php">
+ <file md5sum="aba6b8460a41418136f8e8372b556c71" name="PEAR/Installer/Role.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="f175c4ee49cb7e045afe24ba6d5eba92" name="PEAR/PackageFile/Generator/v1.php" role="php">
+ <file md5sum="d8a5976e8d4f626bc7156b4b91d21ad9" name="PEAR/PackageFile/Generator/v1.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="dd51a6e63a553c81dc845d7a573a7d11" name="PEAR/PackageFile/Generator/v2.php" role="php">
+ <file md5sum="62bc7985f8aa6009613d431d4e178938" name="PEAR/PackageFile/Generator/v2.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="77bbb9ca7272c5c383cc89ec36325a5c" name="PEAR/PackageFile/Parser/v1.php" role="php">
+ <file md5sum="ff06699490c6f5f464bff5844b94a4fd" name="PEAR/PackageFile/Parser/v1.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="23c8f0128d415b9ac4fe4611c1abbc98" name="PEAR/PackageFile/Parser/v2.php" role="php">
+ <file md5sum="2d14ca94e52e6fe1780976cba1d5d9b0" name="PEAR/PackageFile/Parser/v2.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="638362dfb65a8a9fc4c6f0741dfed23c" name="PEAR/PackageFile/v2/rw.php" role="php">
+ <file md5sum="77f746d2b159bd3891341660cbade99f" name="PEAR/PackageFile/v2/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="7cf09f7848ca951bd329ed997f80023b" name="PEAR/PackageFile/v2/Validator.php" role="php">
+ <file md5sum="bbe251e5dd51c0bd06d155b28416ceec" name="PEAR/PackageFile/v2/Validator.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="f299787f3253226e3dcd9617890e6b08" name="PEAR/PackageFile/v1.php" role="php">
+ <file md5sum="53633cdedaa4cc7e071c8787e06f3e94" name="PEAR/PackageFile/v1.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="c885860fba3f63e64208c83e800591eb" name="PEAR/PackageFile/v2.php" role="php">
+ <file md5sum="7946c18d947ea3906e3c4123114dc809" name="PEAR/PackageFile/v2.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="dd3d0499ec716012df5d0ee23b1ca15c" name="PEAR/REST/10.php" role="php">
+ <file md5sum="f826093d96de84737f72ba9490c1b83f" name="PEAR/REST/10.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="7ea6e541c857cc7f4adefd8a22c966e9" name="PEAR/REST/11.php" role="php">
+ <file md5sum="a6a631f981dd11fc7cc2f6d0d013ac7c" name="PEAR/REST/11.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="8a888a2c87a19f29a2119c0d85f70dfe" name="PEAR/REST/13.php" role="php">
+ <file md5sum="ed8469d24eb5db9d1bdb21b659069330" name="PEAR/REST/13.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="70a0def9d2702fafc7264ddebe61371e" name="PEAR/Task/Postinstallscript/rw.php" role="php">
+ <file md5sum="f20637521dbabcfd002226ec16b8f930" name="PEAR/Task/Postinstallscript/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="ab06ffd12966490c3fa611004fbb39c7" name="PEAR/Task/Replace/rw.php" role="php">
+ <file md5sum="87cdd5863eb6524e83d5d04acb4109ad" name="PEAR/Task/Replace/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="808fe2e996f8769a13bea7c3d8c3f44e" name="PEAR/Task/Unixeol/rw.php" role="php">
+ <file md5sum="d3f4a9c730bc95cae4ae7a672551799e" name="PEAR/Task/Unixeol/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="69a14c62ea963a0133fb22dbeec0e180" name="PEAR/Task/Windowseol/rw.php" role="php">
+ <file md5sum="e1285569c9e8cada94eb1ab7cec8a1f0" name="PEAR/Task/Windowseol/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="a52528bae4b917b48e5ad357b849b86e" name="PEAR/Task/Common.php" role="php">
+ <file md5sum="0638ca7f081fd44198d4d204fb7279a1" name="PEAR/Task/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="39cbcd69ee6e2dd74522db72d58cfff5" name="PEAR/Task/Postinstallscript.php" role="php">
+ <file md5sum="e83344102fb91bb9fb45044b75be01f7" name="PEAR/Task/Postinstallscript.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="2e2b4a18c4075d049eb8928520318f67" name="PEAR/Task/Replace.php" role="php">
+ <file md5sum="2f14c6bcb3b76c3a4e6c5d4a88f859e9" name="PEAR/Task/Replace.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="7aa51b2bcaa180c28dba3fbeb74570ac" name="PEAR/Task/Unixeol.php" role="php">
+ <file md5sum="68ce6647b9206194e983b1347034da09" name="PEAR/Task/Unixeol.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="63211f45fca15875d3ea7fd8e8d9eae8" name="PEAR/Task/Windowseol.php" role="php">
+ <file md5sum="6d22302124aacf7467d1f93fed82e804" name="PEAR/Task/Windowseol.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="423fc3e5caf0a4f93632218404fffedb" name="PEAR/Validator/PECL.php" role="php">
+ <file md5sum="b1510b072b2049d2088f5ebb41fe76a9" name="PEAR/Validator/PECL.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="bf7f19661227aa8ad89e014ee2862038" name="PEAR/Autoloader.php" role="php">
+ <file md5sum="b746dd0ceb528f265446b8eea7f27b01" name="PEAR/Autoloader.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="97e77a9cf47dacd9704bb2dbe43ffe33" name="PEAR/Builder.php" role="php">
+ <file md5sum="8efb582ce47139a3f94378a3130f8925" name="PEAR/Builder.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="abbafd91dc1ed660c2ca2705ca30acd0" name="PEAR/ChannelFile.php" role="php">
+ <file md5sum="e90dc9ca7d61b5a9c1ae2a8873d322b0" name="PEAR/ChannelFile.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="60636aa79628bd58099e130405818b4a" name="PEAR/Command.php" role="php">
+ <file md5sum="ec9ba204a1568833097d3f33336b441e" name="PEAR/Command.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="f2b71f456915b24bdc1c78fd254f2b68" name="PEAR/Common.php" role="php">
+ <file md5sum="fbbdcb7fecc5176e1c54ef8c899aab04" name="PEAR/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="faebce48d29c6ad0f4c2c776d6c98e15" name="PEAR/Config.php" role="php">
+ <file md5sum="6f75e34dc8012651727dfdf612c4c719" name="PEAR/Config.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="644660b5315b448fffeab1202bb5a9eb" name="PEAR/DependencyDB.php" role="php">
+ <file md5sum="6038245772250d490cd7f1e57350fc94" name="PEAR/DependencyDB.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="cf3bfe2f4ccafc3d43f7255cc8e9d548" name="PEAR/Dependency2.php" role="php">
+ <file md5sum="4868fc6df1b0a044c8c2003bd9ac38f1" name="PEAR/Dependency2.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="71b88ecc50194a86eebe10e39f06d0da" name="PEAR/Downloader.php" role="php">
+ <file md5sum="98f1ff8ffd4a44455dfb967dd40ad011" name="PEAR/Downloader.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="5e7a672375619abfeb9d847f247189b7" name="PEAR/ErrorStack.php" role="php">
+ <file md5sum="eeb46279dc45a99da7c8219416e368c6" name="PEAR/ErrorStack.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="d3518fed48c3f04e66fdc4e5694d03c1" name="PEAR/Exception.php" role="php">
+ <file md5sum="1c2d338c329c0b30d71a9814bd9da4af" name="PEAR/Exception.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="bc2c2db4ebcf8ae402eb11a312ad4df2" name="PEAR/FixPHP5PEARWarnings.php" role="php" />
- <file md5sum="1a1f503b27488f70f2acf3dee1ef5f74" name="PEAR/Frontend.php" role="php">
+ <file md5sum="13f09b311368d95941240cd4da4ce11d" name="PEAR/Frontend.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="2c5a03a832216edd5089e22798497d1c" name="PEAR/Installer.php" role="php">
+ <file md5sum="e16d609cadd08d4f53f01d16d7039d84" name="PEAR/Installer.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="9bb788f49f17576f7d31e4929d2538c5" name="PEAR/PackageFile.php" role="php">
+ <file md5sum="2e31ebb5efd17623d19df56bbdcecb53" name="PEAR/PackageFile.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="0b0301ec44dc23728bb9487a084d6dcc" name="PEAR/Packager.php" role="php">
+ <file md5sum="2062fa1ab2bb327b7b083b7e7749cb6f" name="PEAR/Packager.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="9ee69625641852e4074dd46873443305" name="PEAR/Registry.php" role="php">
+ <file md5sum="b424ce71c7e9729bba8647c8f033dbc6" name="PEAR/Registry.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="9798b333d64c37f7fea737565a175c71" name="PEAR/REST.php" role="php">
+ <file md5sum="91edc2153284012f47aff10991ec936b" name="PEAR/REST.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="2671d677a3777079a136f8df384fd466" name="PEAR/RunTest.php" role="php">
+ <file md5sum="abc2f4bc11bbc0b6b3d757204086097a" name="PEAR/RunTest.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="c94597a58ce447e3c9b3005820c2aa3f" name="PEAR/Validate.php" role="php">
+ <file md5sum="050cc7ac75d9dc2ab9f81706887f87d7" name="PEAR/Validate.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="6081c461dfc133a431d6a76cceeb1f7d" name="PEAR/XMLParser.php" role="php">
+ <file md5sum="8f0972c7d4da9b7af28872b2ae739f0b" name="PEAR/XMLParser.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" md5sum="d888d06143e3cac0dae78bbb2e761366" name="scripts/pear.bat" role="script">
@@ -8942,27 +9044,26 @@ Bug fixes in 1.9.5.dev1:
<tasks:replace from="@include_path@" to="php_dir" type="pear-config" />
<tasks:unixeol />
</file>
- <file baseinstalldir="/" md5sum="179d763fe0203ba4033b1e14416fe940" name="scripts/pearcmd.php" role="php">
+ <file baseinstalldir="/" md5sum="8288caefe63c6f71d631e014fc72007b" name="scripts/pearcmd.php" role="php">
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
<tasks:replace from="@php_dir@" to="php_dir" type="pear-config" />
<tasks:replace from="@pear_version@" to="version" type="package-info" />
<tasks:replace from="@include_path@" to="php_dir" type="pear-config" />
</file>
- <file baseinstalldir="/" md5sum="cbc2a6d0be8f4e5ec725bf8e5222b603" name="scripts/peclcmd.php" role="php">
+ <file baseinstalldir="/" md5sum="dba5ee0eaf5466a2c46682333b1494a2" name="scripts/peclcmd.php" role="php">
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
<tasks:replace from="@php_dir@" to="php_dir" type="pear-config" />
<tasks:replace from="@pear_version@" to="version" type="package-info" />
<tasks:replace from="@include_path@" to="php_dir" type="pear-config" />
</file>
<file md5sum="45b44486d8090de17b2a8b4211fab247" name="LICENSE" role="doc" />
- <file md5sum="8abe476f25fca35378019c9d12bbe757" name="INSTALL" role="doc" />
+ <file md5sum="eaac3d33068c6e67573ed44155b149ae" name="INSTALL" role="doc" />
<file md5sum="4a49bc83a392934e57af45c70a589fda" name="package.dtd" role="data" />
- <file md5sum="1a8f67d58009372a6cbcddd638b128cf" name="PEAR5.php" role="php" />
- <file md5sum="a188d10ae25015b4eba97cecdb9155db" name="PEAR.php" role="php">
+ <file md5sum="23106d502eaf3f2f545b7b8e6baf537d" name="PEAR.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="3f9216552239643c77f06412fae12bd0" name="README" role="doc" />
- <file md5sum="b3750a146f22e8c9fcad0d5373076884" name="System.php" role="php">
+ <file md5sum="26a5d4a6d2cac6e51cd3463dd37cd7e0" name="README.rst" role="doc" />
+ <file md5sum="8c88b101bfb72540109949d0c07c5f0c" name="System.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="acd010e3bc43c0f72df584acde7b9158" name="template.spec" role="data" />
@@ -9546,7 +9647,7 @@ Bug fixes in 1.9.5.dev1:
</release>
</changelog>
</package>
-
+
/**
* The OS_Guess class
*
@@ -9558,7 +9659,6 @@ Bug fixes in 1.9.5.dev1:
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since PEAR 0.1
*/
@@ -9647,7 +9747,7 @@ class OS_Guess
var $release;
var $extra;
- function OS_Guess($uname = null)
+ function __construct($uname = null)
{
list($this->sysname,
$this->release,
@@ -9883,7 +9983,8 @@ class OS_Guess
* indent-tabs-mode: nil
* c-basic-offset: 4
* End:
- */
+ */
+
/**
* PEAR_ChannelFile_Parser for parsing channel.xml
*
@@ -9894,7 +9995,6 @@ class OS_Guess
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -9950,7 +10050,7 @@ class PEAR_ChannelFile_Parser extends PEAR_XMLParser
$ret->setPackagefile($file, $archive);
return $ret;
}
-}
+}
<login>
<summary>Connects and authenticates to remote server [Deprecated in favor of channel-login]</summary>
<function>doLogin</function>
@@ -9979,7 +10079,7 @@ Logs out from the remote server. This command does not actually
connect to the remote server, it only deletes the stored username and
password from your user configuration.</doc>
</logout>
-</commands>
+</commands>
/**
* PEAR_Command_Auth (login, logout commands)
*
@@ -9991,7 +10091,6 @@ password from your user configuration.</doc>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
* @deprecated since 1.8.0alpha1
@@ -10055,11 +10154,12 @@ password from your user configuration.',
*
* @access public
*/
- function PEAR_Command_Auth(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Channels($ui, $config);
+ parent::__construct($ui, $config);
}
-}
+}
+
<build>
<summary>Build an Extension From C Source</summary>
<function>doBuild</function>
@@ -10068,7 +10168,7 @@ password from your user configuration.',
<doc>[package.xml]
Builds one or more extensions contained in a package.</doc>
</build>
-</commands>
+</commands>
/**
* PEAR_Command_Auth (build command)
*
@@ -10081,7 +10181,6 @@ Builds one or more extensions contained in a package.</doc>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -10123,9 +10222,9 @@ Builds one or more extensions contained in a package.'
*
* @access public
*/
- function PEAR_Command_Build(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function doBuild($command, $options, $params)
@@ -10152,7 +10251,8 @@ Builds one or more extensions contained in a package.'
$this->ui->outputData(rtrim($data), 'build');
}
}
-}
+}
+
<list-channels>
<summary>List Available Channels</summary>
<function>doList</function>
@@ -10274,7 +10374,7 @@ the default channel is used. This command does not actually connect to the
remote server, it only deletes the stored username and password from your user
configuration.</doc>
</channel-logout>
-</commands>
+</commands>
// /* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* PEAR_Command_Channels (list-channels, update-channels, channel-delete, channel-add,
@@ -10288,7 +10388,6 @@ configuration.</doc>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -10443,9 +10542,9 @@ configuration.',
*
* @access public
*/
- function PEAR_Command_Channels(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function _sortChannels($a, $b)
@@ -11156,7 +11255,8 @@ configuration.',
$this->config->store();
return true;
}
-}
+}
+
/**
* PEAR_Command_Common base class
*
@@ -11168,7 +11268,6 @@ configuration.',
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -11239,9 +11338,9 @@ class PEAR_Command_Common extends PEAR
*
* @access public
*/
- function PEAR_Command_Common(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR();
+ parent::__construct();
$this->config = &$config;
$this->ui = &$ui;
}
@@ -11428,7 +11527,8 @@ class PEAR_Command_Common extends PEAR
return $this->$func($command, $options, $params);
}
-}
+}
+
<config-show>
<summary>Show All Settings</summary>
<function>doConfigShow</function>
@@ -11519,7 +11619,7 @@ PEAR installation (using the --remoteconfig option of install, upgrade,
and uninstall).
</doc>
</config-create>
-</commands>
+</commands>
/**
* PEAR_Command_Config (config-show, config-get, config-set, config-help, config-create commands)
*
@@ -11531,7 +11631,6 @@ and uninstall).
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -11654,9 +11753,9 @@ and uninstall).
*
* @access public
*/
- function PEAR_Command_Config(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function doConfigShow($command, $options, $params)
@@ -11932,7 +12031,8 @@ and uninstall).
return false;
}
-}
+}
+
<install>
<summary>Install Package</summary>
<function>doInstall</function>
@@ -12207,7 +12307,7 @@ package if needed.
Run post-installation scripts in package &lt;package&gt;, if any exist.
</doc>
</run-scripts>
-</commands>
+</commands>
/**
* PEAR_Command_Install (install, upgrade, upgrade-all, uninstall, bundle, run-scripts commands)
*
@@ -12219,7 +12319,6 @@ Run post-installation scripts in package &lt;package&gt;, if any exist.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -12522,9 +12621,9 @@ Run post-installation scripts in package <package>, if any exist.
*
* @access public
*/
- function PEAR_Command_Install(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
// }}}
@@ -12979,18 +13078,7 @@ Run post-installation scripts in package <package>, if any exist.
$exttype = 'extension';
$extpath = $pinfo[1]['basename'];
} else {
- if (version_compare(PHP_VERSION, '5.3.0', '<')) {
- ob_start();
- phpinfo(INFO_GENERAL);
- $info = ob_get_contents();
- ob_end_clean();
- $debug = function_exists('leak') ? '_debug' : '';
- $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : '';
- } else {
- $debug = '';
- $ts = '';
- }
- $exttype = 'zend_extension' . $debug . $ts;
+ $exttype = 'zend_extension';
$extpath = $atts['installed_as'];
}
$extrainfo[] = 'You should add "' . $exttype . '=' .
@@ -13482,7 +13570,7 @@ Run post-installation scripts in package <package>, if any exist.
return $ret;
}
}
-PEAR-1.9.5/PEAR/Command/Mirror.xml
+
<download-all>
<summary>Downloads each available package from the default channel</summary>
<function>doDownloadAll</function>
@@ -13499,7 +13587,7 @@ Requests a list of available packages from the default channel ({config default_
and downloads them to current working directory. Note: only
packages within preferred_state ({config preferred_state}) will be downloaded</doc>
</download-all>
-</commands>
+</commands>
/**
* PEAR_Command_Mirror (download-all command)
*
@@ -13510,7 +13598,6 @@ packages within preferred_state ({config preferred_state}) will be downloaded</d
* @author Alexander Merz <alexmerz@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.2.0
*/
@@ -13561,9 +13648,9 @@ packages within preferred_state ({config preferred_state}) will be downloaded'
* @param object PEAR_Frontend a reference to an frontend
* @param object PEAR_Config a reference to the configuration data
*/
- function PEAR_Command_Mirror(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
/**
@@ -13637,7 +13724,8 @@ packages within preferred_state ({config preferred_state}) will be downloaded'
return true;
}
-}
+}
+
<package>
<summary>Build Package</summary>
<function>doPackage</function>
@@ -13873,7 +13961,7 @@ This is not the most intelligent conversion, and should only be
used for automated conversion or learning the format.
</doc>
</convert>
-</commands>
+</commands>
/**
* PEAR_Command_Package (package, package-validate, cvsdiff, cvstag, package-dependencies,
* sign, makerpm, convert commands)
@@ -13887,7 +13975,6 @@ used for automated conversion or learning the format.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -14158,9 +14245,9 @@ used for automated conversion or learning the format.
*
* @access public
*/
- function PEAR_Command_Package(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function _displayValidationResults($err, $warn, $strict = false)
@@ -14997,7 +15084,7 @@ used for automated conversion or learning the format.
return true;
}
}
-
+
<pickle>
<summary>Build PECL Package</summary>
<function>doPackage</function>
@@ -15032,7 +15119,7 @@ uses any of these features, you are best off using PEAR_PackageFileManager to
generate both package.xml.
</doc>
</pickle>
-</commands>
+</commands>
/**
* PEAR_Command_Pickle (pickle command)
*
@@ -15043,7 +15130,6 @@ generate both package.xml.
* @author Greg Beaver <cellog@php.net>
* @copyright 2005-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.1
*/
@@ -15110,9 +15196,9 @@ generate both package.xml.
*
* @access public
*/
- function PEAR_Command_Pickle(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
/**
@@ -15452,7 +15538,8 @@ generate both package.xml.
$gen = &$pf->getDefaultGenerator();
$gen->toPackageFile('.');
}
-}
+}
+
<list>
<summary>List Installed Packages In The Default Channel</summary>
<function>doList</function>
@@ -15509,7 +15596,7 @@ Displays information about a package. The package argument may be a
local package file, an URL to a package file, or the name of an
installed package.</doc>
</info>
-</commands>
+</commands>
/**
* PEAR_Command_Registry (list, list-files, shell-test, info commands)
*
@@ -15521,7 +15608,6 @@ installed package.</doc>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -15609,9 +15695,9 @@ installed package.'
*
* @access public
*/
- function PEAR_Command_Registry(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function _sortinfo($a, $b)
@@ -16653,7 +16739,8 @@ installed package.'
$data['raw'] = $obj->getArray(); // no validation needed
$this->ui->outputData($data, 'package-info');
}
-}
+}
+
<remote-info>
<summary>Information About Remote Packages</summary>
<function>doRemoteInfo</function>
@@ -16761,7 +16848,7 @@ Clear the XML-RPC/REST cache. See also the cache_ttl configuration
parameter.
</doc>
</clear-cache>
-</commands>
+</commands>
/**
* PEAR_Command_Remote (remote-info, list-upgrades, remote-list, search, list-all, download,
* clear-cache commands)
@@ -16774,7 +16861,6 @@ parameter.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -16918,9 +17004,9 @@ parameter.
*
* @access public
*/
- function PEAR_Command_Remote(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function _checkChannelForStatus($channel, $chan)
@@ -17570,7 +17656,8 @@ parameter.
$this->ui->outputData(rtrim($output), $command);
return $num;
}
-}
+}
+
<run-tests>
<summary>Run Regression Tests</summary>
<function>doRunTests</function>
@@ -17623,7 +17710,7 @@ If none is found, all .phpt tests will be tried instead.</doc>
<doc>[testfile|dir ...]
Run regression tests with PHP&#039;s regression testing script (run-tests.php).</doc>
</run-tests>
-</commands>
+</commands>
/**
* PEAR_Command_Test (run-tests)
*
@@ -17636,7 +17723,6 @@ Run regression tests with PHP&#039;s regression testing script (run-tests.php).<
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -17712,6 +17798,10 @@ If none is found, all .phpt tests will be tried instead.',
'shortopt' => 'x',
'doc' => 'Generate a code coverage report (requires Xdebug 2.0.0+)',
),
+ 'showdiff' => array(
+ 'shortopt' => 'd',
+ 'doc' => 'Output diff on test failure',
+ ),
),
'doc' => '[testfile|dir ...]
Run regression tests with PHP\'s regression testing script (run-tests.php).',
@@ -17725,9 +17815,9 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).',
*
* @access public
*/
- function PEAR_Command_Test(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
function doRunTests($command, $options, $params)
@@ -17962,7 +18052,8 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).',
}
return $this->raiseError('Some tests failed');
}
-}
+}
+
/**
* PEAR_Downloader_Package
*
@@ -17973,7 +18064,6 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).',
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -18094,7 +18184,7 @@ class PEAR_Downloader_Package
/**
* @param PEAR_Downloader
*/
- function PEAR_Downloader_Package(&$downloader)
+ function __construct(&$downloader)
{
$this->_downloader = &$downloader;
$this->_config = &$this->_downloader->config;
@@ -19947,7 +20037,8 @@ class PEAR_Downloader_Package
return $info;
}
-}
+}
+
/**
* PEAR_Frontend_CLI
*
@@ -19959,7 +20050,6 @@ class PEAR_Downloader_Package
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -19996,9 +20086,9 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
'normal' => '',
);
- function PEAR_Frontend_CLI()
+ function __construct()
{
- parent::PEAR();
+ parent::__construct();
$term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1
if (function_exists('posix_isatty') && !posix_isatty(1)) {
// output is being redirected to a file or through a pipe
@@ -20697,7 +20787,8 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
{
print $text;
}
-}
+}
+
/**
* Base class for all installation roles.
*
@@ -20708,7 +20799,6 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -20738,7 +20828,7 @@ class PEAR_Installer_Role_Common
/**
* @param PEAR_Config
*/
- function PEAR_Installer_Role_Common(&$config)
+ function __construct(&$config)
{
$this->config = $config;
}
@@ -20870,7 +20960,8 @@ class PEAR_Installer_Role_Common
return $roleInfo['phpextension'];
}
}
-?>
+?>
+
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -20884,7 +20975,7 @@ class PEAR_Installer_Role_Common
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Cfg
*
@@ -20895,7 +20986,6 @@ class PEAR_Installer_Role_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 2007-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.7.0
*/
@@ -20989,7 +21079,7 @@ class PEAR_Installer_Role_Cfg extends PEAR_Installer_Role_Common
return $test;
}
-}
+}
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -21003,7 +21093,7 @@ class PEAR_Installer_Role_Cfg extends PEAR_Installer_Role_Common
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Data
*
@@ -21014,7 +21104,6 @@ class PEAR_Installer_Role_Cfg extends PEAR_Installer_Role_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21030,7 +21119,7 @@ class PEAR_Installer_Role_Cfg extends PEAR_Installer_Role_Common
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -21044,7 +21133,7 @@ class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Doc
*
@@ -21055,7 +21144,6 @@ class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21071,7 +21159,7 @@ class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>extbin</releasetypes>
<releasetypes>zendextbin</releasetypes>
<installable>1</installable>
@@ -21082,7 +21170,7 @@ class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
<executable />
<phpextension>1</phpextension>
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Ext
*
@@ -21093,7 +21181,6 @@ class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21109,7 +21196,7 @@ class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -21123,7 +21210,7 @@ class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Php
*
@@ -21134,7 +21221,6 @@ class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21150,7 +21236,7 @@ class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -21164,7 +21250,7 @@ class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
<executable>1</executable>
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Script
*
@@ -21175,7 +21261,6 @@ class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21191,7 +21276,7 @@ class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>extsrc</releasetypes>
<releasetypes>zendextsrc</releasetypes>
<installable>1</installable>
@@ -21202,7 +21287,7 @@ class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Src
*
@@ -21213,7 +21298,6 @@ class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21235,7 +21319,7 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
$installer->source_files++;
}
}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -21249,7 +21333,7 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Test
*
@@ -21260,7 +21344,6 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21276,7 +21359,7 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -21290,7 +21373,7 @@ class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Www
*
@@ -21301,7 +21384,6 @@ class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 2007-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.7.0
*/
@@ -21317,7 +21399,7 @@ class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
* @since Class available since Release 1.7.0
*/
class PEAR_Installer_Role_Www extends PEAR_Installer_Role_Common {}
-?>
+?>
/**
* PEAR_Installer_Role
*
@@ -21328,7 +21410,6 @@ class PEAR_Installer_Role_Www extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21592,7 +21673,7 @@ class PEAR_Installer_Role
PEAR_Installer_Role::getValidRoles('****', true);
return true;
}
-}
+}
/**
* package.xml generation class, package.xml version 1.0
*
@@ -21603,7 +21684,6 @@ class PEAR_Installer_Role
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -21633,7 +21713,7 @@ class PEAR_PackageFile_Generator_v1
* @var PEAR_PackageFile_v1
*/
var $_packagefile;
- function PEAR_PackageFile_Generator_v1(&$packagefile)
+ function __construct(&$packagefile)
{
$this->_packagefile = &$packagefile;
}
@@ -21762,9 +21842,6 @@ class PEAR_PackageFile_Generator_v1
*/
function _fixXmlEncoding($string)
{
- if (version_compare(phpversion(), '5.0.0', 'lt')) {
- $string = utf8_encode($string);
- }
return strtr($string, array(
'&' => '&amp;',
'>' => '&gt;',
@@ -22875,7 +22952,8 @@ class PEAR_PackageFile_Generator_v1
return $ret;
}
}
-?>
+?>
+
/**
* package.xml generation class, package.xml version 2.0
*
@@ -22887,7 +22965,6 @@ class PEAR_PackageFile_Generator_v1
* @author Stephan Schmidt (original XML_Serializer code)
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -22977,7 +23054,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
/**
* @param PEAR_PackageFile_v2
*/
- function PEAR_PackageFile_Generator_v2(&$packagefile)
+ function __construct(&$packagefile)
{
$this->_packagefile = &$packagefile;
if (isset($this->_packagefile->encoding)) {
@@ -23746,12 +23823,6 @@ http://pear.php.net/dtd/package-2.0.xsd',
}
if (is_scalar($tag['content']) || is_null($tag['content'])) {
- if ($this->options['encoding'] == 'UTF-8' &&
- version_compare(phpversion(), '5.0.0', 'lt')
- ) {
- $tag['content'] = utf8_encode($tag['content']);
- }
-
if ($replaceEntities === true) {
$replaceEntities = XML_UTIL_ENTITIES_XML;
}
@@ -23768,7 +23839,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
return $tag;
}
}
-
+
/**
* package.xml parsing class, package.xml version 1.0
*
@@ -23779,7 +23850,6 @@ http://pear.php.net/dtd/package-2.0.xsd',
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -24226,7 +24296,7 @@ class PEAR_PackageFile_Parser_v1
// }}}
}
-?>
+?>
/**
* package.xml parsing class, package.xml version 2.0
*
@@ -24237,7 +24307,6 @@ class PEAR_PackageFile_Parser_v1
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -24338,7 +24407,7 @@ class PEAR_PackageFile_Parser_v2 extends PEAR_XMLParser
$ret->setPackagefile($file, $archive);
return $ret;
}
-}
+}
/**
* PEAR_PackageFile_v2, package.xml version 2.0, read/write version
*
@@ -24349,7 +24418,6 @@ class PEAR_PackageFile_Parser_v2 extends PEAR_XMLParser
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a8
*/
@@ -25941,7 +26009,7 @@ class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
{
unset($this->_packageInfo['changelog']);
}
-}
+}
/**
* PEAR_PackageFile_v2, package.xml version 2.0, read/write version
*
@@ -25952,7 +26020,6 @@ class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a8
*/
@@ -27924,25 +27991,6 @@ class PEAR_PackageFile_v2_Validator
$look_for = $token;
continue 2;
case T_STRING:
- if (version_compare(zend_version(), '2.0', '<')) {
- if (in_array(strtolower($data),
- array('public', 'private', 'protected', 'abstract',
- 'interface', 'implements', 'throw')
- )
- ) {
- if (isset($this->_stack)) {
- $this->_stack->push(__FUNCTION__, 'warning', array(
- 'file' => $file),
- 'Error, PHP5 token encountered in %file%,' .
- ' analysis should be in PHP5');
- } else {
- PEAR::raiseError('Error: PHP5 token encountered in ' . $file .
- 'packaging should be done in PHP 5');
- return false;
- }
- }
- }
-
if ($look_for == T_CLASS) {
$current_class = $data;
$current_class_level = $brace_level;
@@ -28096,7 +28144,7 @@ class PEAR_PackageFile_v2_Validator
return $providesret;
}
}
-
+
/**
* PEAR_PackageFile_v1, package.xml version 1.0
*
@@ -28107,7 +28155,6 @@ class PEAR_PackageFile_v2_Validator
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -28444,7 +28491,7 @@ class PEAR_PackageFile_v1
* @param bool determines whether to return a PEAR_Error object, or use the PEAR_ErrorStack
* @param string Name of Error Stack class to use.
*/
- function PEAR_PackageFile_v1()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v1');
$this->_stack->setErrorMessageTemplate($this->_getErrorMessage());
@@ -29564,15 +29611,6 @@ class PEAR_PackageFile_v1
$look_for = $token;
continue 2;
case T_STRING:
- if (version_compare(zend_version(), '2.0', '<')) {
- if (in_array(strtolower($data),
- array('public', 'private', 'protected', 'abstract',
- 'interface', 'implements', 'throw')
- )) {
- $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_PHP5,
- array($file));
- }
- }
if ($look_for == T_CLASS) {
$current_class = $data;
$current_class_level = $brace_level;
@@ -29708,7 +29746,7 @@ class PEAR_PackageFile_v1
// }}}
}
?>
-
+
/**
* PEAR_PackageFile_v2, package.xml version 2.0
*
@@ -29719,7 +29757,6 @@ class PEAR_PackageFile_v1
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -29839,7 +29876,7 @@ class PEAR_PackageFile_v2
/**
* The constructor merely sets up the private error stack
*/
- function PEAR_PackageFile_v2()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v2', false, null);
$this->_isValid = false;
@@ -30887,6 +30924,9 @@ class PEAR_PackageFile_v2
$contents['dir']['file'] = array($contents['dir']['file']);
}
foreach ($contents['dir']['file'] as $file) {
+ if (!isset($file['attribs']['name'])) {
+ continue;
+ }
$name = $file['attribs']['name'];
if (!$preserve) {
$file = $file['attribs'];
@@ -31757,7 +31797,7 @@ class PEAR_PackageFile_v2
}
}
?>
-
+
/**
* PEAR_REST_10
*
@@ -31768,7 +31808,6 @@ class PEAR_PackageFile_v2
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a12
*/
@@ -31796,7 +31835,7 @@ class PEAR_REST_10
* @var PEAR_REST
*/
var $_rest;
- function PEAR_REST_10($config, $options = array())
+ function __construct($config, $options = array())
{
$this->_rest = new PEAR_REST($config, $options);
}
@@ -32627,7 +32666,8 @@ class PEAR_REST_10
return 1;
}
}
-}
+}
+
/**
* PEAR_REST_11 - implement faster list-all/remote-list command
*
@@ -32638,7 +32678,6 @@ class PEAR_REST_10
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.3
*/
@@ -32667,7 +32706,7 @@ class PEAR_REST_11
*/
var $_rest;
- function PEAR_REST_11($config, $options = array())
+ function __construct($config, $options = array())
{
$this->_rest = new PEAR_REST($config, $options);
}
@@ -32967,7 +33006,8 @@ class PEAR_REST_11
return array_slice($states, $i + 1);
}
}
-?>PEAR-1.9.5/PEAR/REST/13.php
+?>
+
/**
* PEAR_REST_13
*
@@ -32978,7 +33018,6 @@ class PEAR_REST_11
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a12
*/
@@ -33265,20 +33304,19 @@ class PEAR_REST_13 extends PEAR_REST_10
return $this->_returnDownloadURL($base, $package, $release, $info, $found, $skippedphp, $channel);
}
-}
+}
/**
* <tasks:postinstallscript> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -33302,30 +33340,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
*
* @var PEAR_PackageFile_v2_rw
*/
- var $_pkg;
+ public $_pkg;
/**
* Enter description here...
*
- * @param PEAR_PackageFile_v2_rw $pkg
- * @param PEAR_Config $config
- * @param PEAR_Frontend $logger
- * @param array $fileXml
+ * @param PEAR_PackageFile_v2_rw $pkg Package
+ * @param PEAR_Config $config Config
+ * @param PEAR_Frontend $logger Logger
+ * @param array $fileXml XML
+ *
* @return PEAR_Task_Postinstallscript_rw
*/
- function PEAR_Task_Postinstallscript_rw(&$pkg, &$config, &$logger, $fileXml)
+ function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
}
- function getName()
+ public function getName()
{
return 'postinstallscript';
}
@@ -33340,30 +33379,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
*
* Use {@link addConditionTypeGroup()} to add a <paramgroup> containing
* a <conditiontype> tag
- * @param string $id <paramgroup> id as seen by the script
- * @param array|false $params array of getParam() calls, or false for no params
+ *
+ * @param string $id <paramgroup> id as seen by the script
+ * @param array|false $params array of getParam() calls, or false for no params
* @param string|false $instructions
*/
- function addParamGroup($id, $params = false, $instructions = false)
+ public function addParamGroup($id, $params = false, $instructions = false)
{
if ($params && isset($params[0]) && !isset($params[1])) {
$params = $params[0];
}
$stuff =
array(
- $this->_pkg->getTasksNs() . ':id' => $id,
+ $this->_pkg->getTasksNs().':id' => $id,
);
if ($instructions) {
- $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions;
+ $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions;
}
if ($params) {
- $stuff[$this->_pkg->getTasksNs() . ':param'] = $params;
+ $stuff[$this->_pkg->getTasksNs().':param'] = $params;
}
- $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff;
+ $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff;
}
/**
- * add a complex <paramgroup> to the post-install script with conditions
+ * Add a complex <paramgroup> to the post-install script with conditions
*
* This inserts a <paramgroup> with
*
@@ -33374,79 +33414,91 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
*
* Use {@link addParamGroup()} to add a simple <paramgroup>
*
- * @param string $id <paramgroup> id as seen by the script
- * @param string $oldgroup <paramgroup> id of the section referenced by
- * <conditiontype>
- * @param string $param name of the <param> from the older section referenced
- * by <contitiontype>
- * @param string $value value to match of the parameter
- * @param string $conditiontype one of '=', '!=', 'preg_match'
- * @param array|false $params array of getParam() calls, or false for no params
+ * @param string $id <paramgroup> id as seen by the script
+ * @param string $oldgroup <paramgroup> id of the section referenced by
+ * <conditiontype>
+ * @param string $param name of the <param> from the older section referenced
+ * by <contitiontype>
+ * @param string $value value to match of the parameter
+ * @param string $conditiontype one of '=', '!=', 'preg_match'
+ * @param array|false $params array of getParam() calls, or false for no params
* @param string|false $instructions
*/
- function addConditionTypeGroup($id, $oldgroup, $param, $value, $conditiontype = '=',
- $params = false, $instructions = false)
- {
+ public function addConditionTypeGroup($id,
+ $oldgroup,
+ $param,
+ $value,
+ $conditiontype = '=',
+ $params = false,
+ $instructions = false
+ ) {
if ($params && isset($params[0]) && !isset($params[1])) {
$params = $params[0];
}
$stuff = array(
- $this->_pkg->getTasksNs() . ':id' => $id,
+ $this->_pkg->getTasksNs().':id' => $id,
);
if ($instructions) {
- $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions;
+ $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions;
}
- $stuff[$this->_pkg->getTasksNs() . ':name'] = $oldgroup . '::' . $param;
- $stuff[$this->_pkg->getTasksNs() . ':conditiontype'] = $conditiontype;
- $stuff[$this->_pkg->getTasksNs() . ':value'] = $value;
+ $stuff[$this->_pkg->getTasksNs().':name'] = $oldgroup.'::'.$param;
+ $stuff[$this->_pkg->getTasksNs().':conditiontype'] = $conditiontype;
+ $stuff[$this->_pkg->getTasksNs().':value'] = $value;
if ($params) {
- $stuff[$this->_pkg->getTasksNs() . ':param'] = $params;
+ $stuff[$this->_pkg->getTasksNs().':param'] = $params;
}
- $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff;
+ $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff;
}
- function getXml()
+ public function getXml()
{
return $this->_params;
}
/**
* Use to set up a param tag for use in creating a paramgroup
+ *
+ * @param mixed $name Name of parameter
+ * @param mixed $prompt Prompt
+ * @param string $type Type, defaults to 'string'
+ * @param mixed $default Default value
+ *
* @static
+ * @return array
*/
- function getParam($name, $prompt, $type = 'string', $default = null)
+ public function getParam($name, $prompt, $type = 'string', $default = null)
{
if ($default !== null) {
return
array(
- $this->_pkg->getTasksNs() . ':name' => $name,
- $this->_pkg->getTasksNs() . ':prompt' => $prompt,
- $this->_pkg->getTasksNs() . ':type' => $type,
- $this->_pkg->getTasksNs() . ':default' => $default
+ $this->_pkg->getTasksNs().':name' => $name,
+ $this->_pkg->getTasksNs().':prompt' => $prompt,
+ $this->_pkg->getTasksNs().':type' => $type,
+ $this->_pkg->getTasksNs().':default' => $default,
);
}
+
return
array(
- $this->_pkg->getTasksNs() . ':name' => $name,
- $this->_pkg->getTasksNs() . ':prompt' => $prompt,
- $this->_pkg->getTasksNs() . ':type' => $type,
+ $this->_pkg->getTasksNs().':name' => $name,
+ $this->_pkg->getTasksNs().':prompt' => $prompt,
+ $this->_pkg->getTasksNs().':type' => $type,
);
}
}
-?>
+
/**
* <tasks:replace> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -33465,48 +33517,47 @@ require_once 'PEAR/Task/Replace.php';
*/
class PEAR_Task_Replace_rw extends PEAR_Task_Replace
{
- function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml)
+ public function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
}
- function setInfo($from, $to, $type)
+ public function setInfo($from, $to, $type)
{
$this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type));
}
- function getName()
+ public function getName()
{
return 'replace';
}
- function getXml()
+ public function getXml()
{
return $this->_params;
}
}
-?>
+
/**
* <tasks:unixeol> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -33525,43 +33576,43 @@ require_once 'PEAR/Task/Unixeol.php';
*/
class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol
{
- function PEAR_Task_Unixeol_rw(&$pkg, &$config, &$logger, $fileXml)
+ function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return true;
}
- function getName()
+ public function getName()
{
return 'unixeol';
}
- function getXml()
+ public function getXml()
{
return '';
}
}
-?>
+?>
+
/**
* <tasks:windowseol> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -33569,54 +33620,55 @@ class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol
require_once 'PEAR/Task/Windowseol.php';
/**
* Abstracts the windowseol task xml.
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a10
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a10
*/
class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol
{
- function PEAR_Task_Windowseol_rw(&$pkg, &$config, &$logger, $fileXml)
+ function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return true;
}
- function getName()
+ public function getName()
{
return 'windowseol';
}
- function getXml()
+ public function getXml()
{
return '';
}
}
-?>
+?>
+
/**
* PEAR_Task_Common, base class for installer tasks
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**#@+
* Error codes for task validation routines
@@ -33647,14 +33699,15 @@ define('PEAR_TASK_PACKAGEANDINSTALL', 3);
* This will first replace any instance of @data-dir@ in the test.php file
* with the path to the current data directory. Then, it will include the
* test.php file and run the script it contains to configure the package post-installation.
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a1
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a1
* @abstract
*/
class PEAR_Task_Common
@@ -33667,34 +33720,35 @@ class PEAR_Task_Common
* changes directly to disk
*
* Child task classes must override this property.
+ *
* @access protected
*/
- var $type = 'simple';
+ protected $type = 'simple';
/**
* Determines which install phase this task is executed under
*/
- var $phase = PEAR_TASK_INSTALL;
+ public $phase = PEAR_TASK_INSTALL;
/**
* @access protected
*/
- var $config;
+ protected $config;
/**
* @access protected
*/
- var $registry;
+ protected $registry;
/**
* @access protected
*/
- var $logger;
+ public $logger;
/**
* @access protected
*/
- var $installphase;
+ protected $installphase;
/**
* @param PEAR_Config
* @param PEAR_Common
*/
- function PEAR_Task_Common(&$config, &$logger, $phase)
+ function __construct(&$config, &$logger, $phase)
{
$this->config = &$config;
$this->registry = &$config->getRegistry();
@@ -33707,60 +33761,67 @@ class PEAR_Task_Common
/**
* Validate the basic contents of a task tag.
+ *
* @param PEAR_PackageFile_v2
* @param array
* @param PEAR_Config
* @param array the entire parsed <file> tag
+ *
* @return true|array On error, return an array in format:
- * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...])
+ * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...])
+ *
+ * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in
+ * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and
+ * an array of legal values in
*
- * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in
- * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and an array
- * of legal values in
* @static
* @abstract
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
}
/**
* Initialize a task instance with the parameters
- * @param array raw, parsed xml
- * @param array attributes from the <file> tag containing this task
- * @param string|null last installed version of this package
+ *
+ * @param array raw, parsed xml
+ * @param array attributes from the <file> tag containing this task
+ * @param string|null last installed version of this package
* @abstract
*/
- function init($xml, $fileAttributes, $lastVersion)
+ public function init($xml, $fileAttributes, $lastVersion)
{
}
/**
- * Begin a task processing session. All multiple tasks will be processed after each file
- * has been successfully installed, all simple tasks should perform their task here and
- * return any errors using the custom throwError() method to allow forward compatibility
+ * Begin a task processing session. All multiple tasks will be processed
+ * after each file has been successfully installed, all simple tasks should
+ * perform their task here and return any errors using the custom
+ * throwError() method to allow forward compatibility
*
* This method MUST NOT write out any changes to disk
- * @param PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
- * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ *
+ * @param PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
+ * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
+ * (use $this->throwError), otherwise return the new contents
* @abstract
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
}
/**
- * This method is used to process each of the tasks for a particular multiple class
- * type. Simple tasks need not implement this method.
- * @param array an array of tasks
- * @access protected
+ * This method is used to process each of the tasks for a particular
+ * multiple class type. Simple tasks need not implement this method.
+ *
+ * @param array an array of tasks
+ * @access protected
* @static
* @abstract
*/
- function run($tasks)
+ public function run($tasks)
{
}
@@ -33768,56 +33829,58 @@ class PEAR_Task_Common
* @static
* @final
*/
- function hasPostinstallTasks()
+ public function hasPostinstallTasks()
{
return isset($GLOBALS['_PEAR_TASK_POSTINSTANCES']);
}
- /**
- * @static
- * @final
- */
- function runPostinstallTasks()
- {
- foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) {
- $err = call_user_func(array($class, 'run'),
- $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]);
- if ($err) {
- return PEAR_Task_Common::throwError($err);
- }
- }
- unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']);
+ /**
+ * @static
+ * @final
+ */
+ public function runPostinstallTasks()
+ {
+ foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) {
+ $err = call_user_func(
+ array($class, 'run'),
+ $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]
+ );
+ if ($err) {
+ return PEAR_Task_Common::throwError($err);
+ }
+ }
+ unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']);
}
/**
* Determines whether a role is a script
* @return bool
*/
- function isScript()
+ public function isScript()
{
- return $this->type == 'script';
+ return $this->type == 'script';
}
- function throwError($msg, $code = -1)
+ public function throwError($msg, $code = -1)
{
include_once 'PEAR.php';
+
return PEAR::raiseError($msg, $code);
}
}
-?>
+
/**
* <tasks:postinstallscript>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -33828,85 +33891,96 @@ require_once 'PEAR/Task/Common.php';
*
* Note that post-install scripts are handled separately from installation, by the
* "pear run-scripts" command
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a1
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a1
*/
class PEAR_Task_Postinstallscript extends PEAR_Task_Common
{
- var $type = 'script';
- var $_class;
- var $_params;
- var $_obj;
+ public $type = 'script';
+ public $_class;
+ public $_params;
+ public $_obj;
/**
*
* @var PEAR_PackageFile_v2
*/
- var $_pkg;
- var $_contents;
- var $phase = PEAR_TASK_INSTALL;
+ public $_pkg;
+ public $_contents;
+ public $phase = PEAR_TASK_INSTALL;
/**
* Validate the raw xml at parsing-time.
*
* This also attempts to validate the script to make sure it meets the criteria
* for a post-install script
- * @param PEAR_PackageFile_v2
- * @param array The XML contents of the <postinstallscript> tag
- * @param PEAR_Config
- * @param array the entire parsed <file> tag
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array The XML contents of the <postinstallscript> tag
+ * @param PEAR_Config
+ * @param array the entire parsed <file> tag
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if ($fileXml['role'] != 'php') {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must be role="php"');
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must be role="php"', );
}
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$file = $pkg->getFileContents($fileXml['name']);
if (PEAR::isError($file)) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" is not valid: ' .
- $file->getMessage());
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" is not valid: '.
+ $file->getMessage(), );
} elseif ($file === null) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" could not be retrieved for processing!');
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" could not be retrieved for processing!', );
} else {
$analysis = $pkg->analyzeSourceCode($file, true);
if (!$analysis) {
PEAR::popErrorHandling();
$warnings = '';
foreach ($pkg->getValidationWarnings() as $warn) {
- $warnings .= $warn['message'] . "\n";
+ $warnings .= $warn['message']."\n";
}
- return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "' .
- $fileXml['name'] . '" failed: ' . $warnings);
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "'.
+ $fileXml['name'].'" failed: '.$warnings, );
}
if (count($analysis['declared_classes']) != 1) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must declare exactly 1 class');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must declare exactly 1 class', );
}
$class = $analysis['declared_classes'][0];
- if ($class != str_replace(array('/', '.php'), array('_', ''),
- $fileXml['name']) . '_postinstall') {
+ if ($class != str_replace(
+ array('/', '.php'), array('_', ''),
+ $fileXml['name']
+ ).'_postinstall') {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" class "' . $class . '" must be named "' .
- str_replace(array('/', '.php'), array('_', ''),
- $fileXml['name']) . '_postinstall"');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" class "'.$class.'" must be named "'.
+ str_replace(
+ array('/', '.php'), array('_', ''),
+ $fileXml['name']
+ ).'_postinstall"', );
}
if (!isset($analysis['declared_methods'][$class])) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must declare methods init() and run()');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must declare methods init() and run()', );
}
$methods = array('init' => 0, 'run' => 1);
foreach ($analysis['declared_methods'][$class] as $method) {
@@ -33916,129 +33990,137 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
}
if (count($methods)) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must declare methods init() and run()');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must declare methods init() and run()', );
}
}
PEAR::popErrorHandling();
$definedparams = array();
- $tasksNamespace = $pkg->getTasksNs() . ':';
- if (!isset($xml[$tasksNamespace . 'paramgroup']) && isset($xml['paramgroup'])) {
+ $tasksNamespace = $pkg->getTasksNs().':';
+ if (!isset($xml[$tasksNamespace.'paramgroup']) && isset($xml['paramgroup'])) {
// in order to support the older betas, which did not expect internal tags
// to also use the namespace
$tasksNamespace = '';
}
- if (isset($xml[$tasksNamespace . 'paramgroup'])) {
- $params = $xml[$tasksNamespace . 'paramgroup'];
+ if (isset($xml[$tasksNamespace.'paramgroup'])) {
+ $params = $xml[$tasksNamespace.'paramgroup'];
if (!is_array($params) || !isset($params[0])) {
$params = array($params);
}
foreach ($params as $param) {
- if (!isset($param[$tasksNamespace . 'id'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" <paramgroup> must have ' .
- 'an ' . $tasksNamespace . 'id> tag');
- }
- if (isset($param[$tasksNamespace . 'name'])) {
- if (!in_array($param[$tasksNamespace . 'name'], $definedparams)) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" parameter "' . $param[$tasksNamespace . 'name'] .
- '" has not been previously defined');
- }
- if (!isset($param[$tasksNamespace . 'conditiontype'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace .
- 'conditiontype> tag containing either "=", ' .
- '"!=", or "preg_match"');
- }
- if (!in_array($param[$tasksNamespace . 'conditiontype'],
- array('=', '!=', 'preg_match'))) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace .
- 'conditiontype> tag containing either "=", ' .
- '"!=", or "preg_match"');
- }
- if (!isset($param[$tasksNamespace . 'value'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace .
- 'value> tag containing expected parameter value');
- }
- }
- if (isset($param[$tasksNamespace . 'instructions'])) {
- if (!is_string($param[$tasksNamespace . 'instructions'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" ' . $tasksNamespace . 'instructions> must be simple text');
- }
- }
- if (!isset($param[$tasksNamespace . 'param'])) {
+ if (!isset($param[$tasksNamespace.'id'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" <paramgroup> must have '.
+ 'an '.$tasksNamespace.'id> tag', );
+ }
+ if (isset($param[$tasksNamespace.'name'])) {
+ if (!in_array($param[$tasksNamespace.'name'], $definedparams)) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" parameter "'.$param[$tasksNamespace.'name'].
+ '" has not been previously defined', );
+ }
+ if (!isset($param[$tasksNamespace.'conditiontype'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.
+ 'conditiontype> tag containing either "=", '.
+ '"!=", or "preg_match"', );
+ }
+ if (!in_array(
+ $param[$tasksNamespace.'conditiontype'],
+ array('=', '!=', 'preg_match')
+ )) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.
+ 'conditiontype> tag containing either "=", '.
+ '"!=", or "preg_match"', );
+ }
+ if (!isset($param[$tasksNamespace.'value'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.
+ 'value> tag containing expected parameter value', );
+ }
+ }
+ if (isset($param[$tasksNamespace.'instructions'])) {
+ if (!is_string($param[$tasksNamespace.'instructions'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" '.$tasksNamespace.'instructions> must be simple text', );
+ }
+ }
+ if (!isset($param[$tasksNamespace.'param'])) {
continue; // <param> is no longer required
}
- $subparams = $param[$tasksNamespace . 'param'];
+ $subparams = $param[$tasksNamespace.'param'];
if (!is_array($subparams) || !isset($subparams[0])) {
$subparams = array($subparams);
}
foreach ($subparams as $subparam) {
- if (!isset($subparam[$tasksNamespace . 'name'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter for ' .
- $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] . '" must have ' .
- 'a ' . $tasksNamespace . 'name> tag');
- }
- if (!preg_match('/[a-zA-Z0-9]+/',
- $subparam[$tasksNamespace . 'name'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter "' .
- $subparam[$tasksNamespace . 'name'] .
- '" for ' . $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] .
- '" is not a valid name. Must contain only alphanumeric characters');
- }
- if (!isset($subparam[$tasksNamespace . 'prompt'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter "' .
- $subparam[$tasksNamespace . 'name'] .
- '" for ' . $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace . 'prompt> tag');
- }
- if (!isset($subparam[$tasksNamespace . 'type'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter "' .
- $subparam[$tasksNamespace . 'name'] .
- '" for ' . $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace . 'type> tag');
- }
- $definedparams[] = $param[$tasksNamespace . 'id'] . '::' .
- $subparam[$tasksNamespace . 'name'];
+ if (!isset($subparam[$tasksNamespace.'name'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter for '.
+ $tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].'" must have '.
+ 'a '.$tasksNamespace.'name> tag', );
+ }
+ if (!preg_match(
+ '/[a-zA-Z0-9]+/',
+ $subparam[$tasksNamespace.'name']
+ )) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter "'.
+ $subparam[$tasksNamespace.'name'].
+ '" for '.$tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].
+ '" is not a valid name. Must contain only alphanumeric characters', );
+ }
+ if (!isset($subparam[$tasksNamespace.'prompt'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter "'.
+ $subparam[$tasksNamespace.'name'].
+ '" for '.$tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.'prompt> tag', );
+ }
+ if (!isset($subparam[$tasksNamespace.'type'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter "'.
+ $subparam[$tasksNamespace.'name'].
+ '" for '.$tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.'type> tag', );
+ }
+ $definedparams[] = $param[$tasksNamespace.'id'].'::'.
+ $subparam[$tasksNamespace.'name'];
}
}
}
+
return true;
}
/**
* Initialize a task instance with the parameters
- * @param array raw, parsed xml
- * @param array attributes from the <file> tag containing this task
- * @param string|null last installed version of this package, if any (useful for upgrades)
+ * @param array $xml raw, parsed xml
+ * @param array $fileattribs attributes from the <file> tag containing
+ * this task
+ * @param string|null $lastversion last installed version of this package,
+ * if any (useful for upgrades)
*/
- function init($xml, $fileattribs, $lastversion)
+ public function init($xml, $fileattribs, $lastversion)
{
$this->_class = str_replace('/', '_', $fileattribs['name']);
$this->_filename = $fileattribs['name'];
- $this->_class = str_replace ('.php', '', $this->_class) . '_postinstall';
+ $this->_class = str_replace('.php', '', $this->_class).'_postinstall';
$this->_params = $xml;
$this->_lastversion = $lastversion;
}
@@ -34048,7 +34130,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
*
* @access private
*/
- function _stripNamespace($params = null)
+ public function _stripNamespace($params = null)
{
if ($params === null) {
$params = array();
@@ -34059,7 +34141,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
if (is_array($param)) {
$param = $this->_stripNamespace($param);
}
- $params[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param;
+ $params[str_replace($this->_pkg->getTasksNs().':', '', $i)] = $param;
}
$this->_params = $params;
} else {
@@ -34068,21 +34150,24 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
if (is_array($param)) {
$param = $this->_stripNamespace($param);
}
- $newparams[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param;
+ $newparams[str_replace($this->_pkg->getTasksNs().':', '', $i)] = $param;
}
+
return $newparams;
}
}
/**
- * Unlike other tasks, the installed file name is passed in instead of the file contents,
- * because this task is handled post-installation
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file name
+ * Unlike other tasks, the installed file name is passed in instead of the
+ * file contents, because this task is handled post-installation
+ *
+ * @param mixed $pkg PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string $contents file name
+ *
* @return bool|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError)
+ * (use $this->throwError)
*/
- function startSession($pkg, $contents)
+ public function startSession($pkg, $contents)
{
if ($this->installphase != PEAR_TASK_INSTALL) {
return false;
@@ -34090,56 +34175,63 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
// remove the tasks: namespace if present
$this->_pkg = $pkg;
$this->_stripNamespace();
- $this->logger->log(0, 'Including external post-installation script "' .
- $contents . '" - any errors are in this script');
+ $this->logger->log(
+ 0, 'Including external post-installation script "'.
+ $contents.'" - any errors are in this script'
+ );
include_once $contents;
if (class_exists($this->_class)) {
$this->logger->log(0, 'Inclusion succeeded');
} else {
- return $this->throwError('init of post-install script class "' . $this->_class
- . '" failed');
+ return $this->throwError(
+ 'init of post-install script class "'.$this->_class
+ .'" failed'
+ );
}
- $this->_obj = new $this->_class;
- $this->logger->log(1, 'running post-install script "' . $this->_class . '->init()"');
+ $this->_obj = new $this->_class();
+ $this->logger->log(1, 'running post-install script "'.$this->_class.'->init()"');
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$res = $this->_obj->init($this->config, $pkg, $this->_lastversion);
PEAR::popErrorHandling();
if ($res) {
$this->logger->log(0, 'init succeeded');
} else {
- return $this->throwError('init of post-install script "' . $this->_class .
- '->init()" failed');
+ return $this->throwError(
+ 'init of post-install script "'.$this->_class.
+ '->init()" failed'
+ );
}
$this->_contents = $contents;
+
return true;
}
/**
* No longer used
- * @see PEAR_PackageFile_v2::runPostinstallScripts()
- * @param array an array of tasks
- * @param string install or upgrade
+ *
+ * @see PEAR_PackageFile_v2::runPostinstallScripts()
+ * @param array an array of tasks
+ * @param string install or upgrade
* @access protected
* @static
*/
- function run()
+ public function run()
{
}
}
-?>
+
/**
* <tasks:replace>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -34158,18 +34250,19 @@ require_once 'PEAR/Task/Common.php';
*/
class PEAR_Task_Replace extends PEAR_Task_Common
{
- var $type = 'simple';
- var $phase = PEAR_TASK_PACKAGEANDINSTALL;
- var $_replacements;
+ public $type = 'simple';
+ public $phase = PEAR_TASK_PACKAGEANDINSTALL;
+ public $_replacements;
/**
* Validate the raw xml at parsing-time.
- * @param PEAR_PackageFile_v2
- * @param array raw, parsed xml
- * @param PEAR_Config
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array raw, parsed xml
+ * @param PEAR_Config
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if (!isset($xml['attribs'])) {
return array(PEAR_TASK_ERROR_NOATTRIBS);
@@ -34186,33 +34279,36 @@ class PEAR_Task_Replace extends PEAR_Task_Common
if ($xml['attribs']['type'] == 'pear-config') {
if (!in_array($xml['attribs']['to'], $config->getKeys())) {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'],
- $config->getKeys());
+ $config->getKeys(), );
}
} elseif ($xml['attribs']['type'] == 'php-const') {
if (defined($xml['attribs']['to'])) {
return true;
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'],
- array('valid PHP constant'));
+ array('valid PHP constant'), );
}
} elseif ($xml['attribs']['type'] == 'package-info') {
- if (in_array($xml['attribs']['to'],
+ if (in_array(
+ $xml['attribs']['to'],
array('name', 'summary', 'channel', 'notes', 'extends', 'description',
'release_notes', 'license', 'release-license', 'license-uri',
'version', 'api-version', 'state', 'api-state', 'release_date',
- 'date', 'time'))) {
+ 'date', 'time', )
+ )) {
return true;
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'],
array('name', 'summary', 'channel', 'notes', 'extends', 'description',
'release_notes', 'license', 'release-license', 'license-uri',
'version', 'api-version', 'state', 'api-state', 'release_date',
- 'date', 'time'));
+ 'date', 'time', ), );
}
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type', $xml['attribs']['type'],
- array('pear-config', 'package-info', 'php-const'));
+ array('pear-config', 'package-info', 'php-const'), );
}
+
return true;
}
@@ -34221,7 +34317,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
* @param array raw, parsed xml
* @param unused
*/
- function init($xml, $attribs)
+ public function init($xml, $attribs)
{
$this->_replacements = isset($xml['attribs']) ? array($xml) : $xml;
}
@@ -34230,13 +34326,14 @@ class PEAR_Task_Replace extends PEAR_Task_Common
* Do a package.xml 1.0 replacement, with additional package-info fields available
*
* See validateXml() source for the complete list of allowed fields
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
+ *
+ * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
* @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ * (use $this->throwError), otherwise return the new contents
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
$subst_from = $subst_to = array();
foreach ($this->_replacements as $a) {
@@ -34252,6 +34349,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$to = $chan->getServer();
} else {
$this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]");
+
return false;
}
} else {
@@ -34268,6 +34366,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
}
if (is_null($to)) {
$this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]");
+
return false;
}
} elseif ($a['type'] == 'php-const') {
@@ -34278,6 +34377,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$to = constant($a['to']);
} else {
$this->logger->log(0, "$dest: invalid php-const replacement: $a[to]");
+
return false;
}
} else {
@@ -34285,6 +34385,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$to = $t;
} else {
$this->logger->log(0, "$dest: invalid package-info replacement: $a[to]");
+
return false;
}
}
@@ -34293,28 +34394,30 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$subst_to[] = $to;
}
}
- $this->logger->log(3, "doing " . sizeof($subst_from) .
- " substitution(s) for $dest");
+ $this->logger->log(
+ 3, "doing ".sizeof($subst_from).
+ " substitution(s) for $dest"
+ );
if (sizeof($subst_from)) {
$contents = str_replace($subst_from, $subst_to, $contents);
}
+
return $contents;
}
}
-?>
+
/**
* <tasks:unixeol>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -34333,22 +34436,24 @@ require_once 'PEAR/Task/Common.php';
*/
class PEAR_Task_Unixeol extends PEAR_Task_Common
{
- var $type = 'simple';
- var $phase = PEAR_TASK_PACKAGE;
- var $_replacements;
+ public $type = 'simple';
+ public $phase = PEAR_TASK_PACKAGE;
+ public $_replacements;
/**
* Validate the raw xml at parsing-time.
- * @param PEAR_PackageFile_v2
- * @param array raw, parsed xml
- * @param PEAR_Config
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array raw, parsed xml
+ * @param PEAR_Config
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if ($xml != '') {
return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed');
}
+
return true;
}
@@ -34357,7 +34462,7 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common
* @param array raw, parsed xml
* @param unused
*/
- function init($xml, $attribs)
+ public function init($xml, $attribs)
{
}
@@ -34365,32 +34470,33 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common
* Replace all line endings with line endings customized for the current OS
*
* See validateXml() source for the complete list of allowed fields
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
+ *
+ * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
* @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ * (use $this->throwError), otherwise return the new contents
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
$this->logger->log(3, "replacing all line endings with \\n in $dest");
+
return preg_replace("/\r\n|\n\r|\r|\n/", "\n", $contents);
}
}
-?>
+
/**
* <tasks:windowseol>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -34398,33 +34504,36 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common
require_once 'PEAR/Task/Common.php';
/**
* Implements the windows line endsings file task.
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a1
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a1
*/
class PEAR_Task_Windowseol extends PEAR_Task_Common
{
- var $type = 'simple';
- var $phase = PEAR_TASK_PACKAGE;
- var $_replacements;
+ public $type = 'simple';
+ public $phase = PEAR_TASK_PACKAGE;
+ public $_replacements;
/**
* Validate the raw xml at parsing-time.
- * @param PEAR_PackageFile_v2
- * @param array raw, parsed xml
- * @param PEAR_Config
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array raw, parsed xml
+ * @param PEAR_Config
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if ($xml != '') {
return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed');
}
+
return true;
}
@@ -34433,7 +34542,7 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
* @param array raw, parsed xml
* @param unused
*/
- function init($xml, $attribs)
+ public function init($xml, $attribs)
{
}
@@ -34441,19 +34550,21 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
* Replace all line endings with windows line endings
*
* See validateXml() source for the complete list of allowed fields
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
+ *
+ * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
* @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ * (use $this->throwError), otherwise return the new contents
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
$this->logger->log(3, "replacing all line endings with \\r\\n in $dest");
+
return preg_replace("/\r\n|\n\r|\r|\n/", "\r\n", $contents);
}
}
-?>
+
/**
* Channel Validator for the pecl.php.net channel
*
@@ -34464,7 +34575,6 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a5
*/
@@ -34515,7 +34625,7 @@ class PEAR_Validator_PECL extends PEAR_Validate
return $ret;
}
}
-?>
+?>
/**
* Class auto-loader
*
@@ -34527,7 +34637,6 @@ class PEAR_Validator_PECL extends PEAR_Validate
* @author Stig Bakken <ssb@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader
* @since File available since Release 0.1
* @deprecated File deprecated in Release 1.4.0a1
@@ -34733,7 +34842,7 @@ class PEAR_Autoloader extends PEAR
overload("PEAR_Autoloader");
?>
-
+
/**
* PEAR_Builder for building PHP extensions (PECL packages)
*
@@ -34745,7 +34854,6 @@ overload("PEAR_Autoloader");
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*
@@ -34798,9 +34906,9 @@ class PEAR_Builder extends PEAR_Common
*
* @access public
*/
- function PEAR_Builder(&$ui)
+ function __construct(&$ui)
{
- parent::PEAR_Common();
+ parent::__construct();
$this->setFrontendObject($ui);
}
@@ -35222,7 +35330,7 @@ class PEAR_Builder extends PEAR_Common
return PEAR_Common::log($level, $msg);
}
}
-
+
/**
* PEAR_ChannelFile, the channel handling class
*
@@ -35233,7 +35341,6 @@ class PEAR_Builder extends PEAR_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -35418,7 +35525,7 @@ class PEAR_ChannelFile
*/
var $_isValid = false;
- function PEAR_ChannelFile()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_ChannelFile');
$this->_stack->setErrorMessageTemplate($this->_getErrorMessage());
@@ -36780,7 +36887,8 @@ class PEAR_ChannelFile
return time();
}
-}
+}
+
/**
* PEAR_Command, command pattern class
*
@@ -36792,7 +36900,6 @@ class PEAR_ChannelFile
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -37193,7 +37300,7 @@ class PEAR_Command
return false;
}
// }}}
-}
+}
/**
* PEAR_Common, the base class for the PEAR Installer
*
@@ -37206,7 +37313,6 @@ class PEAR_Command
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1.0
* @deprecated File deprecated since Release 1.4.0a1
@@ -37360,9 +37466,9 @@ class PEAR_Common extends PEAR
*
* @access public
*/
- function PEAR_Common()
+ function __construct()
{
- parent::PEAR();
+ parent::__construct();
$this->config = &PEAR_Config::singleton();
$this->debug = $this->config->get('verbose');
}
@@ -38029,7 +38135,8 @@ class PEAR_Common extends PEAR
}
require_once 'PEAR/Config.php';
-require_once 'PEAR/PackageFile.php';
+require_once 'PEAR/PackageFile.php';
+
/**
* PEAR_Config, customized configuration handling for the PEAR Installer
*
@@ -38041,7 +38148,6 @@ require_once 'PEAR/PackageFile.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -38623,10 +38729,10 @@ class PEAR_Config extends PEAR
*
* @see PEAR_Config::singleton
*/
- function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false,
+ function __construct($user_file = '', $system_file = '', $ftp_file = false,
$strict = true)
{
- $this->PEAR();
+ parent::__construct();
PEAR_Installer_Role::initializeConfig($this);
$sl = DIRECTORY_SEPARATOR;
if (empty($user_file)) {
@@ -40122,7 +40228,7 @@ class PEAR_Config extends PEAR
}
}
}
-
+
/**
* PEAR_DependencyDB, advanced installed packages dependency database
*
@@ -40134,7 +40240,6 @@ class PEAR_Config extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -40884,7 +40989,7 @@ class PEAR_DependencyDB
);
}
}
-}
+}
/**
* PEAR_Dependency2, advanced dependency validation
*
@@ -40895,7 +41000,6 @@ class PEAR_DependencyDB
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -40968,7 +41072,7 @@ class PEAR_Dependency2
* @param array format of PEAR_Registry::parsedPackageName()
* @param int installation state (one of PEAR_VALIDATE_*)
*/
- function PEAR_Dependency2(&$config, $installoptions, $package,
+ function __construct(&$config, $installoptions, $package,
$state = PEAR_VALIDATE_INSTALLING)
{
$this->_config = &$config;
@@ -42242,7 +42346,7 @@ class PEAR_Dependency2
$this->_currentPackage, true)));
}
}
-
+
/**
* PEAR_Downloader, the PEAR Installer's download utility class
*
@@ -42256,7 +42360,6 @@ class PEAR_Dependency2
* @author Martin Jansen <mj@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.0
*/
@@ -42389,22 +42492,26 @@ class PEAR_Downloader extends PEAR_Common
* @param array
* @param PEAR_Config
*/
- function PEAR_Downloader(&$ui, $options, &$config)
+ function __construct($ui = null, $options = array(), $config = null)
{
- parent::PEAR_Common();
+ parent::__construct();
$this->_options = $options;
- $this->config = &$config;
- $this->_preferredState = $this->config->get('preferred_state');
+ if ($config !== null) {
+ $this->config = &$config;
+ $this->_preferredState = $this->config->get('preferred_state');
+ }
$this->ui = &$ui;
if (!$this->_preferredState) {
// don't inadvertantly use a non-set preferred_state
$this->_preferredState = null;
}
- if (isset($this->_options['installroot'])) {
- $this->config->setInstallRoot($this->_options['installroot']);
+ if ($config !== null) {
+ if (isset($this->_options['installroot'])) {
+ $this->config->setInstallRoot($this->_options['installroot']);
+ }
+ $this->_registry = &$config->getRegistry();
}
- $this->_registry = &$config->getRegistry();
if (isset($this->_options['alldeps']) || isset($this->_options['onlyreqdeps'])) {
$this->_installed = $this->_registry->listAllPackages();
@@ -44007,7 +44114,8 @@ class PEAR_Downloader extends PEAR_Common
}
return $dest_file;
}
-}
+}
+
/**
* Error Stack Implementation
*
@@ -44032,7 +44140,6 @@ class PEAR_Downloader extends PEAR_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 2004-2008 Greg Beaver
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR_ErrorStack
*/
@@ -44146,7 +44253,6 @@ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2);
* @category Debugging
* @copyright 2004-2008 Greg Beaver
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR_ErrorStack
*/
class PEAR_ErrorStack {
@@ -44203,43 +44309,43 @@ class PEAR_ErrorStack {
* @access protected
*/
var $_contextCallback = false;
-
+
/**
* If set to a valid callback, this will be called every time an error
* is pushed onto the stack. The return value will be used to determine
* whether to allow an error to be pushed or logged.
- *
+ *
* The return value must be one an PEAR_ERRORSTACK_* constant
* @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG
* @var false|string|array
* @access protected
*/
var $_errorCallback = array();
-
+
/**
* PEAR::Log object for logging errors
* @var false|Log
* @access protected
*/
var $_logger = false;
-
+
/**
* Error messages - designed to be overridden
* @var array
* @abstract
*/
var $_errorMsgs = array();
-
+
/**
* Set up a new error stack
- *
+ *
* @param string $package name of the package this error stack represents
* @param callback $msgCallback callback used for error message generation
* @param callback $contextCallback callback used for context generation,
* defaults to {@link getFileLine()}
* @param boolean $throwPEAR_Error
*/
- function PEAR_ErrorStack($package, $msgCallback = false, $contextCallback = false,
+ function __construct($package, $msgCallback = false, $contextCallback = false,
$throwPEAR_Error = false)
{
$this->_package = $package;
@@ -44992,7 +45098,7 @@ class PEAR_ErrorStack {
$stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack');
$stack->pushCallback(array('PEAR_ErrorStack', '_handleError'));
?>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
/**
* PEAR_Exception
@@ -45007,7 +45113,6 @@ $stack->pushCallback(array('PEAR_ErrorStack', '_handleError'));
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.3
*/
@@ -45380,13 +45485,7 @@ class PEAR_Exception extends Exception
}
return $causeMsg . $this->getTraceAsString();
}
-}
-if ($skipmsg) {
- $a = new $ec($code, $mode, $options, $userinfo);
-} else {
- $a = new $ec($message, $code, $mode, $options, $userinfo);
-}
-?>
+}
/**
* PEAR_Frontend, the singleton-based frontend for user input/output
*
@@ -45397,7 +45496,6 @@ if ($skipmsg) {
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -45613,7 +45711,7 @@ class PEAR_Frontend extends PEAR
function userDialog($command, $prompts, $types = array(), $defaults = array())
{
}
-}
+}
/**
* PEAR_Installer
*
@@ -45627,7 +45725,6 @@ class PEAR_Frontend extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -45731,9 +45828,9 @@ class PEAR_Installer extends PEAR_Downloader
*
* @access public
*/
- function PEAR_Installer(&$ui)
+ function __construct(&$ui)
{
- parent::PEAR_Common();
+ parent::__construct($ui, array(), null);
$this->setFrontendObject($ui);
$this->debug = $this->config->get('verbose');
}
@@ -47438,7 +47535,8 @@ class PEAR_Installer extends PEAR_Downloader
}
// }}}
-}
+}
+
/**
* PEAR_PackageFile, package.xml parsing utility class
*
@@ -47449,7 +47547,6 @@ class PEAR_Installer extends PEAR_Downloader
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -47507,7 +47604,7 @@ class PEAR_PackageFile
* @param string @tmpdir Optional temporary directory for uncompressing
* files
*/
- function PEAR_PackageFile(&$config, $debug = false)
+ function __construct(&$config, $debug = false)
{
$this->_config = $config;
$this->_debug = $debug;
@@ -47929,7 +48026,8 @@ class PEAR_PackageFile
$info = PEAR::raiseError("Cannot open '$info' for parsing");
return $info;
}
-}
+}
+
/**
* PEAR_Packager for generating releases
*
@@ -47942,7 +48040,6 @@ class PEAR_PackageFile
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -48129,7 +48226,7 @@ class PEAR_Packager extends PEAR_Common
return $dest_package;
}
-}
+}
/**
* PEAR_Registry
*
@@ -48142,7 +48239,6 @@ class PEAR_Packager extends PEAR_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -48262,10 +48358,10 @@ class PEAR_Registry extends PEAR
*
* @access public
*/
- function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false,
+ function __construct($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false,
$pecl_channel = false)
{
- parent::PEAR();
+ parent::__construct();
$this->setInstallDir($pear_install_dir);
$this->_pearChannel = $pear_channel;
$this->_peclChannel = $pecl_channel;
@@ -50514,7 +50610,8 @@ class PEAR_Registry extends PEAR
}
return $ret;
}
-}
+}
+
/**
* PEAR_REST
*
@@ -50525,7 +50622,6 @@ class PEAR_Registry extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -50553,7 +50649,7 @@ class PEAR_REST
var $config;
var $_options;
- function PEAR_REST(&$config, $options = array())
+ function __construct(&$config, $options = array())
{
$this->config = &$config;
$this->_options = $options;
@@ -51004,7 +51100,7 @@ class PEAR_REST
return $data;
}
}
-
+
/**
* PEAR_RunTest
*
@@ -51016,7 +51112,6 @@ class PEAR_REST
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.3
*/
@@ -51066,7 +51161,6 @@ class PEAR_RunTest
var $ini_overwrites = array(
'output_handler=',
'open_basedir=',
- 'safe_mode=0',
'disable_functions=',
'output_buffering=Off',
'display_errors=1',
@@ -51089,7 +51183,7 @@ class PEAR_RunTest
* An object that supports the PEAR_Common->log() signature, or null
* @param PEAR_Common|null
*/
- function PEAR_RunTest($logger = null, $options = array())
+ function __construct($logger = null, $options = array())
{
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 0);
@@ -51120,19 +51214,11 @@ class PEAR_RunTest
function system_with_timeout($commandline, $env = null, $stdin = null)
{
$data = '';
- if (version_compare(phpversion(), '5.0.0', '<')) {
- $proc = proc_open($commandline, array(
- 0 => array('pipe', 'r'),
- 1 => array('pipe', 'w'),
- 2 => array('pipe', 'w')
- ), $pipes);
- } else {
- $proc = proc_open($commandline, array(
- 0 => array('pipe', 'r'),
- 1 => array('pipe', 'w'),
- 2 => array('pipe', 'w')
- ), $pipes, null, $env, array('suppress_errors' => true));
- }
+ $proc = proc_open($commandline, array(
+ 0 => array('pipe', 'r'),
+ 1 => array('pipe', 'w'),
+ 2 => array('pipe', 'w')
+ ), $pipes, null, $env, array('suppress_errors' => true));
if (!$proc) {
return false;
@@ -51236,12 +51322,7 @@ class PEAR_RunTest
function _preparePhpBin($php, $file, $ini_settings)
{
$file = escapeshellarg($file);
- // This was fixed in php 5.3 and is not needed after that
- if (OS_WINDOWS && version_compare(PHP_VERSION, '5.3', '<')) {
- $cmd = '"'.escapeshellarg($php).' '.$ini_settings.' -f ' . $file .'"';
- } else {
- $cmd = $php . $ini_settings . ' -f ' . $file;
- }
+ $cmd = $php . $ini_settings . ' -f ' . $file;
return $cmd;
}
@@ -51643,6 +51724,11 @@ class PEAR_RunTest
$expectf = isset($section_text['EXPECTF']) ? $wanted_re : null;
$data = $this->generate_diff($wanted, $output, $returns, $expectf);
$res = $this->_writeLog($diff_filename, $data);
+ if (isset($this->_options['showdiff'])) {
+ $this->_logger->log(0, "========DIFF========");
+ $this->_logger->log(0, $data);
+ $this->_logger->log(0, "========DONE========");
+ }
if (PEAR::isError($res)) {
return $res;
}
@@ -51986,7 +52072,7 @@ $text
}
}
}
-
+
/**
* PEAR_Validate
*
@@ -51997,7 +52083,6 @@ $text
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -52614,7 +52699,7 @@ class PEAR_Validate
{
return true;
}
-}
+}
/**
* PEAR_XMLParser
*
@@ -52626,7 +52711,6 @@ class PEAR_Validate
* @author Stephan Schmidt (original XML_Unserializer code)
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -52711,11 +52795,6 @@ class PEAR_XMLParser
$this->encoding = 'UTF-8';
}
- if (version_compare(phpversion(), '5.0.0', 'lt') && $this->encoding == 'UTF-8') {
- $data = utf8_decode($data);
- $this->encoding = 'ISO-8859-1';
- }
-
$xp = xml_parser_create($this->encoding);
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, 0);
xml_set_object($xp, $this);
@@ -52866,7 +52945,7 @@ class PEAR_XMLParser
{
$this->_dataStack[$this->_depth] .= $cdata;
}
-}
+}
REM ----------------------------------------------------------------------
REM PHP version 5
@@ -52976,7 +53055,7 @@ GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
-@ECHO ON
+@ECHO ON
REM ----------------------------------------------------------------------
REM PHP version 5
@@ -53090,7 +53169,7 @@ GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -d date.timezone=UTC -d memory_limit="-1" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d open_basedir="" -d output_buffering=1 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
-@ECHO ON
+@ECHO ON
REM ----------------------------------------------------------------------
REM PHP version 5
@@ -53204,7 +53283,7 @@ GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -n -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -d register_argc_argv="On" -d variables_order=EGPCS -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
-@ECHO ON
+@ECHO ON
# first find which PHP binary to use
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
@@ -53232,7 +53311,7 @@ else
fi
exec $PHP -C -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d open_basedir="" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" $INCDIR/pearcmd.php "$@"
-
+
# first find which PHP binary to use
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
@@ -53260,7 +53339,7 @@ else
fi
exec $PHP -d date.timezone=UTC -d memory_limit="-1" -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d variables_order=EGPCS -d auto_append_file="" $INCDIR/pearcmd.php "$@"
-
+
# first find which PHP binary to use
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
@@ -53288,7 +53367,7 @@ else
fi
exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"
-
+
/**
* PEAR, the PHP Extension and Application Repository
*
@@ -53302,7 +53381,6 @@ exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variabl
* @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
*/
@@ -53325,9 +53403,7 @@ if ('@include_path@ ' != '@'.'include_path'.'@ ') {
$raw = true;
}
@ini_set('allow_url_fopen', true);
-if (!ini_get('safe_mode')) {
- @set_time_limit(0);
-}
+@set_time_limit(0);
ob_implicit_flush(true);
@ini_set('track_errors', true);
@ini_set('html_errors', false);
@@ -53370,18 +53446,14 @@ $opts = $options[0];
$fetype = 'CLI';
if ($progname == 'gpear' || $progname == 'pear-gtk') {
- $fetype = 'Gtk';
+ $fetype = 'Gtk2';
} else {
foreach ($opts as $opt) {
if ($opt[0] == 'G') {
- $fetype = 'Gtk';
+ $fetype = 'Gtk2';
}
}
}
-//Check if Gtk and PHP >= 5.1.0
-if ($fetype == 'Gtk' && version_compare(phpversion(), '5.1.0', '>=')) {
- $fetype = 'Gtk2';
-}
$pear_user_config = '';
$pear_system_config = '';
@@ -53425,14 +53497,6 @@ if (PEAR::isError($config)) {
$_PEAR_PHPDIR = $config->get('php_dir');
$ui->setConfig($config);
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError"));
-if (ini_get('safe_mode')) {
- $ui->outputData(
- 'WARNING: running in safe mode requires that all files ' .
- 'created be the same uid as the current script. ' .
- 'PHP reports this script is uid: ' . @getmyuid() .
- ', and current user is: ' . @get_current_user()
- );
-}
$verbose = $config->get("verbose");
$cmdopts = array();
@@ -53555,7 +53619,7 @@ if (empty($command) && ($store_user_config || $store_system_config)) {
exit;
}
-if ($fetype == 'Gtk' || $fetype == 'Gtk2') {
+if ($fetype == 'Gtk2') {
if (!$config->validConfiguration()) {
PEAR::raiseError(
"CRITICAL ERROR: no existing valid configuration files found in " .
@@ -53750,26 +53814,26 @@ function cmdHelp($command)
*/
function error_handler($errno, $errmsg, $file, $line, $vars)
{
- if ((defined('E_STRICT')
- && $errno & E_STRICT)
- || (defined('E_DEPRECATED')
- && $errno & E_DEPRECATED)
+ if ($errno & E_STRICT
+ || $errno & E_DEPRECATED
|| !error_reporting()
) {
- if (defined('E_STRICT') && $errno & E_STRICT) {
+ if ($errno & E_STRICT) {
return; // E_STRICT
}
- if (defined('E_DEPRECATED') && $errno & E_DEPRECATED) {
+ if ($errno & E_DEPRECATED) {
return; // E_DEPRECATED
}
- if ($GLOBALS['config']->get('verbose') < 4) {
+ if (isset($GLOBALS['config']) && $GLOBALS['config']->get('verbose') < 4) {
return false; // @silenced error, show all if debug is high enough
}
}
$errortype = array (
+ E_DEPRECATED => 'Deprecated Warning',
E_ERROR => "Error",
E_WARNING => "Warning",
E_PARSE => "Parsing Error",
+ E_STRICT => 'Strict Warning',
E_NOTICE => "Notice",
E_CORE_ERROR => "Core Error",
E_CORE_WARNING => "Core Warning",
@@ -53800,7 +53864,7 @@ function error_handler($errno, $errmsg, $file, $line, $vars)
* End:
*/
// vim600:syn=php
-
+
/**
* PEAR, the PHP Extension and Application Repository
*
@@ -53814,7 +53878,6 @@ function error_handler($errno, $errmsg, $file, $line, $vars)
* @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
*/
@@ -53843,7 +53906,7 @@ require_once 'pearcmd.php';
// vim600:syn=php
?>
-
+
Stig Bakken <ssb@php.net>,
Gregory Beaver <cellog@php.net>,
Helgi Þormar Þorbjörnsson <helgi@php.net>,
@@ -53870,7 +53933,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
=========================
Installing the PEAR Installer.
@@ -53922,8 +53985,7 @@ a public mailing list devoted to support for PEAR packages and installation-
related issues.
Happy PHPing, we hope PEAR will be a great tool for your development work!
-
-$Id$
+
$Id: package.dtd,v 1.38 2005-11-12 02:23:07 cellog Exp $
This is the PEAR package description, version 1.0.
@@ -54026,39 +54088,7 @@ $Id$
to CDATA #REQUIRED>
-
-/**
- * This is only meant for PHP 5 to get rid of certain strict warning
- * that doesn't get hidden since it's in the shutdown function
- */
-class PEAR5
-{
- /**
- * If you have a class that's mostly/entirely static, and you need static
- * properties, you can use this method to simulate them. Eg. in your method(s)
- * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
- * You MUST use a reference, or they will not persist!
- *
- * @access public
- * @param string $class The calling classname, to prevent clashes
- * @param string $var The variable to retrieve.
- * @return mixed A reference to the variable. If not set it will be
- * auto initialised to NULL.
- */
- static function &getStaticProperty($class, $var)
- {
- static $properties;
- if (!isset($properties[$class])) {
- $properties[$class] = array();
- }
-
- if (!array_key_exists($var, $properties[$class])) {
- $properties[$class][$var] = null;
- }
-
- return $properties[$class][$var];
- }
-}
+
/**
* PEAR, the PHP Extension and Application Repository
*
@@ -54074,7 +54104,6 @@ class PEAR5
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2010 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -54093,8 +54122,6 @@ define('PEAR_ERROR_CALLBACK', 16);
*/
define('PEAR_ERROR_EXCEPTION', 32);
/**#@-*/
-define('PEAR_ZE2', (function_exists('version_compare') &&
- version_compare(zend_version(), "2-dev", "ge")));
if (substr(PHP_OS, 0, 3) == 'WIN') {
define('OS_WINDOWS', true);
@@ -54206,7 +54233,7 @@ class PEAR
* @access public
* @return void
*/
- function PEAR($error_class = null)
+ function __construct($error_class = null)
{
$classname = strtolower(get_class($this));
if ($this->_debug) {
@@ -54234,6 +54261,18 @@ class PEAR
}
/**
+ * Only here for backwards compatibility.
+ * E.g. Archive_Tar calls $this->PEAR() in its constructor.
+ *
+ * @param string $error_class Which class to use for error objects,
+ * defaults to PEAR_Error.
+ */
+ public function PEAR($error_class = null)
+ {
+ $this->__construct($error_class);
+ }
+
+ /**
* Destructor (the emulated type of...). Does nothing right now,
* but is included for forward compatibility, so subclass
* destructors should always call it.
@@ -54262,7 +54301,7 @@ class PEAR
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
- function &getStaticProperty($class, $var)
+ static function &getStaticProperty($class, $var)
{
static $properties;
if (!isset($properties[$class])) {
@@ -54581,12 +54620,6 @@ class PEAR
$ec = 'PEAR_Error';
}
- if (intval(PHP_VERSION) < 5) {
- // little non-eval hack to fix bug #12147
- include 'PEAR/FixPHP5PEARWarnings.php';
- return $a;
- }
-
if ($skipmsg) {
$a = new $ec($code, $mode, $options, $userinfo);
} else {
@@ -54764,8 +54797,7 @@ class PEAR
// if either returns true dl() will produce a FATAL error, stop that
if (
function_exists('dl') === false ||
- ini_get('enable_dl') != 1 ||
- ini_get('safe_mode') == 1
+ ini_get('enable_dl') != 1
) {
return false;
}
@@ -54786,10 +54818,6 @@ class PEAR
}
}
-if (PEAR_ZE2) {
- include_once 'PEAR5.php';
-}
-
function _PEAR_call_destructors()
{
global $_PEAR_destructor_object_list;
@@ -54797,11 +54825,8 @@ function _PEAR_call_destructors()
sizeof($_PEAR_destructor_object_list))
{
reset($_PEAR_destructor_object_list);
- if (PEAR_ZE2) {
- $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo');
- } else {
- $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
- }
+
+ $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
if ($destructLifoExists) {
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
@@ -54883,7 +54908,7 @@ class PEAR_Error
* @access public
*
*/
- function PEAR_Error($message = 'unknown error', $code = null,
+ function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
@@ -54894,11 +54919,7 @@ class PEAR_Error
$this->mode = $mode;
$this->userinfo = $userinfo;
- if (PEAR_ZE2) {
- $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace');
- } else {
- $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
- }
+ $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
if (!$skiptrace) {
$this->backtrace = debug_backtrace();
@@ -55121,47 +55142,48 @@ class PEAR_Error
* c-basic-offset: 4
* End:
*/
-
+
=========================
-What is the PEAR Installer? What is PEAR?
-
+What is the PEAR Installer? What is PEAR?
+------------------------------------------
PEAR is the PHP Extension and Application Repository, found at
-http://pear.php.net. The PEAR Installer is this software, which
-contains executable files and PHP code that is used to download
-and install PEAR code from pear.php.net.
+http://pear.php.net.
-PEAR contains useful software libraries and applications such as
+The **PEAR Installer** is this software, which contains executable
+files and PHP code that is used to **download and install** PEAR code
+from pear.php.net.
+
+PEAR contains useful **software libraries and applications** such as
MDB2 (database abstraction), HTML_QuickForm (HTML forms management),
PhpDocumentor (auto-documentation generator), DB_DataObject
-(Data Access Abstraction), and many hundreds more. Browse all
-available packages at http://pear.php.net, the list is constantly
-growing and updating to reflect improvements in the PHP language.
+(Data Access Abstraction), and many hundreds more.
+Browse all available packages at http://pear.php.net, the list is
+constantly growing and updating to reflect improvements in the PHP language.
+
+.. warning::
+ Do not run PEAR without installing it - if you downloaded this
+ tarball manually, you MUST install it. Read the instructions in INSTALL
+ prior to use.
-DOCUMENTATION
-=============
+Documentation
+-------------
Documentation for PEAR can be found at http://pear.php.net/manual/.
Installation documentation can be found in the INSTALL file included
in this tarball.
-WARNING: DO NOT RUN PEAR WITHOUT INSTALLING IT - if you downloaded this
-tarball manually, you MUST install it. Read the instructions in INSTALL
-prior to use.
-
-
-Happy PHPing, we hope PEAR will be a great tool for your development work!
-
Tests
-=====
-
-Run the tests without installation as follows:
+-----
+Run the tests without installation as follows::
$ ./scripts/pear.sh run-tests -r tests
-You should have the Text_Diff package installed to get nicer error output.
-
+You should have the ``Text_Diff`` package installed to get nicer error output.
+
+Happy PHPing, we hope PEAR will be a great tool for your development work!
+
/**
* File/Directory manipulation
*
@@ -55172,7 +55194,6 @@ You should have the Text_Diff package installed to get nicer error output.
* @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -55685,13 +55706,11 @@ class System
$path_elements[] = dirname($program);
$program = basename($program);
} else {
- // Honor safe mode
- if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) {
- $path = getenv('PATH');
- if (!$path) {
- $path = getenv('Path'); // some OSes are just stupid enough to do this
- }
+ $path = getenv('PATH');
+ if (!$path) {
+ $path = getenv('Path'); // some OSes are just stupid enough to do this
}
+
$path_elements = explode(PATH_SEPARATOR, $path);
}
@@ -55703,17 +55722,14 @@ class System
if (strpos($program, '.') !== false) {
array_unshift($exe_suffixes, '');
}
- // is_executable() is not available on windows for PHP4
- $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file';
} else {
$exe_suffixes = array('');
- $pear_is_executable = 'is_executable';
}
foreach ($exe_suffixes as $suff) {
foreach ($path_elements as $dir) {
$file = $dir . DIRECTORY_SEPARATOR . $program . $suff;
- if (@$pear_is_executable($file)) {
+ if (is_executable($file)) {
return $file;
}
}
@@ -55807,7 +55823,7 @@ class System
}
return $files;
}
-}
+}
Name: @rpm_package@
Version: @version@
Release: 1
@@ -55895,7 +55911,6 @@ cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2010 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -55914,8 +55929,6 @@ define('PEAR_ERROR_CALLBACK', 16);
*/
define('PEAR_ERROR_EXCEPTION', 32);
/**#@-*/
-define('PEAR_ZE2', (function_exists('version_compare') &&
- version_compare(zend_version(), "2-dev", "ge")));
if (substr(PHP_OS, 0, 3) == 'WIN') {
define('OS_WINDOWS', true);
@@ -56027,7 +56040,7 @@ class PEAR
* @access public
* @return void
*/
- function PEAR($error_class = null)
+ function __construct($error_class = null)
{
$classname = strtolower(get_class($this));
if ($this->_debug) {
@@ -56055,6 +56068,18 @@ class PEAR
}
/**
+ * Only here for backwards compatibility.
+ * E.g. Archive_Tar calls $this->PEAR() in its constructor.
+ *
+ * @param string $error_class Which class to use for error objects,
+ * defaults to PEAR_Error.
+ */
+ public function PEAR($error_class = null)
+ {
+ $this->__construct($error_class);
+ }
+
+ /**
* Destructor (the emulated type of...). Does nothing right now,
* but is included for forward compatibility, so subclass
* destructors should always call it.
@@ -56083,7 +56108,7 @@ class PEAR
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
- function &getStaticProperty($class, $var)
+ static function &getStaticProperty($class, $var)
{
static $properties;
if (!isset($properties[$class])) {
@@ -56402,12 +56427,6 @@ class PEAR
$ec = 'PEAR_Error';
}
- if (intval(PHP_VERSION) < 5) {
- // little non-eval hack to fix bug #12147
- include 'phar://install-pear-nozlib.phar/' . 'PEAR/FixPHP5PEARWarnings.php';
- return $a;
- }
-
if ($skipmsg) {
$a = new $ec($code, $mode, $options, $userinfo);
} else {
@@ -56585,8 +56604,7 @@ class PEAR
// if either returns true dl() will produce a FATAL error, stop that
if (
function_exists('dl') === false ||
- ini_get('enable_dl') != 1 ||
- ini_get('safe_mode') == 1
+ ini_get('enable_dl') != 1
) {
return false;
}
@@ -56607,10 +56625,6 @@ class PEAR
}
}
-if (PEAR_ZE2) {
- include_once 'phar://install-pear-nozlib.phar/' . 'PEAR5.php';
-}
-
function _PEAR_call_destructors()
{
global $_PEAR_destructor_object_list;
@@ -56618,11 +56632,8 @@ function _PEAR_call_destructors()
sizeof($_PEAR_destructor_object_list))
{
reset($_PEAR_destructor_object_list);
- if (PEAR_ZE2) {
- $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo');
- } else {
- $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
- }
+
+ $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
if ($destructLifoExists) {
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
@@ -56704,7 +56715,7 @@ class PEAR_Error
* @access public
*
*/
- function PEAR_Error($message = 'unknown error', $code = null,
+ function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
@@ -56715,11 +56726,7 @@ class PEAR_Error
$this->mode = $mode;
$this->userinfo = $userinfo;
- if (PEAR_ZE2) {
- $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace');
- } else {
- $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
- }
+ $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
if (!$skiptrace) {
$this->backtrace = debug_backtrace();
@@ -56953,7 +56960,6 @@ class PEAR_Error
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -57138,7 +57144,7 @@ class PEAR_ChannelFile
*/
var $_isValid = false;
- function PEAR_ChannelFile()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_ChannelFile');
$this->_stack->setErrorMessageTemplate($this->_getErrorMessage());
@@ -58500,7 +58506,8 @@ class PEAR_ChannelFile
return time();
}
-}<?php
+}
+<?php
/**
* PEAR_ChannelFile_Parser for parsing channel.xml
*
@@ -58511,7 +58518,6 @@ class PEAR_ChannelFile
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -58579,7 +58585,6 @@ class PEAR_ChannelFile_Parser extends PEAR_XMLParser
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -58992,7 +58997,6 @@ class PEAR_Command
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -59063,9 +59067,9 @@ class PEAR_Command_Common extends PEAR
*
* @access public
*/
- function PEAR_Command_Common(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR();
+ parent::__construct();
$this->config = &$config;
$this->ui = &$ui;
}
@@ -59252,7 +59256,8 @@ class PEAR_Command_Common extends PEAR
return $this->$func($command, $options, $params);
}
-}<?php
+}
+<?php
/**
* PEAR_Command_Install (install, upgrade, upgrade-all, uninstall, bundle, run-scripts commands)
*
@@ -59264,7 +59269,6 @@ class PEAR_Command_Common extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -59567,9 +59571,9 @@ Run post-installation scripts in package <package>, if any exist.
*
* @access public
*/
- function PEAR_Command_Install(&$ui, &$config)
+ function __construct(&$ui, &$config)
{
- parent::PEAR_Command_Common($ui, $config);
+ parent::__construct($ui, $config);
}
// }}}
@@ -60024,18 +60028,7 @@ Run post-installation scripts in package <package>, if any exist.
$exttype = 'extension';
$extpath = $pinfo[1]['basename'];
} else {
- if (version_compare(PHP_VERSION, '5.3.0', '<')) {
- ob_start();
- phpinfo(INFO_GENERAL);
- $info = ob_get_contents();
- ob_end_clean();
- $debug = function_exists('leak') ? '_debug' : '';
- $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : '';
- } else {
- $debug = '';
- $ts = '';
- }
- $exttype = 'zend_extension' . $debug . $ts;
+ $exttype = 'zend_extension';
$extpath = $atts['installed_as'];
}
$extrainfo[] = 'You should add "' . $exttype . '=' .
@@ -60815,7 +60808,6 @@ Run post-installation scripts in package &lt;package&gt;, if any exist.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1.0
* @deprecated File deprecated since Release 1.4.0a1
@@ -60969,9 +60961,9 @@ class PEAR_Common extends PEAR
*
* @access public
*/
- function PEAR_Common()
+ function __construct()
{
- parent::PEAR();
+ parent::__construct();
$this->config = &PEAR_Config::singleton();
$this->debug = $this->config->get('verbose');
}
@@ -61638,7 +61630,8 @@ class PEAR_Common extends PEAR
}
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Config.php';
-require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/PackageFile.php';<?php
+require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/PackageFile.php';
+<?php
/**
* PEAR_Config, customized configuration handling for the PEAR Installer
*
@@ -61650,7 +61643,6 @@ require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/PackageFile.php';<?php
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -62232,10 +62224,10 @@ class PEAR_Config extends PEAR
*
* @see PEAR_Config::singleton
*/
- function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false,
+ function __construct($user_file = '', $system_file = '', $ftp_file = false,
$strict = true)
{
- $this->PEAR();
+ parent::__construct();
PEAR_Installer_Role::initializeConfig($this);
$sl = DIRECTORY_SEPARATOR;
if (empty($user_file)) {
@@ -63742,7 +63734,6 @@ class PEAR_Config extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -63815,7 +63806,7 @@ class PEAR_Dependency2
* @param array format of PEAR_Registry::parsedPackageName()
* @param int installation state (one of PEAR_VALIDATE_*)
*/
- function PEAR_Dependency2(&$config, $installoptions, $package,
+ function __construct(&$config, $installoptions, $package,
$state = PEAR_VALIDATE_INSTALLING)
{
$this->_config = &$config;
@@ -65101,7 +65092,6 @@ class PEAR_Dependency2
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -65865,7 +65855,6 @@ class PEAR_DependencyDB
* @author Martin Jansen <mj@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.0
*/
@@ -65998,22 +65987,26 @@ class PEAR_Downloader extends PEAR_Common
* @param array
* @param PEAR_Config
*/
- function PEAR_Downloader(&$ui, $options, &$config)
+ function __construct($ui = null, $options = array(), $config = null)
{
- parent::PEAR_Common();
+ parent::__construct();
$this->_options = $options;
- $this->config = &$config;
- $this->_preferredState = $this->config->get('preferred_state');
+ if ($config !== null) {
+ $this->config = &$config;
+ $this->_preferredState = $this->config->get('preferred_state');
+ }
$this->ui = &$ui;
if (!$this->_preferredState) {
// don't inadvertantly use a non-set preferred_state
$this->_preferredState = null;
}
- if (isset($this->_options['installroot'])) {
- $this->config->setInstallRoot($this->_options['installroot']);
+ if ($config !== null) {
+ if (isset($this->_options['installroot'])) {
+ $this->config->setInstallRoot($this->_options['installroot']);
+ }
+ $this->_registry = &$config->getRegistry();
}
- $this->_registry = &$config->getRegistry();
if (isset($this->_options['alldeps']) || isset($this->_options['onlyreqdeps'])) {
$this->_installed = $this->_registry->listAllPackages();
@@ -67616,7 +67609,8 @@ class PEAR_Downloader extends PEAR_Common
}
return $dest_file;
}
-}<?php
+}
+<?php
/**
* PEAR_Downloader_Package
*
@@ -67627,7 +67621,6 @@ class PEAR_Downloader extends PEAR_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -67748,7 +67741,7 @@ class PEAR_Downloader_Package
/**
* @param PEAR_Downloader
*/
- function PEAR_Downloader_Package(&$downloader)
+ function __construct(&$downloader)
{
$this->_downloader = &$downloader;
$this->_config = &$this->_downloader->config;
@@ -69601,7 +69594,8 @@ class PEAR_Downloader_Package
return $info;
}
-}<?php
+}
+<?php
/**
* Error Stack Implementation
*
@@ -69626,7 +69620,6 @@ class PEAR_Downloader_Package
* @author Greg Beaver <cellog@php.net>
* @copyright 2004-2008 Greg Beaver
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR_ErrorStack
*/
@@ -69740,7 +69733,6 @@ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2);
* @category Debugging
* @copyright 2004-2008 Greg Beaver
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR_ErrorStack
*/
class PEAR_ErrorStack {
@@ -69797,43 +69789,43 @@ class PEAR_ErrorStack {
* @access protected
*/
var $_contextCallback = false;
-
+
/**
* If set to a valid callback, this will be called every time an error
* is pushed onto the stack. The return value will be used to determine
* whether to allow an error to be pushed or logged.
- *
+ *
* The return value must be one an PEAR_ERRORSTACK_* constant
* @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG
* @var false|string|array
* @access protected
*/
var $_errorCallback = array();
-
+
/**
* PEAR::Log object for logging errors
* @var false|Log
* @access protected
*/
var $_logger = false;
-
+
/**
* Error messages - designed to be overridden
* @var array
* @abstract
*/
var $_errorMsgs = array();
-
+
/**
* Set up a new error stack
- *
+ *
* @param string $package name of the package this error stack represents
* @param callback $msgCallback callback used for error message generation
* @param callback $contextCallback callback used for context generation,
* defaults to {@link getFileLine()}
* @param boolean $throwPEAR_Error
*/
- function PEAR_ErrorStack($package, $msgCallback = false, $contextCallback = false,
+ function __construct($package, $msgCallback = false, $contextCallback = false,
$throwPEAR_Error = false)
{
$this->_package = $package;
@@ -70597,7 +70589,6 @@ $stack->pushCallback(array('PEAR_ErrorStack', '_handleError'));
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -70825,7 +70816,6 @@ class PEAR_Frontend extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -70862,9 +70852,9 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
'normal' => '',
);
- function PEAR_Frontend_CLI()
+ function __construct()
{
- parent::PEAR();
+ parent::__construct();
$term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1
if (function_exists('posix_isatty') && !posix_isatty(1)) {
// output is being redirected to a file or through a pipe
@@ -71563,7 +71553,8 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
{
print $text;
}
-}<?php
+}
+<?php
/**
* PEAR_Installer
*
@@ -71577,7 +71568,6 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -71681,9 +71671,9 @@ class PEAR_Installer extends PEAR_Downloader
*
* @access public
*/
- function PEAR_Installer(&$ui)
+ function __construct(&$ui)
{
- parent::PEAR_Common();
+ parent::__construct($ui, array(), null);
$this->setFrontendObject($ui);
$this->debug = $this->config->get('verbose');
}
@@ -73388,7 +73378,8 @@ class PEAR_Installer extends PEAR_Downloader
}
// }}}
-}<?php
+}
+<?php
/**
* PEAR_Installer_Role
*
@@ -73399,7 +73390,6 @@ class PEAR_Installer extends PEAR_Downloader
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -73674,7 +73664,6 @@ class PEAR_Installer_Role
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -73704,7 +73693,7 @@ class PEAR_Installer_Role_Common
/**
* @param PEAR_Config
*/
- function PEAR_Installer_Role_Common(&$config)
+ function __construct(&$config)
{
$this->config = $config;
}
@@ -73836,7 +73825,8 @@ class PEAR_Installer_Role_Common
return $roleInfo['phpextension'];
}
}
-?><?php
+?>
+<?php
/**
* PEAR_Installer_Role_Data
*
@@ -73847,7 +73837,6 @@ class PEAR_Installer_Role_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -73888,7 +73877,6 @@ class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -73929,7 +73917,6 @@ class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -73970,7 +73957,6 @@ class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -74011,7 +73997,6 @@ class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -74052,7 +74037,6 @@ class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -74110,7 +74094,7 @@ class PEAR_PackageFile
* @param string @tmpdir Optional temporary directory for uncompressing
* files
*/
- function PEAR_PackageFile(&$config, $debug = false)
+ function __construct(&$config, $debug = false)
{
$this->_config = $config;
$this->_debug = $debug;
@@ -74532,7 +74516,8 @@ class PEAR_PackageFile
$info = PEAR::raiseError("Cannot open '$info' for parsing");
return $info;
}
-}<?php
+}
+<?php
/**
* package.xml generation class, package.xml version 1.0
*
@@ -74543,7 +74528,6 @@ class PEAR_PackageFile
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -74573,7 +74557,7 @@ class PEAR_PackageFile_Generator_v1
* @var PEAR_PackageFile_v1
*/
var $_packagefile;
- function PEAR_PackageFile_Generator_v1(&$packagefile)
+ function __construct(&$packagefile)
{
$this->_packagefile = &$packagefile;
}
@@ -74702,9 +74686,6 @@ class PEAR_PackageFile_Generator_v1
*/
function _fixXmlEncoding($string)
{
- if (version_compare(phpversion(), '5.0.0', 'lt')) {
- $string = utf8_encode($string);
- }
return strtr($string, array(
'&' => '&amp;',
'>' => '&gt;',
@@ -75815,7 +75796,8 @@ class PEAR_PackageFile_Generator_v1
return $ret;
}
}
-?><?php
+?>
+<?php
/**
* package.xml generation class, package.xml version 2.0
*
@@ -75827,7 +75809,6 @@ class PEAR_PackageFile_Generator_v1
* @author Stephan Schmidt (original XML_Serializer code)
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -75917,7 +75898,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
/**
* @param PEAR_PackageFile_v2
*/
- function PEAR_PackageFile_Generator_v2(&$packagefile)
+ function __construct(&$packagefile)
{
$this->_packagefile = &$packagefile;
if (isset($this->_packagefile->encoding)) {
@@ -76686,12 +76667,6 @@ http://pear.php.net/dtd/package-2.0.xsd',
}
if (is_scalar($tag['content']) || is_null($tag['content'])) {
- if ($this->options['encoding'] == 'UTF-8' &&
- version_compare(phpversion(), '5.0.0', 'lt')
- ) {
- $tag['content'] = utf8_encode($tag['content']);
- }
-
if ($replaceEntities === true) {
$replaceEntities = XML_UTIL_ENTITIES_XML;
}
@@ -76719,7 +76694,6 @@ http://pear.php.net/dtd/package-2.0.xsd',
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -77177,7 +77151,6 @@ class PEAR_PackageFile_Parser_v1
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -77289,7 +77262,6 @@ class PEAR_PackageFile_Parser_v2 extends PEAR_XMLParser
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -77626,7 +77598,7 @@ class PEAR_PackageFile_v1
* @param bool determines whether to return a PEAR_Error object, or use the PEAR_ErrorStack
* @param string Name of Error Stack class to use.
*/
- function PEAR_PackageFile_v1()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v1');
$this->_stack->setErrorMessageTemplate($this->_getErrorMessage());
@@ -78746,15 +78718,6 @@ class PEAR_PackageFile_v1
$look_for = $token;
continue 2;
case T_STRING:
- if (version_compare(zend_version(), '2.0', '<')) {
- if (in_array(strtolower($data),
- array('public', 'private', 'protected', 'abstract',
- 'interface', 'implements', 'throw')
- )) {
- $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_PHP5,
- array($file));
- }
- }
if ($look_for == T_CLASS) {
$current_class = $data;
$current_class_level = $brace_level;
@@ -78901,7 +78864,6 @@ class PEAR_PackageFile_v1
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -79021,7 +78983,7 @@ class PEAR_PackageFile_v2
/**
* The constructor merely sets up the private error stack
*/
- function PEAR_PackageFile_v2()
+ function __construct()
{
$this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v2', false, null);
$this->_isValid = false;
@@ -80069,6 +80031,9 @@ class PEAR_PackageFile_v2
$contents['dir']['file'] = array($contents['dir']['file']);
}
foreach ($contents['dir']['file'] as $file) {
+ if (!isset($file['attribs']['name'])) {
+ continue;
+ }
$name = $file['attribs']['name'];
if (!$preserve) {
$file = $file['attribs'];
@@ -80950,7 +80915,6 @@ class PEAR_PackageFile_v2
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a8
*/
@@ -82922,25 +82886,6 @@ class PEAR_PackageFile_v2_Validator
$look_for = $token;
continue 2;
case T_STRING:
- if (version_compare(zend_version(), '2.0', '<')) {
- if (in_array(strtolower($data),
- array('public', 'private', 'protected', 'abstract',
- 'interface', 'implements', 'throw')
- )
- ) {
- if (isset($this->_stack)) {
- $this->_stack->push(__FUNCTION__, 'warning', array(
- 'file' => $file),
- 'Error, PHP5 token encountered in %file%,' .
- ' analysis should be in PHP5');
- } else {
- PEAR::raiseError('Error: PHP5 token encountered in ' . $file .
- 'packaging should be done in PHP 5');
- return false;
- }
- }
- }
-
if ($look_for == T_CLASS) {
$current_class = $data;
$current_class_level = $brace_level;
@@ -83107,7 +83052,6 @@ class PEAR_PackageFile_v2_Validator
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -83227,10 +83171,10 @@ class PEAR_Registry extends PEAR
*
* @access public
*/
- function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false,
+ function __construct($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false,
$pecl_channel = false)
{
- parent::PEAR();
+ parent::__construct();
$this->setInstallDir($pear_install_dir);
$this->_pearChannel = $pear_channel;
$this->_peclChannel = $pecl_channel;
@@ -85479,7 +85423,8 @@ class PEAR_Registry extends PEAR
}
return $ret;
}
-}<?php
+}
+<?php
/**
* PEAR_REST
*
@@ -85490,7 +85435,6 @@ class PEAR_Registry extends PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -85518,7 +85462,7 @@ class PEAR_REST
var $config;
var $_options;
- function PEAR_REST(&$config, $options = array())
+ function __construct(&$config, $options = array())
{
$this->config = &$config;
$this->_options = $options;
@@ -85980,7 +85924,6 @@ class PEAR_REST
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a12
*/
@@ -86008,7 +85951,7 @@ class PEAR_REST_10
* @var PEAR_REST
*/
var $_rest;
- function PEAR_REST_10($config, $options = array())
+ function __construct($config, $options = array())
{
$this->_rest = new PEAR_REST($config, $options);
}
@@ -86839,7 +86782,8 @@ class PEAR_REST_10
return 1;
}
}
-}<?php
+}
+<?php
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR.php';
require_once 'phar://install-pear-nozlib.phar/' . 'System.php';
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Config.php';
@@ -86914,9 +86858,9 @@ class PEAR_Start extends PEAR
var $tarball = array();
var $ptmp;
- function PEAR_Start()
+ function __construct()
{
- parent::PEAR();
+ parent::__construct();
if (OS_WINDOWS) {
$this->configPrompt['php_bin'] = 'Path to CLI php.exe';
$this->config[] = 'php_bin';
@@ -87306,9 +87250,9 @@ class PEAR_Start_CLI extends PEAR_Start
*/
var $php_bin_sapi;
- function PEAR_Start_CLI()
+ function __construct()
{
- parent::PEAR_Start();
+ parent::construct();
ini_set('html_errors', 0);
define('WIN32GUI', OS_WINDOWS && php_sapi_name() == 'cli' && System::which('cscript'));
$this->tty = OS_WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r');
@@ -87909,20 +87853,20 @@ Double-click this file to add it to the current user registry.
{
}
}
-?><?php
+?>
+<?php
/**
* PEAR_Task_Common, base class for installer tasks
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**#@+
* Error codes for task validation routines
@@ -87953,14 +87897,15 @@ define('PEAR_TASK_PACKAGEANDINSTALL', 3);
* This will first replace any instance of @data-dir@ in the test.php file
* with the path to the current data directory. Then, it will include the
* test.php file and run the script it contains to configure the package post-installation.
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a1
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a1
* @abstract
*/
class PEAR_Task_Common
@@ -87973,34 +87918,35 @@ class PEAR_Task_Common
* changes directly to disk
*
* Child task classes must override this property.
+ *
* @access protected
*/
- var $type = 'simple';
+ protected $type = 'simple';
/**
* Determines which install phase this task is executed under
*/
- var $phase = PEAR_TASK_INSTALL;
+ public $phase = PEAR_TASK_INSTALL;
/**
* @access protected
*/
- var $config;
+ protected $config;
/**
* @access protected
*/
- var $registry;
+ protected $registry;
/**
* @access protected
*/
- var $logger;
+ public $logger;
/**
* @access protected
*/
- var $installphase;
+ protected $installphase;
/**
* @param PEAR_Config
* @param PEAR_Common
*/
- function PEAR_Task_Common(&$config, &$logger, $phase)
+ function __construct(&$config, &$logger, $phase)
{
$this->config = &$config;
$this->registry = &$config->getRegistry();
@@ -88013,60 +87959,67 @@ class PEAR_Task_Common
/**
* Validate the basic contents of a task tag.
+ *
* @param PEAR_PackageFile_v2
* @param array
* @param PEAR_Config
* @param array the entire parsed <file> tag
+ *
* @return true|array On error, return an array in format:
- * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...])
+ * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...])
+ *
+ * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in
+ * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and
+ * an array of legal values in
*
- * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in
- * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and an array
- * of legal values in
* @static
* @abstract
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
}
/**
* Initialize a task instance with the parameters
- * @param array raw, parsed xml
- * @param array attributes from the <file> tag containing this task
- * @param string|null last installed version of this package
+ *
+ * @param array raw, parsed xml
+ * @param array attributes from the <file> tag containing this task
+ * @param string|null last installed version of this package
* @abstract
*/
- function init($xml, $fileAttributes, $lastVersion)
+ public function init($xml, $fileAttributes, $lastVersion)
{
}
/**
- * Begin a task processing session. All multiple tasks will be processed after each file
- * has been successfully installed, all simple tasks should perform their task here and
- * return any errors using the custom throwError() method to allow forward compatibility
+ * Begin a task processing session. All multiple tasks will be processed
+ * after each file has been successfully installed, all simple tasks should
+ * perform their task here and return any errors using the custom
+ * throwError() method to allow forward compatibility
*
* This method MUST NOT write out any changes to disk
- * @param PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
- * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ *
+ * @param PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
+ * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
+ * (use $this->throwError), otherwise return the new contents
* @abstract
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
}
/**
- * This method is used to process each of the tasks for a particular multiple class
- * type. Simple tasks need not implement this method.
- * @param array an array of tasks
- * @access protected
+ * This method is used to process each of the tasks for a particular
+ * multiple class type. Simple tasks need not implement this method.
+ *
+ * @param array an array of tasks
+ * @access protected
* @static
* @abstract
*/
- function run($tasks)
+ public function run($tasks)
{
}
@@ -88074,56 +88027,58 @@ class PEAR_Task_Common
* @static
* @final
*/
- function hasPostinstallTasks()
+ public function hasPostinstallTasks()
{
return isset($GLOBALS['_PEAR_TASK_POSTINSTANCES']);
}
- /**
- * @static
- * @final
- */
- function runPostinstallTasks()
- {
- foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) {
- $err = call_user_func(array($class, 'run'),
- $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]);
- if ($err) {
- return PEAR_Task_Common::throwError($err);
- }
- }
- unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']);
+ /**
+ * @static
+ * @final
+ */
+ public function runPostinstallTasks()
+ {
+ foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) {
+ $err = call_user_func(
+ array($class, 'run'),
+ $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]
+ );
+ if ($err) {
+ return PEAR_Task_Common::throwError($err);
+ }
+ }
+ unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']);
}
/**
* Determines whether a role is a script
* @return bool
*/
- function isScript()
+ public function isScript()
{
- return $this->type == 'script';
+ return $this->type == 'script';
}
- function throwError($msg, $code = -1)
+ public function throwError($msg, $code = -1)
{
include_once 'phar://install-pear-nozlib.phar/' . 'PEAR.php';
+
return PEAR::raiseError($msg, $code);
}
}
-?><?php
+<?php
/**
* <tasks:postinstallscript>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -88134,85 +88089,96 @@ require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Common.php';
*
* Note that post-install scripts are handled separately from installation, by the
* "pear run-scripts" command
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a1
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a1
*/
class PEAR_Task_Postinstallscript extends PEAR_Task_Common
{
- var $type = 'script';
- var $_class;
- var $_params;
- var $_obj;
+ public $type = 'script';
+ public $_class;
+ public $_params;
+ public $_obj;
/**
*
* @var PEAR_PackageFile_v2
*/
- var $_pkg;
- var $_contents;
- var $phase = PEAR_TASK_INSTALL;
+ public $_pkg;
+ public $_contents;
+ public $phase = PEAR_TASK_INSTALL;
/**
* Validate the raw xml at parsing-time.
*
* This also attempts to validate the script to make sure it meets the criteria
* for a post-install script
- * @param PEAR_PackageFile_v2
- * @param array The XML contents of the <postinstallscript> tag
- * @param PEAR_Config
- * @param array the entire parsed <file> tag
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array The XML contents of the <postinstallscript> tag
+ * @param PEAR_Config
+ * @param array the entire parsed <file> tag
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if ($fileXml['role'] != 'php') {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must be role="php"');
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must be role="php"', );
}
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$file = $pkg->getFileContents($fileXml['name']);
if (PEAR::isError($file)) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" is not valid: ' .
- $file->getMessage());
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" is not valid: '.
+ $file->getMessage(), );
} elseif ($file === null) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" could not be retrieved for processing!');
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" could not be retrieved for processing!', );
} else {
$analysis = $pkg->analyzeSourceCode($file, true);
if (!$analysis) {
PEAR::popErrorHandling();
$warnings = '';
foreach ($pkg->getValidationWarnings() as $warn) {
- $warnings .= $warn['message'] . "\n";
+ $warnings .= $warn['message']."\n";
}
- return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "' .
- $fileXml['name'] . '" failed: ' . $warnings);
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "'.
+ $fileXml['name'].'" failed: '.$warnings, );
}
if (count($analysis['declared_classes']) != 1) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must declare exactly 1 class');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must declare exactly 1 class', );
}
$class = $analysis['declared_classes'][0];
- if ($class != str_replace(array('/', '.php'), array('_', ''),
- $fileXml['name']) . '_postinstall') {
+ if ($class != str_replace(
+ array('/', '.php'), array('_', ''),
+ $fileXml['name']
+ ).'_postinstall') {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" class "' . $class . '" must be named "' .
- str_replace(array('/', '.php'), array('_', ''),
- $fileXml['name']) . '_postinstall"');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" class "'.$class.'" must be named "'.
+ str_replace(
+ array('/', '.php'), array('_', ''),
+ $fileXml['name']
+ ).'_postinstall"', );
}
if (!isset($analysis['declared_methods'][$class])) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must declare methods init() and run()');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must declare methods init() and run()', );
}
$methods = array('init' => 0, 'run' => 1);
foreach ($analysis['declared_methods'][$class] as $method) {
@@ -88222,129 +88188,137 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
}
if (count($methods)) {
PEAR::popErrorHandling();
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" must declare methods init() and run()');
+
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" must declare methods init() and run()', );
}
}
PEAR::popErrorHandling();
$definedparams = array();
- $tasksNamespace = $pkg->getTasksNs() . ':';
- if (!isset($xml[$tasksNamespace . 'paramgroup']) && isset($xml['paramgroup'])) {
+ $tasksNamespace = $pkg->getTasksNs().':';
+ if (!isset($xml[$tasksNamespace.'paramgroup']) && isset($xml['paramgroup'])) {
// in order to support the older betas, which did not expect internal tags
// to also use the namespace
$tasksNamespace = '';
}
- if (isset($xml[$tasksNamespace . 'paramgroup'])) {
- $params = $xml[$tasksNamespace . 'paramgroup'];
+ if (isset($xml[$tasksNamespace.'paramgroup'])) {
+ $params = $xml[$tasksNamespace.'paramgroup'];
if (!is_array($params) || !isset($params[0])) {
$params = array($params);
}
foreach ($params as $param) {
- if (!isset($param[$tasksNamespace . 'id'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" <paramgroup> must have ' .
- 'an ' . $tasksNamespace . 'id> tag');
- }
- if (isset($param[$tasksNamespace . 'name'])) {
- if (!in_array($param[$tasksNamespace . 'name'], $definedparams)) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" parameter "' . $param[$tasksNamespace . 'name'] .
- '" has not been previously defined');
- }
- if (!isset($param[$tasksNamespace . 'conditiontype'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace .
- 'conditiontype> tag containing either "=", ' .
- '"!=", or "preg_match"');
- }
- if (!in_array($param[$tasksNamespace . 'conditiontype'],
- array('=', '!=', 'preg_match'))) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace .
- 'conditiontype> tag containing either "=", ' .
- '"!=", or "preg_match"');
- }
- if (!isset($param[$tasksNamespace . 'value'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace .
- 'value> tag containing expected parameter value');
- }
- }
- if (isset($param[$tasksNamespace . 'instructions'])) {
- if (!is_string($param[$tasksNamespace . 'instructions'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" ' . $tasksNamespace .
- 'paramgroup> id "' . $param[$tasksNamespace . 'id'] .
- '" ' . $tasksNamespace . 'instructions> must be simple text');
- }
- }
- if (!isset($param[$tasksNamespace . 'param'])) {
+ if (!isset($param[$tasksNamespace.'id'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" <paramgroup> must have '.
+ 'an '.$tasksNamespace.'id> tag', );
+ }
+ if (isset($param[$tasksNamespace.'name'])) {
+ if (!in_array($param[$tasksNamespace.'name'], $definedparams)) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" parameter "'.$param[$tasksNamespace.'name'].
+ '" has not been previously defined', );
+ }
+ if (!isset($param[$tasksNamespace.'conditiontype'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.
+ 'conditiontype> tag containing either "=", '.
+ '"!=", or "preg_match"', );
+ }
+ if (!in_array(
+ $param[$tasksNamespace.'conditiontype'],
+ array('=', '!=', 'preg_match')
+ )) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.
+ 'conditiontype> tag containing either "=", '.
+ '"!=", or "preg_match"', );
+ }
+ if (!isset($param[$tasksNamespace.'value'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.
+ 'value> tag containing expected parameter value', );
+ }
+ }
+ if (isset($param[$tasksNamespace.'instructions'])) {
+ if (!is_string($param[$tasksNamespace.'instructions'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" '.$tasksNamespace.
+ 'paramgroup> id "'.$param[$tasksNamespace.'id'].
+ '" '.$tasksNamespace.'instructions> must be simple text', );
+ }
+ }
+ if (!isset($param[$tasksNamespace.'param'])) {
continue; // <param> is no longer required
}
- $subparams = $param[$tasksNamespace . 'param'];
+ $subparams = $param[$tasksNamespace.'param'];
if (!is_array($subparams) || !isset($subparams[0])) {
$subparams = array($subparams);
}
foreach ($subparams as $subparam) {
- if (!isset($subparam[$tasksNamespace . 'name'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter for ' .
- $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] . '" must have ' .
- 'a ' . $tasksNamespace . 'name> tag');
- }
- if (!preg_match('/[a-zA-Z0-9]+/',
- $subparam[$tasksNamespace . 'name'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter "' .
- $subparam[$tasksNamespace . 'name'] .
- '" for ' . $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] .
- '" is not a valid name. Must contain only alphanumeric characters');
- }
- if (!isset($subparam[$tasksNamespace . 'prompt'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter "' .
- $subparam[$tasksNamespace . 'name'] .
- '" for ' . $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace . 'prompt> tag');
- }
- if (!isset($subparam[$tasksNamespace . 'type'])) {
- return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' .
- $fileXml['name'] . '" parameter "' .
- $subparam[$tasksNamespace . 'name'] .
- '" for ' . $tasksNamespace . 'paramgroup> id "' .
- $param[$tasksNamespace . 'id'] .
- '" must have a ' . $tasksNamespace . 'type> tag');
- }
- $definedparams[] = $param[$tasksNamespace . 'id'] . '::' .
- $subparam[$tasksNamespace . 'name'];
+ if (!isset($subparam[$tasksNamespace.'name'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter for '.
+ $tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].'" must have '.
+ 'a '.$tasksNamespace.'name> tag', );
+ }
+ if (!preg_match(
+ '/[a-zA-Z0-9]+/',
+ $subparam[$tasksNamespace.'name']
+ )) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter "'.
+ $subparam[$tasksNamespace.'name'].
+ '" for '.$tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].
+ '" is not a valid name. Must contain only alphanumeric characters', );
+ }
+ if (!isset($subparam[$tasksNamespace.'prompt'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter "'.
+ $subparam[$tasksNamespace.'name'].
+ '" for '.$tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.'prompt> tag', );
+ }
+ if (!isset($subparam[$tasksNamespace.'type'])) {
+ return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'.
+ $fileXml['name'].'" parameter "'.
+ $subparam[$tasksNamespace.'name'].
+ '" for '.$tasksNamespace.'paramgroup> id "'.
+ $param[$tasksNamespace.'id'].
+ '" must have a '.$tasksNamespace.'type> tag', );
+ }
+ $definedparams[] = $param[$tasksNamespace.'id'].'::'.
+ $subparam[$tasksNamespace.'name'];
}
}
}
+
return true;
}
/**
* Initialize a task instance with the parameters
- * @param array raw, parsed xml
- * @param array attributes from the <file> tag containing this task
- * @param string|null last installed version of this package, if any (useful for upgrades)
+ * @param array $xml raw, parsed xml
+ * @param array $fileattribs attributes from the <file> tag containing
+ * this task
+ * @param string|null $lastversion last installed version of this package,
+ * if any (useful for upgrades)
*/
- function init($xml, $fileattribs, $lastversion)
+ public function init($xml, $fileattribs, $lastversion)
{
$this->_class = str_replace('/', '_', $fileattribs['name']);
$this->_filename = $fileattribs['name'];
- $this->_class = str_replace ('.php', '', $this->_class) . '_postinstall';
+ $this->_class = str_replace('.php', '', $this->_class).'_postinstall';
$this->_params = $xml;
$this->_lastversion = $lastversion;
}
@@ -88354,7 +88328,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
*
* @access private
*/
- function _stripNamespace($params = null)
+ public function _stripNamespace($params = null)
{
if ($params === null) {
$params = array();
@@ -88365,7 +88339,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
if (is_array($param)) {
$param = $this->_stripNamespace($param);
}
- $params[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param;
+ $params[str_replace($this->_pkg->getTasksNs().':', '', $i)] = $param;
}
$this->_params = $params;
} else {
@@ -88374,21 +88348,24 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
if (is_array($param)) {
$param = $this->_stripNamespace($param);
}
- $newparams[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param;
+ $newparams[str_replace($this->_pkg->getTasksNs().':', '', $i)] = $param;
}
+
return $newparams;
}
}
/**
- * Unlike other tasks, the installed file name is passed in instead of the file contents,
- * because this task is handled post-installation
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file name
+ * Unlike other tasks, the installed file name is passed in instead of the
+ * file contents, because this task is handled post-installation
+ *
+ * @param mixed $pkg PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string $contents file name
+ *
* @return bool|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError)
+ * (use $this->throwError)
*/
- function startSession($pkg, $contents)
+ public function startSession($pkg, $contents)
{
if ($this->installphase != PEAR_TASK_INSTALL) {
return false;
@@ -88396,56 +88373,63 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
// remove the tasks: namespace if present
$this->_pkg = $pkg;
$this->_stripNamespace();
- $this->logger->log(0, 'Including external post-installation script "' .
- $contents . '" - any errors are in this script');
+ $this->logger->log(
+ 0, 'Including external post-installation script "'.
+ $contents.'" - any errors are in this script'
+ );
include_once 'phar://install-pear-nozlib.phar/' . $contents;
if (class_exists($this->_class)) {
$this->logger->log(0, 'Inclusion succeeded');
} else {
- return $this->throwError('init of post-install script class "' . $this->_class
- . '" failed');
+ return $this->throwError(
+ 'init of post-install script class "'.$this->_class
+ .'" failed'
+ );
}
- $this->_obj = new $this->_class;
- $this->logger->log(1, 'running post-install script "' . $this->_class . '->init()"');
+ $this->_obj = new $this->_class();
+ $this->logger->log(1, 'running post-install script "'.$this->_class.'->init()"');
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$res = $this->_obj->init($this->config, $pkg, $this->_lastversion);
PEAR::popErrorHandling();
if ($res) {
$this->logger->log(0, 'init succeeded');
} else {
- return $this->throwError('init of post-install script "' . $this->_class .
- '->init()" failed');
+ return $this->throwError(
+ 'init of post-install script "'.$this->_class.
+ '->init()" failed'
+ );
}
$this->_contents = $contents;
+
return true;
}
/**
* No longer used
- * @see PEAR_PackageFile_v2::runPostinstallScripts()
- * @param array an array of tasks
- * @param string install or upgrade
+ *
+ * @see PEAR_PackageFile_v2::runPostinstallScripts()
+ * @param array an array of tasks
+ * @param string install or upgrade
* @access protected
* @static
*/
- function run()
+ public function run()
{
}
}
-?><?php
+<?php
/**
* <tasks:postinstallscript> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -88469,30 +88453,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
*
* @var PEAR_PackageFile_v2_rw
*/
- var $_pkg;
+ public $_pkg;
/**
* Enter description here...
*
- * @param PEAR_PackageFile_v2_rw $pkg
- * @param PEAR_Config $config
- * @param PEAR_Frontend $logger
- * @param array $fileXml
+ * @param PEAR_PackageFile_v2_rw $pkg Package
+ * @param PEAR_Config $config Config
+ * @param PEAR_Frontend $logger Logger
+ * @param array $fileXml XML
+ *
* @return PEAR_Task_Postinstallscript_rw
*/
- function PEAR_Task_Postinstallscript_rw(&$pkg, &$config, &$logger, $fileXml)
+ function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
}
- function getName()
+ public function getName()
{
return 'postinstallscript';
}
@@ -88507,30 +88492,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
*
* Use {@link addConditionTypeGroup()} to add a <paramgroup> containing
* a <conditiontype> tag
- * @param string $id <paramgroup> id as seen by the script
- * @param array|false $params array of getParam() calls, or false for no params
+ *
+ * @param string $id <paramgroup> id as seen by the script
+ * @param array|false $params array of getParam() calls, or false for no params
* @param string|false $instructions
*/
- function addParamGroup($id, $params = false, $instructions = false)
+ public function addParamGroup($id, $params = false, $instructions = false)
{
if ($params && isset($params[0]) && !isset($params[1])) {
$params = $params[0];
}
$stuff =
array(
- $this->_pkg->getTasksNs() . ':id' => $id,
+ $this->_pkg->getTasksNs().':id' => $id,
);
if ($instructions) {
- $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions;
+ $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions;
}
if ($params) {
- $stuff[$this->_pkg->getTasksNs() . ':param'] = $params;
+ $stuff[$this->_pkg->getTasksNs().':param'] = $params;
}
- $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff;
+ $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff;
}
/**
- * add a complex <paramgroup> to the post-install script with conditions
+ * Add a complex <paramgroup> to the post-install script with conditions
*
* This inserts a <paramgroup> with
*
@@ -88541,79 +88527,91 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
*
* Use {@link addParamGroup()} to add a simple <paramgroup>
*
- * @param string $id <paramgroup> id as seen by the script
- * @param string $oldgroup <paramgroup> id of the section referenced by
- * <conditiontype>
- * @param string $param name of the <param> from the older section referenced
- * by <contitiontype>
- * @param string $value value to match of the parameter
- * @param string $conditiontype one of '=', '!=', 'preg_match'
- * @param array|false $params array of getParam() calls, or false for no params
+ * @param string $id <paramgroup> id as seen by the script
+ * @param string $oldgroup <paramgroup> id of the section referenced by
+ * <conditiontype>
+ * @param string $param name of the <param> from the older section referenced
+ * by <contitiontype>
+ * @param string $value value to match of the parameter
+ * @param string $conditiontype one of '=', '!=', 'preg_match'
+ * @param array|false $params array of getParam() calls, or false for no params
* @param string|false $instructions
*/
- function addConditionTypeGroup($id, $oldgroup, $param, $value, $conditiontype = '=',
- $params = false, $instructions = false)
- {
+ public function addConditionTypeGroup($id,
+ $oldgroup,
+ $param,
+ $value,
+ $conditiontype = '=',
+ $params = false,
+ $instructions = false
+ ) {
if ($params && isset($params[0]) && !isset($params[1])) {
$params = $params[0];
}
$stuff = array(
- $this->_pkg->getTasksNs() . ':id' => $id,
+ $this->_pkg->getTasksNs().':id' => $id,
);
if ($instructions) {
- $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions;
+ $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions;
}
- $stuff[$this->_pkg->getTasksNs() . ':name'] = $oldgroup . '::' . $param;
- $stuff[$this->_pkg->getTasksNs() . ':conditiontype'] = $conditiontype;
- $stuff[$this->_pkg->getTasksNs() . ':value'] = $value;
+ $stuff[$this->_pkg->getTasksNs().':name'] = $oldgroup.'::'.$param;
+ $stuff[$this->_pkg->getTasksNs().':conditiontype'] = $conditiontype;
+ $stuff[$this->_pkg->getTasksNs().':value'] = $value;
if ($params) {
- $stuff[$this->_pkg->getTasksNs() . ':param'] = $params;
+ $stuff[$this->_pkg->getTasksNs().':param'] = $params;
}
- $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff;
+ $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff;
}
- function getXml()
+ public function getXml()
{
return $this->_params;
}
/**
* Use to set up a param tag for use in creating a paramgroup
+ *
+ * @param mixed $name Name of parameter
+ * @param mixed $prompt Prompt
+ * @param string $type Type, defaults to 'string'
+ * @param mixed $default Default value
+ *
* @static
+ * @return array
*/
- function getParam($name, $prompt, $type = 'string', $default = null)
+ public function getParam($name, $prompt, $type = 'string', $default = null)
{
if ($default !== null) {
return
array(
- $this->_pkg->getTasksNs() . ':name' => $name,
- $this->_pkg->getTasksNs() . ':prompt' => $prompt,
- $this->_pkg->getTasksNs() . ':type' => $type,
- $this->_pkg->getTasksNs() . ':default' => $default
+ $this->_pkg->getTasksNs().':name' => $name,
+ $this->_pkg->getTasksNs().':prompt' => $prompt,
+ $this->_pkg->getTasksNs().':type' => $type,
+ $this->_pkg->getTasksNs().':default' => $default,
);
}
+
return
array(
- $this->_pkg->getTasksNs() . ':name' => $name,
- $this->_pkg->getTasksNs() . ':prompt' => $prompt,
- $this->_pkg->getTasksNs() . ':type' => $type,
+ $this->_pkg->getTasksNs().':name' => $name,
+ $this->_pkg->getTasksNs().':prompt' => $prompt,
+ $this->_pkg->getTasksNs().':type' => $type,
);
}
}
-?><?php
+<?php
/**
* <tasks:replace>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -88632,18 +88630,19 @@ require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Common.php';
*/
class PEAR_Task_Replace extends PEAR_Task_Common
{
- var $type = 'simple';
- var $phase = PEAR_TASK_PACKAGEANDINSTALL;
- var $_replacements;
+ public $type = 'simple';
+ public $phase = PEAR_TASK_PACKAGEANDINSTALL;
+ public $_replacements;
/**
* Validate the raw xml at parsing-time.
- * @param PEAR_PackageFile_v2
- * @param array raw, parsed xml
- * @param PEAR_Config
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array raw, parsed xml
+ * @param PEAR_Config
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if (!isset($xml['attribs'])) {
return array(PEAR_TASK_ERROR_NOATTRIBS);
@@ -88660,33 +88659,36 @@ class PEAR_Task_Replace extends PEAR_Task_Common
if ($xml['attribs']['type'] == 'pear-config') {
if (!in_array($xml['attribs']['to'], $config->getKeys())) {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'],
- $config->getKeys());
+ $config->getKeys(), );
}
} elseif ($xml['attribs']['type'] == 'php-const') {
if (defined($xml['attribs']['to'])) {
return true;
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'],
- array('valid PHP constant'));
+ array('valid PHP constant'), );
}
} elseif ($xml['attribs']['type'] == 'package-info') {
- if (in_array($xml['attribs']['to'],
+ if (in_array(
+ $xml['attribs']['to'],
array('name', 'summary', 'channel', 'notes', 'extends', 'description',
'release_notes', 'license', 'release-license', 'license-uri',
'version', 'api-version', 'state', 'api-state', 'release_date',
- 'date', 'time'))) {
+ 'date', 'time', )
+ )) {
return true;
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'],
array('name', 'summary', 'channel', 'notes', 'extends', 'description',
'release_notes', 'license', 'release-license', 'license-uri',
'version', 'api-version', 'state', 'api-state', 'release_date',
- 'date', 'time'));
+ 'date', 'time', ), );
}
} else {
return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type', $xml['attribs']['type'],
- array('pear-config', 'package-info', 'php-const'));
+ array('pear-config', 'package-info', 'php-const'), );
}
+
return true;
}
@@ -88695,7 +88697,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
* @param array raw, parsed xml
* @param unused
*/
- function init($xml, $attribs)
+ public function init($xml, $attribs)
{
$this->_replacements = isset($xml['attribs']) ? array($xml) : $xml;
}
@@ -88704,13 +88706,14 @@ class PEAR_Task_Replace extends PEAR_Task_Common
* Do a package.xml 1.0 replacement, with additional package-info fields available
*
* See validateXml() source for the complete list of allowed fields
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
+ *
+ * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
* @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ * (use $this->throwError), otherwise return the new contents
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
$subst_from = $subst_to = array();
foreach ($this->_replacements as $a) {
@@ -88726,6 +88729,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$to = $chan->getServer();
} else {
$this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]");
+
return false;
}
} else {
@@ -88742,6 +88746,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
}
if (is_null($to)) {
$this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]");
+
return false;
}
} elseif ($a['type'] == 'php-const') {
@@ -88752,6 +88757,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$to = constant($a['to']);
} else {
$this->logger->log(0, "$dest: invalid php-const replacement: $a[to]");
+
return false;
}
} else {
@@ -88759,6 +88765,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$to = $t;
} else {
$this->logger->log(0, "$dest: invalid package-info replacement: $a[to]");
+
return false;
}
}
@@ -88767,28 +88774,30 @@ class PEAR_Task_Replace extends PEAR_Task_Common
$subst_to[] = $to;
}
}
- $this->logger->log(3, "doing " . sizeof($subst_from) .
- " substitution(s) for $dest");
+ $this->logger->log(
+ 3, "doing ".sizeof($subst_from).
+ " substitution(s) for $dest"
+ );
if (sizeof($subst_from)) {
$contents = str_replace($subst_from, $subst_to, $contents);
}
+
return $contents;
}
}
-?><?php
+<?php
/**
* <tasks:replace> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -88807,48 +88816,47 @@ require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Replace.php';
*/
class PEAR_Task_Replace_rw extends PEAR_Task_Replace
{
- function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml)
+ public function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
}
- function setInfo($from, $to, $type)
+ public function setInfo($from, $to, $type)
{
$this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type));
}
- function getName()
+ public function getName()
{
return 'replace';
}
- function getXml()
+ public function getXml()
{
return $this->_params;
}
}
-?><?php
+<?php
/**
* <tasks:unixeol>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -88867,22 +88875,24 @@ require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Common.php';
*/
class PEAR_Task_Unixeol extends PEAR_Task_Common
{
- var $type = 'simple';
- var $phase = PEAR_TASK_PACKAGE;
- var $_replacements;
+ public $type = 'simple';
+ public $phase = PEAR_TASK_PACKAGE;
+ public $_replacements;
/**
* Validate the raw xml at parsing-time.
- * @param PEAR_PackageFile_v2
- * @param array raw, parsed xml
- * @param PEAR_Config
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array raw, parsed xml
+ * @param PEAR_Config
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if ($xml != '') {
return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed');
}
+
return true;
}
@@ -88891,7 +88901,7 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common
* @param array raw, parsed xml
* @param unused
*/
- function init($xml, $attribs)
+ public function init($xml, $attribs)
{
}
@@ -88899,32 +88909,33 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common
* Replace all line endings with line endings customized for the current OS
*
* See validateXml() source for the complete list of allowed fields
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
+ *
+ * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
* @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ * (use $this->throwError), otherwise return the new contents
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
$this->logger->log(3, "replacing all line endings with \\n in $dest");
+
return preg_replace("/\r\n|\n\r|\r|\n/", "\n", $contents);
}
}
-?><?php
+<?php
/**
* <tasks:unixeol> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -88943,43 +88954,43 @@ require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Unixeol.php';
*/
class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol
{
- function PEAR_Task_Unixeol_rw(&$pkg, &$config, &$logger, $fileXml)
+ function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return true;
}
- function getName()
+ public function getName()
{
return 'unixeol';
}
- function getXml()
+ public function getXml()
{
return '';
}
}
-?><?php
+?>
+<?php
/**
* <tasks:windowseol>
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a1
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a1
*/
/**
* Base class
@@ -88987,33 +88998,36 @@ class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Common.php';
/**
* Implements the windows line endsings file task.
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a1
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a1
*/
class PEAR_Task_Windowseol extends PEAR_Task_Common
{
- var $type = 'simple';
- var $phase = PEAR_TASK_PACKAGE;
- var $_replacements;
+ public $type = 'simple';
+ public $phase = PEAR_TASK_PACKAGE;
+ public $_replacements;
/**
* Validate the raw xml at parsing-time.
- * @param PEAR_PackageFile_v2
- * @param array raw, parsed xml
- * @param PEAR_Config
+ *
+ * @param PEAR_PackageFile_v2
+ * @param array raw, parsed xml
+ * @param PEAR_Config
* @static
*/
- function validateXml($pkg, $xml, $config, $fileXml)
+ public function validateXml($pkg, $xml, $config, $fileXml)
{
if ($xml != '') {
return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed');
}
+
return true;
}
@@ -89022,7 +89036,7 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
* @param array raw, parsed xml
* @param unused
*/
- function init($xml, $attribs)
+ public function init($xml, $attribs)
{
}
@@ -89030,32 +89044,33 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
* Replace all line endings with windows line endings
*
* See validateXml() source for the complete list of allowed fields
- * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
- * @param string file contents
- * @param string the eventual final file location (informational only)
+ *
+ * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2
+ * @param string file contents
+ * @param string the eventual final file location (informational only)
* @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail
- * (use $this->throwError), otherwise return the new contents
+ * (use $this->throwError), otherwise return the new contents
*/
- function startSession($pkg, $contents, $dest)
+ public function startSession($pkg, $contents, $dest)
{
$this->logger->log(3, "replacing all line endings with \\r\\n in $dest");
+
return preg_replace("/\r\n|\n\r|\r|\n/", "\r\n", $contents);
}
}
-?><?php
+<?php
/**
* <tasks:windowseol> - read/write version
*
* PHP versions 4 and 5
*
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/PEAR
- * @since File available since Release 1.4.0a10
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @link http://pear.php.net/package/PEAR
+ * @since File available since Release 1.4.0a10
*/
/**
* Base class
@@ -89063,41 +89078,43 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR/Task/Windowseol.php';
/**
* Abstracts the windowseol task xml.
- * @category pear
- * @package PEAR
- * @author Greg Beaver <cellog@php.net>
- * @copyright 1997-2009 The Authors
- * @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.5
- * @link http://pear.php.net/package/PEAR
- * @since Class available since Release 1.4.0a10
+ *
+ * @category pear
+ * @package PEAR
+ * @author Greg Beaver <cellog@php.net>
+ * @copyright 1997-2009 The Authors
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version Release: 1.9.5
+ * @link http://pear.php.net/package/PEAR
+ * @since Class available since Release 1.4.0a10
*/
class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol
{
- function PEAR_Task_Windowseol_rw(&$pkg, &$config, &$logger, $fileXml)
+ function __construct(&$pkg, &$config, &$logger, $fileXml)
{
- parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE);
+ parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
$this->_contents = $fileXml;
$this->_pkg = &$pkg;
$this->_params = array();
}
- function validate()
+ public function validate()
{
return true;
}
- function getName()
+ public function getName()
{
return 'windowseol';
}
- function getXml()
+ public function getXml()
{
return '';
}
}
-?><?php
+?>
+<?php
/**
* PEAR_Validate
*
@@ -89108,7 +89125,6 @@ class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -89736,7 +89752,6 @@ class PEAR_Validate
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a5
*/
@@ -89799,7 +89814,6 @@ class PEAR_Validator_PECL extends PEAR_Validate
* @author Stephan Schmidt (original XML_Unserializer code)
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -89884,11 +89898,6 @@ class PEAR_XMLParser
$this->encoding = 'UTF-8';
}
- if (version_compare(phpversion(), '5.0.0', 'lt') && $this->encoding == 'UTF-8') {
- $data = utf8_decode($data);
- $this->encoding = 'ISO-8859-1';
- }
-
$xp = xml_parser_create($this->encoding);
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, 0);
xml_set_object($xp, $this);
@@ -90040,38 +90049,6 @@ class PEAR_XMLParser
$this->_dataStack[$this->_depth] .= $cdata;
}
}<?php
-/**
- * This is only meant for PHP 5 to get rid of certain strict warning
- * that doesn't get hidden since it's in the shutdown function
- */
-class PEAR5
-{
- /**
- * If you have a class that's mostly/entirely static, and you need static
- * properties, you can use this method to simulate them. Eg. in your method(s)
- * do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
- * You MUST use a reference, or they will not persist!
- *
- * @access public
- * @param string $class The calling classname, to prevent clashes
- * @param string $var The variable to retrieve.
- * @return mixed A reference to the variable. If not set it will be
- * auto initialised to NULL.
- */
- static function &getStaticProperty($class, $var)
- {
- static $properties;
- if (!isset($properties[$class])) {
- $properties[$class] = array();
- }
-
- if (!array_key_exists($var, $properties[$class])) {
- $properties[$class][$var] = null;
- }
-
- return $properties[$class][$var];
- }
-}<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +-----------------------------------------------------------------------------+
// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
@@ -90099,14 +90076,11 @@ class PEAR5
/**
* The Graph.php file contains the definition of the Structures_Graph class
*
- * @see Structures_Graph
* @package Structures_Graph
*/
/* dependencies {{{ */
-/** PEAR base classes */
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR.php';
-/** Graph Node */
require_once 'phar://install-pear-nozlib.phar/' . 'Structures/Graph/Node.php';
/* }}} */
@@ -90121,65 +90095,86 @@ define('STRUCTURES_GRAPH_ERROR_GENERIC', 100);
* directional, and can be traveled only one way. In an undirected graph, arcs
* are bidirectional, and can be traveled both ways.
*
- * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
- * @copyright (c) 2004 by Sérgio Carvalho
- * @package Structures_Graph
+ * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
+ * @copyright (c) 2004 by Sérgio Carvalho
+ * @package Structures_Graph
*/
/* }}} */
-class Structures_Graph {
- /* fields {{{ */
+class Structures_Graph
+{
/**
+ * List of node objects in this graph
* @access private
*/
var $_nodes = array();
+
/**
+ * If the graph is directed or not
* @access private
*/
var $_directed = false;
- /* }}} */
- /* Constructor {{{ */
+
/**
- *
- * Constructor
- *
- * @param boolean Set to true if the graph is directed. Set to false if it is not directed. (Optional, defaults to true)
- * @access public
- */
- function Structures_Graph($directed = true) {
+ * Constructor
+ *
+ * @param boolean $directed Set to true if the graph is directed.
+ * Set to false if it is not directed.
+ */
+ public function __construct($directed = true)
+ {
$this->_directed = $directed;
}
- /* }}} */
- /* isDirected {{{ */
/**
- *
- * Return true if a graph is directed
- *
- * @return boolean true if the graph is directed
- * @access public
- */
- function isDirected() {
+ * Old constructor (PHP4-style; kept for BC with extending classes)
+ *
+ * @param boolean $directed Set to true if the graph is directed.
+ * Set to false if it is not directed.
+ *
+ * @return void
+ */
+ public function Structures_Graph($directed = true)
+ {
+ $this->__construct($directed);
+ }
+
+ /**
+ * Return true if a graph is directed
+ *
+ * @return boolean true if the graph is directed
+ */
+ public function isDirected()
+ {
return (boolean) $this->_directed;
}
- /* }}} */
- /* addNode {{{ */
/**
- *
- * Add a Node to the Graph
- *
- * @param Structures_Graph_Node The node to be added.
- * @access public
- */
- function addNode(&$newNode) {
+ * Add a Node to the Graph
+ *
+ * @param Structures_Graph_Node $newNode The node to be added.
+ *
+ * @return void
+ */
+ public function addNode(&$newNode)
+ {
// We only add nodes
- if (!is_a($newNode, 'Structures_Graph_Node')) return Pear::raiseError('Structures_Graph::addNode received an object that is not a Structures_Graph_Node', STRUCTURES_GRAPH_ERROR_GENERIC);
- // Graphs are node *sets*, so duplicates are forbidden. We allow nodes that are exactly equal, but disallow equal references.
- foreach($this->_nodes as $key => $node) {
+ if (!is_a($newNode, 'Structures_Graph_Node')) {
+ return Pear::raiseError(
+ 'Structures_Graph::addNode received an object that is not'
+ . ' a Structures_Graph_Node',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
+
+ //Graphs are node *sets*, so duplicates are forbidden.
+ // We allow nodes that are exactly equal, but disallow equal references.
+ foreach ($this->_nodes as $key => $node) {
/*
- ZE1 equality operators choke on the recursive cycle introduced by the _graph field in the Node object.
- So, we'll check references the hard way (change $this->_nodes[$key] and check if the change reflects in
+ ZE1 equality operators choke on the recursive cycle introduced
+ by the _graph field in the Node object.
+ So, we'll check references the hard way
+ (change $this->_nodes[$key] and check if the change reflects in
$node)
*/
$savedData = $this->_nodes[$key];
@@ -90187,42 +90182,46 @@ class Structures_Graph {
$this->_nodes[$key] = true;
if ($node === true) {
$this->_nodes[$key] = false;
- if ($node === false) $referenceIsEqualFlag = true;
+ if ($node === false) {
+ $referenceIsEqualFlag = true;
+ }
}
$this->_nodes[$key] = $savedData;
- if ($referenceIsEqualFlag) return Pear::raiseError('Structures_Graph::addNode received an object that is a duplicate for this dataset', STRUCTURES_GRAPH_ERROR_GENERIC);
+ if ($referenceIsEqualFlag) {
+ return Pear::raiseError(
+ 'Structures_Graph::addNode received an object that is'
+ . ' a duplicate for this dataset',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
}
$this->_nodes[] =& $newNode;
$newNode->setGraph($this);
}
- /* }}} */
- /* removeNode (unimplemented) {{{ */
/**
- *
- * Remove a Node from the Graph
- *
- * @todo This is unimplemented
- * @param Structures_Graph_Node The node to be removed from the graph
- * @access public
- */
- function removeNode(&$node) {
+ * Remove a Node from the Graph
+ *
+ * @param Structures_Graph_Node $node The node to be removed from the graph
+ *
+ * @return void
+ * @todo This is unimplemented
+ */
+ public function removeNode(&$node)
+ {
}
- /* }}} */
- /* getNodes {{{ */
/**
- *
- * Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted.
- *
- * @access public
- * @see Structures_Graph_Manipulator_TopologicalSorter
- * @return array The set of nodes in this graph
- */
- function &getNodes() {
+ * Return the node set, in no particular order.
+ * For ordered node sets, use a Graph Manipulator insted.
+ *
+ * @return array The set of nodes in this graph
+ * @see Structures_Graph_Manipulator_TopologicalSorter
+ */
+ public function &getNodes()
+ {
return $this->_nodes;
}
- /* }}} */
}
?>
<?php
@@ -90286,10 +90285,9 @@ class Structures_Graph_Manipulator_AcyclicTest {
* This is a variant of Structures_Graph::inDegree which does
* not count nodes marked as visited.
*
- * @access private
* @return integer Number of non-visited nodes that link to this one
*/
- function _nonVisitedInDegree(&$node) {
+ protected static function _nonVisitedInDegree(&$node) {
$result = 0;
$graphNodes =& $node->_graph->getNodes();
foreach (array_keys($graphNodes) as $key) {
@@ -90302,9 +90300,9 @@ class Structures_Graph_Manipulator_AcyclicTest {
/* _isAcyclic {{{ */
/**
- * @access private
- */
- function _isAcyclic(&$graph) {
+ * Check if the graph is acyclic
+ */
+ protected static function _isAcyclic(&$graph) {
// Mark every node as not visited
$nodes =& $graph->getNodes();
$nodeKeys = array_keys($nodes);
@@ -90348,9 +90346,8 @@ class Structures_Graph_Manipulator_AcyclicTest {
* isAcyclic returns true if a graph contains no cycles, false otherwise.
*
* @return boolean true iff graph is acyclic
- * @access public
*/
- function isAcyclic(&$graph) {
+ public static function isAcyclic(&$graph) {
// We only test graphs
if (!is_a($graph, 'Structures_Graph')) return Pear::raiseError('Structures_Graph_Manipulator_AcyclicTest::isAcyclic received an object that is not a Structures_Graph', STRUCTURES_GRAPH_ERROR_GENERIC);
if (!$graph->isDirected()) return false; // Only directed graphs may be acyclic
@@ -90389,22 +90386,14 @@ class Structures_Graph_Manipulator_AcyclicTest {
/**
* This file contains the definition of the Structures_Graph_Manipulator_TopologicalSorter class.
*
- * @see Structures_Graph_Manipulator_TopologicalSorter
* @package Structures_Graph
*/
-/* dependencies {{{ */
-/** */
require_once 'phar://install-pear-nozlib.phar/' . 'PEAR.php';
-/** */
require_once 'phar://install-pear-nozlib.phar/' . 'Structures/Graph.php';
-/** */
require_once 'phar://install-pear-nozlib.phar/' . 'Structures/Graph/Node.php';
-/** */
require_once 'phar://install-pear-nozlib.phar/' . 'Structures/Graph/Manipulator/AcyclicTest.php';
-/* }}} */
-/* class Structures_Graph_Manipulator_TopologicalSorter {{{ */
/**
* The Structures_Graph_Manipulator_TopologicalSorter is a manipulator
* which is able to return the set of nodes in a graph, sorted by topological
@@ -90413,44 +90402,55 @@ require_once 'phar://install-pear-nozlib.phar/' . 'Structures/Graph/Manipulator/
* A graph may only be sorted topologically iff it's a DAG. You can test it
* with the Structures_Graph_Manipulator_AcyclicTest.
*
- * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
- * @copyright (c) 2004 by Sérgio Carvalho
- * @see Structures_Graph_Manipulator_AcyclicTest
- * @package Structures_Graph
+ * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
+ * @copyright (c) 2004 by Sérgio Carvalho
+ * @see Structures_Graph_Manipulator_AcyclicTest
+ * @package Structures_Graph
*/
-class Structures_Graph_Manipulator_TopologicalSorter {
- /* _nonVisitedInDegree {{{ */
+class Structures_Graph_Manipulator_TopologicalSorter
+{
/**
- *
- * This is a variant of Structures_Graph::inDegree which does
- * not count nodes marked as visited.
- *
- * @access private
- * @return integer Number of non-visited nodes that link to this one
- */
- function _nonVisitedInDegree(&$node) {
+ * This is a variant of Structures_Graph::inDegree which does
+ * not count nodes marked as visited.
+ *
+ * @param object $node Node to check
+ *
+ * @return integer Number of non-visited nodes that link to this one
+ */
+ protected static function _nonVisitedInDegree(&$node)
+ {
$result = 0;
$graphNodes =& $node->_graph->getNodes();
foreach (array_keys($graphNodes) as $key) {
- if ((!$graphNodes[$key]->getMetadata('topological-sort-visited')) && $graphNodes[$key]->connectsTo($node)) $result++;
+ if ((!$graphNodes[$key]->getMetadata('topological-sort-visited'))
+ && $graphNodes[$key]->connectsTo($node)
+ ) {
+ $result++;
+ }
}
return $result;
}
- /* }}} */
- /* _sort {{{ */
/**
- * @access private
- */
- function _sort(&$graph) {
+ * Sort implementation
+ *
+ * @param object $graph Graph to sort
+ *
+ * @return void
+ */
+ protected static function _sort(&$graph)
+ {
// Mark every node as not visited
$nodes =& $graph->getNodes();
$nodeKeys = array_keys($nodes);
$refGenerator = array();
- foreach($nodeKeys as $key) {
+ foreach ($nodeKeys as $key) {
$refGenerator[] = false;
- $nodes[$key]->setMetadata('topological-sort-visited', $refGenerator[sizeof($refGenerator) - 1]);
+ $nodes[$key]->setMetadata(
+ 'topological-sort-visited',
+ $refGenerator[sizeof($refGenerator) - 1]
+ );
}
// Iteratively peel off leaf nodes
@@ -90458,43 +90458,61 @@ class Structures_Graph_Manipulator_TopologicalSorter {
do {
// Find out which nodes are leafs (excluding visited nodes)
$leafNodes = array();
- foreach($nodeKeys as $key) {
- if ((!$nodes[$key]->getMetadata('topological-sort-visited')) && Structures_Graph_Manipulator_TopologicalSorter::_nonVisitedInDegree($nodes[$key]) == 0) {
+ foreach ($nodeKeys as $key) {
+ if ((!$nodes[$key]->getMetadata('topological-sort-visited'))
+ && static::_nonVisitedInDegree($nodes[$key]) == 0
+ ) {
$leafNodes[] =& $nodes[$key];
}
}
// Mark leafs as visited
$refGenerator[] = $topologicalLevel;
- for ($i=sizeof($leafNodes) - 1; $i>=0; $i--) {
+ for ($i = sizeof($leafNodes) - 1; $i>=0; $i--) {
$visited =& $leafNodes[$i]->getMetadata('topological-sort-visited');
$visited = true;
$leafNodes[$i]->setMetadata('topological-sort-visited', $visited);
- $leafNodes[$i]->setMetadata('topological-sort-level', $refGenerator[sizeof($refGenerator) - 1]);
+ $leafNodes[$i]->setMetadata(
+ 'topological-sort-level',
+ $refGenerator[sizeof($refGenerator) - 1]
+ );
}
$topologicalLevel++;
} while (sizeof($leafNodes) > 0);
// Cleanup visited marks
- foreach($nodeKeys as $key) $nodes[$key]->unsetMetadata('topological-sort-visited');
+ foreach ($nodeKeys as $key) {
+ $nodes[$key]->unsetMetadata('topological-sort-visited');
+ }
}
- /* }}} */
- /* sort {{{ */
/**
- *
- * sort returns the graph's nodes, sorted by topological order.
- *
- * The result is an array with
- * as many entries as topological levels. Each entry in this array is an array of nodes within
- * the given topological level.
- *
- * @return array The graph's nodes, sorted by topological order.
- * @access public
- */
- function sort(&$graph) {
+ * Sort returns the graph's nodes, sorted by topological order.
+ *
+ * The result is an array with as many entries as topological levels.
+ * Each entry in this array is an array of nodes within
+ * the given topological level.
+ *
+ * @param object $graph Graph to sort
+ *
+ * @return array The graph's nodes, sorted by topological order.
+ */
+ public static function sort(&$graph)
+ {
// We only sort graphs
- if (!is_a($graph, 'Structures_Graph')) return Pear::raiseError('Structures_Graph_Manipulator_TopologicalSorter::sort received an object that is not a Structures_Graph', STRUCTURES_GRAPH_ERROR_GENERIC);
- if (!Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph)) return Pear::raiseError('Structures_Graph_Manipulator_TopologicalSorter::sort received an graph that has cycles', STRUCTURES_GRAPH_ERROR_GENERIC);
+ if (!is_a($graph, 'Structures_Graph')) {
+ return Pear::raiseError(
+ 'Structures_Graph_Manipulator_TopologicalSorter::sort received'
+ . ' an object that is not a Structures_Graph',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
+ if (!Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph)) {
+ return Pear::raiseError(
+ 'Structures_Graph_Manipulator_TopologicalSorter::sort'
+ . ' received an graph that has cycles',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
Structures_Graph_Manipulator_TopologicalSorter::_sort($graph);
$result = array();
@@ -90502,17 +90520,19 @@ class Structures_Graph_Manipulator_TopologicalSorter {
// Fill out result array
$nodes =& $graph->getNodes();
$nodeKeys = array_keys($nodes);
- foreach($nodeKeys as $key) {
- if (!array_key_exists($nodes[$key]->getMetadata('topological-sort-level'), $result)) $result[$nodes[$key]->getMetadata('topological-sort-level')] = array();
- $result[$nodes[$key]->getMetadata('topological-sort-level')][] =& $nodes[$key];
+ foreach ($nodeKeys as $key) {
+ if (!array_key_exists($nodes[$key]->getMetadata('topological-sort-level'), $result)) {
+ $result[$nodes[$key]->getMetadata('topological-sort-level')]
+ = array();
+ }
+ $result[$nodes[$key]->getMetadata('topological-sort-level')][]
+ =& $nodes[$key];
$nodes[$key]->unsetMetadata('topological-sort-level');
}
return $result;
}
- /* }}} */
}
-/* }}} */
?>
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
@@ -90647,7 +90667,7 @@ class Structures_Graph_Node {
* @return mixed Data to store in node
* @access public
*/
- function setData($data) {
+ function setData(&$data) {
$this->_data =& $data;
}
/* }}} */
@@ -90729,7 +90749,7 @@ class Structures_Graph_Node {
* @param mixed Data
* @access public
*/
- function setMetadata($key, $data) {
+ function setMetadata($key, &$data) {
$this->_metadata[$key] =& $data;
}
/* }}} */
@@ -90856,8 +90876,8 @@ class Structures_Graph_Node {
/* }}} */
}
?>
-package.xml
-<package packagerversion="1.9.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+package.xml
+<package packagerversion="1.9.5" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>Structures_Graph</name>
<channel>pear.php.net</channel>
<summary>Graph datastructure manipulation library</summary>
@@ -90876,51 +90896,38 @@ as well as for characteristic extraction from the graph topology.</description>
<email>brett.bieber@gmail.com</email>
<active>yes</active>
</helper>
- <date>2010-10-25</date>
- <time>21:45:17</time>
+ <date>2015-02-26</date>
+ <time>23:13:49</time>
<version>
- <release>1.0.4</release>
- <api>1.0.3</api>
+ <release>1.1.0</release>
+ <api>1.1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
- <license>LGPL License</license>
+ <license>LGPL-3.0+</license>
<notes>
-Bugfix Release:
-* Bug #17108 BasicGraph::test_directed_degree fails on PHP 5 [clockwerx]
+* Set minimum PHP version to 5.3
+* Fix bug #19367: Incorrect FSF address in LICENSE
+* Change license from LGPL-2.1+ to LGPL-3.0+
</notes>
<contents>
<dir baseinstalldir="/" name="/">
- <file baseinstalldir="/" md5sum="e43ca110d02f287cdaac6357ba539fff" name="docs/html/media/banner.css" role="doc" />
- <file baseinstalldir="/" md5sum="296dd865297508569a6e72fcfd20fa81" name="docs/html/media/stylesheet.css" role="doc" />
- <file baseinstalldir="/" md5sum="678ccf89e31bc7337803afd6b7c58827" name="docs/html/Structures_Graph/Structures_Graph.html" role="doc" />
- <file baseinstalldir="/" md5sum="686b7bd7108cf5ce9b1ae5f17cea79f4" name="docs/html/Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html" role="doc" />
- <file baseinstalldir="/" md5sum="08b05a395eca4b0ca49a956fadf83da6" name="docs/html/Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html" role="doc" />
- <file baseinstalldir="/" md5sum="3fa8a9fae581fc31fd1dfbb14f475f92" name="docs/html/Structures_Graph/Structures_Graph_Node.html" role="doc" />
- <file baseinstalldir="/" md5sum="fd9b59eb75a39d3a25a175660dfb12be" name="docs/html/Structures_Graph/tutorial_Structures_Graph.pkg.html" role="doc" />
- <file baseinstalldir="/" md5sum="9cfeca2ff35a44b4bb921a9a818d8fa6" name="docs/html/Structures_Graph/_Structures_Graph_Manipulator_AcyclicTest_php.html" role="doc" />
- <file baseinstalldir="/" md5sum="4faffdcc81cbc92520104e90a651a971" name="docs/html/Structures_Graph/_Structures_Graph_Manipulator_TopologicalSorter_php.html" role="doc" />
- <file baseinstalldir="/" md5sum="0337573b69355c8b7ad36cd8f40ce859" name="docs/html/Structures_Graph/_Structures_Graph_Node_php.html" role="doc" />
- <file baseinstalldir="/" md5sum="7c1f852d7aa1a2fcada473723c8a46c2" name="docs/html/Structures_Graph/_Structures_Graph_php.html" role="doc" />
- <file baseinstalldir="/" md5sum="238f8a9d335e49ef87a0a276bcfc7231" name="docs/html/classtrees_Structures_Graph.html" role="doc" />
- <file baseinstalldir="/" md5sum="e302b63d3b18fa1c6e13f76816564d39" name="docs/html/elementindex.html" role="doc" />
- <file baseinstalldir="/" md5sum="c97ebad7c5635abbbbf35a23e868649e" name="docs/html/elementindex_Structures_Graph.html" role="doc" />
- <file baseinstalldir="/" md5sum="6f58a7616dd96fb8cc0cbf928f66dd33" name="docs/html/errors.html" role="doc" />
- <file baseinstalldir="/" md5sum="cf5397f529a0d9a701fac13ac6aaaa69" name="docs/html/index.html" role="doc" />
- <file baseinstalldir="/" md5sum="b206403136db1de58901f825ad9f9cb0" name="docs/html/li_Structures_Graph.html" role="doc" />
- <file baseinstalldir="/" md5sum="a88b0fcc2f97dd2069f671ef1dc92b40" name="docs/html/packages.html" role="doc" />
- <file baseinstalldir="/" md5sum="6fdd16675f2181b53a4d2dc2c419752b" name="docs/html/todolist.html" role="doc" />
<file baseinstalldir="/" md5sum="628eb6532a8047bf5962fe24c1c245df" name="docs/tutorials/Structures_Graph/Structures_Graph.pkg" role="doc" />
- <file baseinstalldir="/" md5sum="ce2da39dbb75e21074eb5e96231a3379" name="docs/generate.sh" role="doc" />
- <file baseinstalldir="/" md5sum="f0aff5a1efd188d63b4b8b9e9e840b97" name="Structures/Graph/Manipulator/AcyclicTest.php" role="php" />
- <file baseinstalldir="/" md5sum="0492e677436d29228df93dca23629e06" name="Structures/Graph/Manipulator/TopologicalSorter.php" role="php" />
- <file baseinstalldir="/" md5sum="254ebaba7537ad0f36e63eb8b975cc51" name="Structures/Graph/Node.php" role="php" />
- <file baseinstalldir="/" md5sum="4f25a6275af156f6f8e7b4309cb9f40d" name="Structures/Graph.php" role="php" />
- <file baseinstalldir="/" md5sum="5791baa61d5d36442be58ea5cd9d4bd0" name="tests/testCase/BasicGraph.php" role="test" />
- <file baseinstalldir="/" md5sum="4fed49ef60db01eed800105aae4f2c8b" name="tests/AllTests.php" role="test" />
- <file baseinstalldir="/" md5sum="7fbc338309ac38fefcd64b04bb903e34" name="LICENSE" role="data" />
+ <file baseinstalldir="/" md5sum="4b26eecd30f8695fc3739b1a5b59518e" name="Structures/Graph/Manipulator/AcyclicTest.php" role="php" />
+ <file baseinstalldir="/" md5sum="1f857de1fbbaace54b857ed9712f399f" name="Structures/Graph/Manipulator/TopologicalSorter.php" role="php" />
+ <file baseinstalldir="/" md5sum="928df500102eced877e1bda2d67df668" name="Structures/Graph/Node.php" role="php" />
+ <file baseinstalldir="/" md5sum="88ae1ad8bcd74d4b74ad845f55611cdd" name="Structures/Graph.php" role="php" />
+ <file baseinstalldir="/" md5sum="65e4e85e573833516f5cc1d7a81db9c5" name="tests/AllTests.php" role="test" />
+ <file baseinstalldir="/" md5sum="68ba309e2ac6713527f0fd31456457a1" name="tests/BasicGraphTest.php" role="test" />
+ <file baseinstalldir="/" md5sum="190fc4634be55cd98608b72bc9d0a27f" name="tests/TopologicalSorterTest.php" role="test" />
+ <file baseinstalldir="/" md5sum="4dc0c43f054732ec0f2fc78458ebadde" name="tests/AcyclicTestTest.php" role="test" />
+ <file baseinstalldir="/" md5sum="68ba309e2ac6713527f0fd31456457a1" name="tests/BasicGraphTest.php" role="test" />
+ <file baseinstalldir="/" md5sum="c891580ee21a7aa863ac32566c979fc5" name="tests/helper.inc" role="test">
+ <tasks:replace from="@php_dir@" to="php_dir" type="pear-config" />
+ </file>
+ <file baseinstalldir="/" md5sum="b52f2d57d10c4f7ee67a7eb9615d5d24" name="LICENSE" role="doc" />
</dir>
</contents>
<compatible>
@@ -90932,7 +90939,7 @@ Bugfix Release:
<dependencies>
<required>
<php>
- <min>4.2.0</min>
+ <min>5.3.0</min>
</php>
<pearinstaller>
<min>1.4.3</min>
@@ -90992,2582 +90999,26 @@ Bugfix Release:
* Bug #17108 BasicGraph::test_directed_degree fails on PHP 5 [clockwerx]
</notes>
</release>
+ <release>
+ <version>
+ <release>1.1.0</release>
+ <api>1.1.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2015-02-26</date>
+ <license>LGPL-3.0+</license>
+ <notes>
+* Set minimum PHP version to 5.3
+* Fix bug #19367: Incorrect FSF address in LICENSE
+* Change license from LGPL-2.1+ to LGPL-3.0+
+ </notes>
+ </release>
</changelog>
</package>
-
-{
- background-color: #CCCCFF;
- margin: 0px;
- padding: 0px;
-}
-
-/* Banner (top bar) classes */
-
-.banner { }
-
-.banner-menu
-{
- clear: both;
- padding: .5em;
- border-top: 2px solid #6666AA;
-}
-
-.banner-title
-{
- text-align: right;
- font-size: 20pt;
- font-weight: bold;
- margin: .2em;
-}
-
-.package-selector
-{
- background-color: #AAAADD;
- border: 1px solid black;
- color: yellow;
-}
-
-a:hover { color: #6699CC; text-decoration: underline; }
-a:active { color: #6699CC; text-decoration: underline; }
-
-body { background : #FFFFFF; }
-body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt }
-p, li { line-height: 140% }
-a img { border: 0px; }
-dd { margin-left: 0px; padding-left: 1em; }
-
-/* Page layout/boxes */
-
-.info-box {}
-.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF }
-.info-box-body { border: 1px solid #999999; padding: .5em; }
-.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; }
-
-.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
-.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
-
-.page-body { max-width: 800px; margin: auto; }
-.tree dl { margin: 0px }
-
-/* Index formatting classes */
-
-.index-item-body { margin-top: .5em; margin-bottom: .5em}
-.index-item-description { margin-top: .25em }
-.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt }
-.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em}
-.index-letter-title { font-size: 12pt; font-weight: bold }
-.index-letter-menu { text-align: center; margin: 1em }
-.index-letter { font-size: 12pt }
-
-/* Docbook classes */
-
-.description {}
-.short-description { font-weight: bold; color: #666666; }
-.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; }
-.parameters { padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; }
-.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; }
-.package { }
-.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black }
-.package-details { font-size: 85%; }
-.sub-package { font-weight: bold; font-size: 120% }
-.tutorial { border-width: thin; border-color: #0066ff }
-.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; }
-.nav-button-disabled { color: #999999; }
-.nav-button:active,
-.nav-button:focus,
-.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none }
-.folder-title { font-style: italic }
-
-/* Generic formatting */
-
-.field { font-weight: bold; }
-.detail { font-size: 8pt; }
-.notes { font-style: italic; font-size: 8pt; }
-.separator { background-color: #999999; height: 2px; }
-.warning { color: #FF6600; }
-.disabled { font-style: italic; color: #999999; }
-
-/* Code elements */
-
-.line-number { }
-
-.class-table { width: 100%; }
-.class-table-header { border-bottom: 1px dotted #666666; text-align: left}
-.class-name { color: #000000; font-weight: bold; }
-
-.method-summary { padding-left: 1em; font-size: 8pt }
-.method-header { }
-.method-definition { margin-bottom: .3em }
-.method-title { font-weight: bold; }
-.method-name { font-weight: bold; }
-.method-signature { font-size: 85%; color: #666666; margin: .5em 0em }
-.method-result { font-style: italic; }
-
-.var-summary { padding-left: 1em; font-size: 8pt; }
-.var-header { }
-.var-title { margin-bottom: .3em }
-.var-type { font-style: italic; }
-.var-name { font-weight: bold; }
-.var-default {}
-.var-description { font-weight: normal; color: #000000; }
-
-.include-title { }
-.include-type { font-style: italic; }
-.include-name { font-weight: bold; }
-
-.const-title { }
-.const-name { font-weight: bold; }
-
-/* Syntax highlighting */
-
-.src-code { border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; }
-
-.src-comm { color: green; }
-.src-id { }
-.src-inc { color: #0000FF; }
-.src-key { color: #0000FF; }
-.src-num { color: #CC0000; }
-.src-str { color: #66cccc; }
-.src-sym { font-weight: bold; }
-.src-var { }
-
-.src-php { font-weight: bold; }
-
-.src-doc { color: #009999 }
-.src-doc-close-template { color: #0000FF }
-.src-doc-coretag { color: #0099FF; font-weight: bold }
-.src-doc-inlinetag { color: #0099FF }
-.src-doc-internal { color: #6699cc }
-.src-doc-tag { color: #0080CC }
-.src-doc-template { color: #0000FF }
-.src-doc-type { font-style: italic }
-.src-doc-var { font-style: italic }
-
-/* tutorial */
-
-.authors { }
-.author { font-style: italic; font-weight: bold }
-.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal }
-.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em }
-.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap }
-.release-info { font-size: 85%; font-style: italic; margin: 1em 0em }
-.ref-title-box { }
-.ref-title { }
-.ref-purpose { font-style: italic; color: #666666 }
-.ref-synopsis { }
-.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF }
-.cmd-synopsis { margin: 1em 0em }
-.cmd-title { font-weight: bold }
-.toc { margin-left: 2em; padding-left: 0em }
-
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs For Class Structures_Graph</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="class-name">Class Structures_Graph</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
-
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The Structures_Graph class represents a graph data structure.</p>
-<p class="description"><p>A Graph is a data structure composed by a set of nodes, connected by arcs. Graphs may either be directed or undirected. In a directed graph, arcs are directional, and can be traveled only one way. In an undirected graph, arcs are bidirectional, and can be traveled both ways.</p></p>
- <ul class="tags">
- <li><span class="field">copyright:</span> (c) 2004 by Sérgio Carvalho</li>
- <li><span class="field">author:</span> Sérgio Carvalho &lt;<a href="mailto:sergio.carvalho@portugalmail.com">mailto:sergio.carvalho@portugalmail.com</a>&gt;</li>
- </ul>
- <p class="notes">
- Located in <a class="field" href="_Structures_Graph_php.html">/Structures/Graph.php</a> (line <span class="field">56</span>)
- </p>
-
-
- <pre></pre>
-
- </div>
-</div>
-
-
-
- <a name="sec-method-summary"></a>
- <div class="info-box">
- <div class="info-box-title">Method Summary</span></div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
- </div>
- <div class="info-box-body">
- <div class="method-summary">
-
- <div class="method-definition">
- <span class="method-result">Structures_Graph</span>
- <a href="#Structures_Graph" title="details" class="method-name">Structures_Graph</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$directed</span> = <span class="var-default">true</span>])
- </div>
-
- <div class="method-definition">
- <span class="method-result">void</span>
- <a href="#addNode" title="details" class="method-name">addNode</a>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></span>&nbsp;<span class="var-name">&$newNode</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">array</span>
- <a href="#getNodes" title="details" class="method-name">&amp;getNodes</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">boolean</span>
- <a href="#isDirected" title="details" class="method-name">isDirected</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">void</span>
- <a href="#removeNode" title="details" class="method-name">removeNode</a>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></span>&nbsp;<span class="var-name">&$node</span>)
- </div>
- </div>
- </div>
- </div>
-
-
- <a name="sec-methods"></a>
- <div class="info-box">
- <div class="info-box-title">Methods</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
-
- </div>
- <div class="info-box-body">
- <A NAME='method_detail'></A>
-<a name="methodStructures_Graph" id="Structures_Graph"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">Constructor Structures_Graph</span> (line <span class="line-number">76</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Constructor</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">Structures_Graph</span>
- <span class="method-name">
- Structures_Graph
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$directed</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$directed</span><span class="var-description">: Set to true if the graph is directed. Set to false if it is not directed. (Optional, defaults to true)</span> </li>
- </ul>
-
-
- </div>
-<a name="methodaddNode" id="addNode"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">addNode</span> (line <span class="line-number">102</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Add a Node to the Graph</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- addNode
- </span>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></span>&nbsp;<span class="var-name">&$newNode</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type"><a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></span>
- <span class="var-name">&$newNode</span><span class="var-description">: The node to be added.</span> </li>
- </ul>
-
-
- </div>
-<a name="methodgetNodes" id="getNodes"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">getNodes</span> (line <span class="line-number">151</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted.</p>
- <ul class="tags">
- <li><span class="field">return:</span> The set of nodes in this graph</li>
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html">Structures_Graph_Manipulator_TopologicalSorter</a></li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">array</span>
- <span class="method-name">
- &amp;getNodes
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodisDirected" id="isDirected"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">isDirected</span> (line <span class="line-number">89</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Return true if a graph is directed</p>
- <ul class="tags">
- <li><span class="field">return:</span> true if the graph is directed</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">boolean</span>
- <span class="method-name">
- isDirected
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodremoveNode" id="removeNode"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">removeNode</span> (line <span class="line-number">138</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Remove a Node from the Graph</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- <li><span class="field">todo:</span> This is unimplemented</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- removeNode
- </span>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></span>&nbsp;<span class="var-name">&$node</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type"><a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></span>
- <span class="var-name">&$node</span><span class="var-description">: The node to be removed from the graph</span> </li>
- </ul>
-
-
- </div>
-
- </div>
- </div>
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs For Class Structures_Graph_Manipulator_AcyclicTest</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="class-name">Class Structures_Graph_Manipulator_AcyclicTest</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
-
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The Structures_Graph_Manipulator_AcyclicTest is a graph manipulator which tests whether a graph contains a cycle.</p>
-<p class="description"><p>The definition of an acyclic graph used in this manipulator is that of a DAG. The graph must be directed, or else it is considered cyclic, even when there are no arcs.</p></p>
- <ul class="tags">
- <li><span class="field">copyright:</span> (c) 2004 by Sérgio Carvalho</li>
- <li><span class="field">author:</span> Sérgio Carvalho &lt;<a href="mailto:sergio.carvalho@portugalmail.com">mailto:sergio.carvalho@portugalmail.com</a>&gt;</li>
- </ul>
- <p class="notes">
- Located in <a class="field" href="_Structures_Graph_Manipulator_AcyclicTest_php.html">/Structures/Graph/Manipulator/AcyclicTest.php</a> (line <span class="field">55</span>)
- </p>
-
-
- <pre></pre>
-
- </div>
-</div>
-
-
-
- <a name="sec-method-summary"></a>
- <div class="info-box">
- <div class="info-box-title">Method Summary</span></div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
- </div>
- <div class="info-box-body">
- <div class="method-summary">
-
- <div class="method-definition">
- <span class="method-result">boolean</span>
- <a href="#isAcyclic" title="details" class="method-name">isAcyclic</a>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$graph</span>)
- </div>
- </div>
- </div>
- </div>
-
-
- <a name="sec-methods"></a>
- <div class="info-box">
- <div class="info-box-title">Methods</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
-
- </div>
- <div class="info-box-body">
- <A NAME='method_detail'></A>
-<a name="methodisAcyclic" id="isAcyclic"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">isAcyclic</span> (line <span class="line-number">126</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">isAcyclic returns true if a graph contains no cycles, false otherwise.</p>
- <ul class="tags">
- <li><span class="field">return:</span> true iff graph is acyclic</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">boolean</span>
- <span class="method-name">
- isAcyclic
- </span>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$graph</span>)
- </div>
-
-
-
- </div>
-
- </div>
- </div>
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs For Class Structures_Graph_Manipulator_TopologicalSorter</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="class-name">Class Structures_Graph_Manipulator_TopologicalSorter</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
-
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The Structures_Graph_Manipulator_TopologicalSorter is a manipulator which is able to return the set of nodes in a graph, sorted by topological order.</p>
-<p class="description"><p>A graph may only be sorted topologically iff it's a DAG. You can test it with the Structures_Graph_Manipulator_AcyclicTest.</p></p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html">Structures_Graph_Manipulator_AcyclicTest</a></li>
- <li><span class="field">copyright:</span> (c) 2004 by Sérgio Carvalho</li>
- <li><span class="field">author:</span> Sérgio Carvalho &lt;<a href="mailto:sergio.carvalho@portugalmail.com">mailto:sergio.carvalho@portugalmail.com</a>&gt;</li>
- </ul>
- <p class="notes">
- Located in <a class="field" href="_Structures_Graph_Manipulator_TopologicalSorter_php.html">/Structures/Graph/Manipulator/TopologicalSorter.php</a> (line <span class="field">58</span>)
- </p>
-
-
- <pre></pre>
-
- </div>
-</div>
-
-
-
- <a name="sec-method-summary"></a>
- <div class="info-box">
- <div class="info-box-title">Method Summary</span></div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
- </div>
- <div class="info-box-body">
- <div class="method-summary">
-
- <div class="method-definition">
- <span class="method-result">array</span>
- <a href="#sort" title="details" class="method-name">sort</a>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$graph</span>)
- </div>
- </div>
- </div>
- </div>
-
-
- <a name="sec-methods"></a>
- <div class="info-box">
- <div class="info-box-title">Methods</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
-
- </div>
- <div class="info-box-body">
- <A NAME='method_detail'></A>
-<a name="methodsort" id="sort"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">sort</span> (line <span class="line-number">133</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">sort returns the graph's nodes, sorted by topological order.</p>
-<p class="description"><p>The result is an array with as many entries as topological levels. Each entry in this array is an array of nodes within the given topological level.</p></p>
- <ul class="tags">
- <li><span class="field">return:</span> The graph's nodes, sorted by topological order.</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">array</span>
- <span class="method-name">
- sort
- </span>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$graph</span>)
- </div>
-
-
-
- </div>
-
- </div>
- </div>
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs For Class Structures_Graph_Node</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="class-name">Class Structures_Graph_Node</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
-
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The Structures_Graph_Node class represents a Node that can be member of a graph node set.</p>
-<p class="description"><p>A graph node can contain data. Under this API, the node contains default data, and key index data. It behaves, thus, both as a regular data node, and as a dictionary (or associative array) node.</p><p>Regular data is accessed via getData and setData. Key indexed data is accessed via getMetadata and setMetadata.</p></p>
- <ul class="tags">
- <li><span class="field">copyright:</span> (c) 2004 by Sérgio Carvalho</li>
- <li><span class="field">author:</span> Sérgio Carvalho &lt;<a href="mailto:sergio.carvalho@portugalmail.com">mailto:sergio.carvalho@portugalmail.com</a>&gt;</li>
- </ul>
- <p class="notes">
- Located in <a class="field" href="_Structures_Graph_Node_php.html">/Structures/Graph/Node.php</a> (line <span class="field">57</span>)
- </p>
-
-
- <pre></pre>
-
- </div>
-</div>
-
-
-
- <a name="sec-method-summary"></a>
- <div class="info-box">
- <div class="info-box-title">Method Summary</span></div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
- </div>
- <div class="info-box-body">
- <div class="method-summary">
-
- <div class="method-definition">
- <span class="method-result">Structures_Graph_Node</span>
- <a href="#Structures_Graph_Node" title="details" class="method-name">Structures_Graph_Node</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">boolean</span>
- <a href="#connectsTo" title="details" class="method-name">connectsTo</a>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$target</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">void</span>
- <a href="#connectTo" title="details" class="method-name">connectTo</a>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$destinationNode</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">mixed</span>
- <a href="#getData" title="details" class="method-name">&amp;getData</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
- <a href="#getGraph" title="details" class="method-name">&amp;getGraph</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">mixed</span>
- <a href="#getMetadata" title="details" class="method-name">&amp;getMetadata</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$nullIfNonexistent</span> = <span class="var-default">false</span>])
- </div>
-
- <div class="method-definition">
- <span class="method-result">array</span>
- <a href="#getNeighbours" title="details" class="method-name">getNeighbours</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">integer</span>
- <a href="#inDegree" title="details" class="method-name">inDegree</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">boolean</span>
- <a href="#metadataKeyExists" title="details" class="method-name">metadataKeyExists</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">integer</span>
- <a href="#outDegree" title="details" class="method-name">outDegree</a>
- ()
- </div>
-
- <div class="method-definition">
- <span class="method-result">mixed</span>
- <a href="#setData" title="details" class="method-name">setData</a>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">void</span>
- <a href="#setGraph" title="details" class="method-name">setGraph</a>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$graph</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">void</span>
- <a href="#setMetadata" title="details" class="method-name">setMetadata</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
- </div>
-
- <div class="method-definition">
- <span class="method-result">void</span>
- <a href="#unsetMetadata" title="details" class="method-name">unsetMetadata</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
- </div>
- </div>
- </div>
- </div>
-
-
- <a name="sec-methods"></a>
- <div class="info-box">
- <div class="info-box-title">Methods</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
-
- </div>
- <div class="info-box-body">
- <A NAME='method_detail'></A>
-<a name="methodStructures_Graph_Node" id="Structures_Graph_Node"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">Constructor Structures_Graph_Node</span> (line <span class="line-number">78</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Constructor</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">Structures_Graph_Node</span>
- <span class="method-name">
- Structures_Graph_Node
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodconnectsTo" id="connectsTo"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">connectsTo</span> (line <span class="line-number">275</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Test wether this node has an arc to the target node</p>
- <ul class="tags">
- <li><span class="field">return:</span> True if the two nodes are connected</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">boolean</span>
- <span class="method-name">
- connectsTo
- </span>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$target</span>)
- </div>
-
-
-
- </div>
-<a name="methodconnectTo" id="connectTo"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">connectTo</span> (line <span class="line-number">236</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Connect this node to another one.</p>
-<p class="description"><p>If the graph is not directed, the reverse arc, connecting $destinationNode to $this is also created.</p></p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- connectTo
- </span>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$destinationNode</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
- <span class="var-name">&$destinationNode</span><span class="var-description">: Node to connect to</span> </li>
- </ul>
-
-
- </div>
-<a name="methodgetData" id="getData"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">getData</span> (line <span class="line-number">119</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Node data getter.</p>
-<p class="description"><p>Each graph node can contain a reference to one variable. This is the getter for that reference.</p></p>
- <ul class="tags">
- <li><span class="field">return:</span> Data stored in node</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">mixed</span>
- <span class="method-name">
- &amp;getData
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodgetGraph" id="getGraph"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">getGraph</span> (line <span class="line-number">90</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Node graph getter</p>
- <ul class="tags">
- <li><span class="field">return:</span> Graph where node is stored</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
- <span class="method-name">
- &amp;getGraph
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodgetMetadata" id="getMetadata"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">getMetadata</span> (line <span class="line-number">171</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Node metadata getter</p>
-<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an associative array or in a dictionary. This method gets the data under the given key. If the key does not exist, an error will be thrown, so testing using metadataKeyExists might be needed.</p></p>
- <ul class="tags">
- <li><span class="field">return:</span> Metadata Data stored in node under given key</li>
- <li><span class="field">access:</span> public</li>
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Node.html#methodmetadataKeyExists">Structures_Graph_Node::metadataKeyExists()</a></li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">mixed</span>
- <span class="method-name">
- &amp;getMetadata
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$nullIfNonexistent</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$key</span><span class="var-description">: Key</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$nullIfNonexistent</span><span class="var-description">: nullIfNonexistent (defaults to false).</span> </li>
- </ul>
-
-
- </div>
-<a name="methodgetNeighbours" id="getNeighbours"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">getNeighbours</span> (line <span class="line-number">262</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Return nodes connected to this one.</p>
- <ul class="tags">
- <li><span class="field">return:</span> Array of nodes</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">array</span>
- <span class="method-name">
- getNeighbours
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodinDegree" id="inDegree"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">inDegree</span> (line <span class="line-number">309</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Calculate the in degree of the node.</p>
-<p class="description"><p>The indegree for a node is the number of arcs entering the node. For non directed graphs, the indegree is equal to the outdegree.</p></p>
- <ul class="tags">
- <li><span class="field">return:</span> In degree of the node</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">integer</span>
- <span class="method-name">
- inDegree
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodmetadataKeyExists" id="metadataKeyExists"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">metadataKeyExists</span> (line <span class="line-number">151</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Test for existence of metadata under a given key.</p>
-<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an associative array or in a dictionary. This method tests whether a given metadata key exists for this node.</p></p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">boolean</span>
- <span class="method-name">
- metadataKeyExists
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$key</span><span class="var-description">: Key to test</span> </li>
- </ul>
-
-
- </div>
-<a name="methodoutDegree" id="outDegree"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">outDegree</span> (line <span class="line-number">333</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Calculate the out degree of the node.</p>
-<p class="description"><p>The outdegree for a node is the number of arcs exiting the node. For non directed graphs, the outdegree is always equal to the indegree.</p></p>
- <ul class="tags">
- <li><span class="field">return:</span> Out degree of the node</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">integer</span>
- <span class="method-name">
- outDegree
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodsetData" id="setData"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">setData</span> (line <span class="line-number">134</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Node data setter</p>
-<p class="description"><p>Each graph node can contain a reference to one variable. This is the setter for that reference.</p></p>
- <ul class="tags">
- <li><span class="field">return:</span> Data to store in node</li>
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">mixed</span>
- <span class="method-name">
- setData
- </span>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
- </div>
-
-
-
- </div>
-<a name="methodsetGraph" id="setGraph"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">setGraph</span> (line <span class="line-number">104</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Node graph setter. This method should not be called directly. Use Graph::addNode instead.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph.html#methodaddNode">Structures_Graph::addNode()</a></li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- setGraph
- </span>
- (<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$graph</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
- <span class="var-name">&$graph</span><span class="var-description">: Set the graph for this node.</span> </li>
- </ul>
-
-
- </div>
-<a name="methodsetMetadata" id="setMetadata"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <span class="method-title">setMetadata</span> (line <span class="line-number">214</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Node metadata setter</p>
-<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an associative array or in a dictionary. This method stores data under the given key. If the key already exists, previously stored data is discarded.</p></p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- setMetadata
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$key</span><span class="var-description">: Key</span> </li>
- <li>
- <span class="var-type">mixed</span>
- <span class="var-name">$data</span><span class="var-description">: Data</span> </li>
- </ul>
-
-
- </div>
-<a name="methodunsetMetadata" id="unsetMetadata"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <span class="method-title">unsetMetadata</span> (line <span class="line-number">196</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Delete metadata by key</p>
-<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an associative array or in a dictionary. This method removes any data that might be stored under the provided key. If the key does not exist, no error is thrown, so it is safe using this method without testing for key existence.</p></p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- unsetMetadata
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$key</span><span class="var-description">: Key</span> </li>
- </ul>
-
-
- </div>
-
- </div>
- </div>
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Structures_Graph Tutorial</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-
-<div><a name="package.database.structures_graph.tutorial"></a><div class="ref-title-box"><h1 class="ref-title">Structures_Graph Tutorial</h1>
- <h2 class="ref-purpose">A first tour of graph datastructure manipulation</h2></div>
- <span><a name="package.database.structures_graph.tutorial.intro"></a><h2 class="title">Introduction</h2><p>Structures_Graph is a package for creating and manipulating graph datastructures. A graph is a set of objects, called nodes, connected by arcs. When used as a datastructure, usually nodes contain data, and arcs represent relationships between nodes. When arcs have a direction, and can be travelled only one way, graphs are said to be directed. When arcs have no direction, and can always be travelled both ways, graphs are said to be non directed.</p>
- <p>Structures_Graph provides an object oriented API to create and directly query a graph, as well as a set of Manipulator classes to extract information from the graph.</p></span>
- <span><a name="package.database.structures_graph.tutorial.creation"></a><h2 class="title">Creating a Graph</h2><p>Creating a graph is done using the simple constructor:
- <pre class="listing"><pre>
-require_once 'Structures/Graph.php';
-
-$directedGraph =&amp; new Structures_Graph(true);
-$nonDirectedGraph =&amp; new Structures_Graph(false);
- </pre></pre>
- and passing the constructor a flag telling it whether the graph should be directed. A directed graph will always be directed during its lifetime. It's a permanent characteristic.</p>
- <p>To fill out the graph, we'll need to create some nodes, and then call Graph::addNode.
- <pre class="listing"><pre>
-require_once 'Structures/Graph/Node.php';
-
-$nodeOne =&amp; new Structures_Graph_Node();
-$nodeTwo =&amp; new Structures_Graph_Node();
-$nodeThree =&amp; new Structures_Graph_Node();
-
-$directedGraph-&gt;addNode(&amp;$nodeOne);
-$directedGraph-&gt;addNode(&amp;$nodeTwo);
-$directedGraph-&gt;addNode(&amp;$nodeThree);
- </pre></pre>
- and then setup the arcs:
- <pre class="listing"><pre>
-$nodeOne-&gt;connectTo($nodeTwo);
-$nodeOne-&gt;connectTo($nodeThree);
- </pre></pre>
- Note that arcs can only be created after the nodes have been inserted into the graph.</p></span>
- <span><a name="package.database.structures_graph.tutorial.nodesanddata"></a><h2 class="title">Associating Data</h2><p>Graphs are only useful as datastructures if they can hold data. Structure_Graph stores data in nodes. Each node contains a setter and a getter for its data.
- <pre class="listing"><pre>
-$nodeOne-&gt;setData(&quot;Node One's Data is a String&quot;);
-$nodeTwo-&gt;setData(1976);
-$nodeThree-&gt;setData('Some other string');
-
-print(&quot;NodeTwo's Data is an integer: &quot; . $nodeTwo-&gt;getData());
- </pre></pre></p>
- <p>Structure_Graph nodes can also store metadata, alongside with the main data. Metadata differs from regular data just because it is stored under a key, making it possible to store more than one data reference per node. The metadata getter and setter need the key to perform the operation:
- <pre class="listing"><pre>
-$nodeOne-&gt;setMetadata('example key', &quot;Node One's Sample Metadata&quot;);
-print(&quot;Metadata stored under key 'example key' in node one: &quot; . $nodeOne-&gt;getMetadata('example key'));
-$nodeOne-&gt;unsetMetadata('example key');
- </pre></pre></p></span>
- <span><a name="package.database.structures_graph.tutorial.querying"></a><h2 class="title">Querying a Graph</h2><p>Structures_Graph provides for basic querying of the graph:
- <pre class="listing"><pre>
-// Nodes are able to calculate their indegree and outdegree
-print(&quot;NodeOne's inDegree: &quot; . $nodeOne-&gt;inDegree());
-print(&quot;NodeOne's outDegree: &quot; . $nodeOne-&gt;outDegree());
-
-// and naturally, nodes can report on their arcs
-$arcs = $nodeOne-&gt;getNeighbours();
-for ($i=0;$i&lt;sizeof($arcs);$i++) {
- print(&quot;NodeOne has an arc to &quot; . $arcs[$i]-&gt;getData());
-}
- </pre></pre></p></span></div>
-
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs for page AcyclicTest.php</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="file-name">/Structures/Graph/Manipulator/AcyclicTest.php</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-includes">Includes</a>
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">This file contains the definition of the Structures_Graph_Manipulator_AcyclicTest graph manipulator.</p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html">Structures_Graph_Manipulator_AcyclicTest</a></li>
- </ul>
-
- </div>
-</div>
-
- <a name="sec-classes"></a>
- <div class="info-box">
- <div class="info-box-title">Classes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Classes</span>
- | <a href="#sec-includes">Includes</a>
- </div>
- <div class="info-box-body">
- <table cellpadding="2" cellspacing="0" class="class-table">
- <tr>
- <th class="class-table-header">Class</th>
- <th class="class-table-header">Description</th>
- </tr>
- <tr>
- <td style="padding-right: 2em; vertical-align: top">
- <a href="../Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html">Structures_Graph_Manipulator_AcyclicTest</a>
- </td>
- <td>
- The Structures_Graph_Manipulator_AcyclicTest is a graph manipulator which tests whether a graph contains a cycle.
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <a name="sec-includes"></a>
- <div class="info-box">
- <div class="info-box-title">Includes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <span class="disabled">Includes</span>
- </div>
- <div class="info-box-body">
- <a name="_PEAR_php"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name">'PEAR.php'</span>)
- (line <span class="line-number">35</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
-<a name="_Structures/Graph_php"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_php.html">'Structures/Graph.php'</a></span>)
- (line <span class="line-number">37</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
-<a name="_Structures/Graph/Node_php"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_Node_php.html">'Structures/Graph/Node.php'</a></span>)
- (line <span class="line-number">39</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
- </div>
- </div>
-
-
-
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs for page TopologicalSorter.php</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="file-name">/Structures/Graph/Manipulator/TopologicalSorter.php</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-includes">Includes</a>
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">This file contains the definition of the Structures_Graph_Manipulator_TopologicalSorter class.</p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html">Structures_Graph_Manipulator_TopologicalSorter</a></li>
- </ul>
-
- </div>
-</div>
-
- <a name="sec-classes"></a>
- <div class="info-box">
- <div class="info-box-title">Classes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Classes</span>
- | <a href="#sec-includes">Includes</a>
- </div>
- <div class="info-box-body">
- <table cellpadding="2" cellspacing="0" class="class-table">
- <tr>
- <th class="class-table-header">Class</th>
- <th class="class-table-header">Description</th>
- </tr>
- <tr>
- <td style="padding-right: 2em; vertical-align: top">
- <a href="../Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html">Structures_Graph_Manipulator_TopologicalSorter</a>
- </td>
- <td>
- The Structures_Graph_Manipulator_TopologicalSorter is a manipulator which is able to return the set of nodes in a graph, sorted by topological order.
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <a name="sec-includes"></a>
- <div class="info-box">
- <div class="info-box-title">Includes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <span class="disabled">Includes</span>
- </div>
- <div class="info-box-body">
- <a name="_PEAR_php"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name">'PEAR.php'</span>)
- (line <span class="line-number">35</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
-<a name="_Structures/Graph_php"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_php.html">'Structures/Graph.php'</a></span>)
- (line <span class="line-number">37</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
-<a name="_Structures/Graph/Node_php"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_Node_php.html">'Structures/Graph/Node.php'</a></span>)
- (line <span class="line-number">39</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
-<a name="_Structures/Graph/Manipulator/AcyclicTest_php"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_Manipulator_AcyclicTest_php.html">'Structures/Graph/Manipulator/AcyclicTest.php'</a></span>)
- (line <span class="line-number">41</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
- </div>
- </div>
-
-
-
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs for page Node.php</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="file-name">/Structures/Graph/Node.php</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-includes">Includes</a>
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">This file contains the definition of the Structures_Graph_Node class</p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></li>
- </ul>
-
- </div>
-</div>
-
- <a name="sec-classes"></a>
- <div class="info-box">
- <div class="info-box-title">Classes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Classes</span>
- | <a href="#sec-includes">Includes</a>
- </div>
- <div class="info-box-body">
- <table cellpadding="2" cellspacing="0" class="class-table">
- <tr>
- <th class="class-table-header">Class</th>
- <th class="class-table-header">Description</th>
- </tr>
- <tr>
- <td style="padding-right: 2em; vertical-align: top">
- <a href="../Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a>
- </td>
- <td>
- The Structures_Graph_Node class represents a Node that can be member of a graph node set.
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <a name="sec-includes"></a>
- <div class="info-box">
- <div class="info-box-title">Includes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <span class="disabled">Includes</span>
- </div>
- <div class="info-box-body">
- <a name="_PEAR_php"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name">'PEAR.php'</span>)
- (line <span class="line-number">35</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
-<a name="_Structures/Graph_php"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_php.html">'Structures/Graph.php'</a></span>)
- (line <span class="line-number">37</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-</div>
- </div>
- </div>
-
-
-
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs for page Graph.php</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="file-name">/Structures/Graph.php</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-includes">Includes</a>
- | <a href="#sec-constants">Constants</a>
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The Graph.php file contains the definition of the Structures_Graph class</p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></li>
- </ul>
-
- </div>
-</div>
-
- <a name="sec-classes"></a>
- <div class="info-box">
- <div class="info-box-title">Classes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Classes</span>
- | <a href="#sec-includes">Includes</a>
- | <a href="#sec-constants">Constants</a>
- </div>
- <div class="info-box-body">
- <table cellpadding="2" cellspacing="0" class="class-table">
- <tr>
- <th class="class-table-header">Class</th>
- <th class="class-table-header">Description</th>
- </tr>
- <tr>
- <td style="padding-right: 2em; vertical-align: top">
- <a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a>
- </td>
- <td>
- The Structures_Graph class represents a graph data structure.
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- <a name="sec-includes"></a>
- <div class="info-box">
- <div class="info-box-title">Includes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <span class="disabled">Includes</span>
- | <a href="#sec-constants">Constants</a>
- </div>
- <div class="info-box-body">
- <a name="_Structures/Graph/Node_php"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name"><a href="../Structures_Graph/_Structures_Graph_Node_php.html">'Structures/Graph/Node.php'</a></span>)
- (line <span class="line-number">37</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Graph Node</p>
-
-</div>
-<a name="_PEAR_php"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <span class="include-title">
- <span class="include-type">require_once</span>
- (<span class="include-name">'PEAR.php'</span>)
- (line <span class="line-number">35</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">PEAR base classes</p>
-
-</div>
- </div>
- </div>
-
- <a name="sec-constants"></a>
- <div class="info-box">
- <div class="info-box-title">Constants</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-includes">Includes</a>
- | <span class="disabled">Constants</span>
- </div>
- <div class="info-box-body">
- <a name="defineSTRUCTURES_GRAPH_ERROR_GENERIC"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <span class="const-title">
- <span class="const-name">STRUCTURES_GRAPH_ERROR_GENERIC</span> = 100
- (line <span class="line-number">40</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-
-
-</div>
- </div>
- </div>
-
-
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </div></body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
-
-<!-- Start of Class Data -->
-<H2>
-
-</H2>
-<h2>Root class Structures_Graph</h2>
-<ul>
-<li><a href="Structures_Graph/Structures_Graph.html">Structures_Graph</a></li></ul>
-
-<h2>Root class Structures_Graph_Manipulator_AcyclicTest</h2>
-<ul>
-<li><a href="Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html">Structures_Graph_Manipulator_AcyclicTest</a></li></ul>
-
-<h2>Root class Structures_Graph_Manipulator_TopologicalSorter</h2>
-<ul>
-<li><a href="Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html">Structures_Graph_Manipulator_TopologicalSorter</a></li></ul>
-
-<h2>Root class Structures_Graph_Node</h2>
-<ul>
-<li><a href="Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a></li></ul>
-
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:28 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <a name="top"></a>
-<h2>Full index</h2>
-<h3>Package indexes</h3>
-<ul>
- <li><a href="elementindex_Structures_Graph.html">Structures_Graph</a></li>
-</ul>
-<br />
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex.html#a">a</a>
- <a class="index-letter" href="elementindex.html#c">c</a>
- <a class="index-letter" href="elementindex.html#g">g</a>
- <a class="index-letter" href="elementindex.html#i">i</a>
- <a class="index-letter" href="elementindex.html#m">m</a>
- <a class="index-letter" href="elementindex.html#n">n</a>
- <a class="index-letter" href="elementindex.html#o">o</a>
- <a class="index-letter" href="elementindex.html#r">r</a>
- <a class="index-letter" href="elementindex.html#s">s</a>
- <a class="index-letter" href="elementindex.html#t">t</a>
- <a class="index-letter" href="elementindex.html#u">u</a>
-</div>
-
- <a name="a"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">a</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">addNode</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodaddNode">Structures_Graph::addNode()</a> in Graph.php</div>
- <div class="index-item-description">Add a Node to the Graph</div>
- </dd>
- <dt class="field">
- <span class="include-title">AcyclicTest.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_Manipulator_AcyclicTest_php.html">AcyclicTest.php</a> in AcyclicTest.php</div>
- </dd>
- </dl>
- <a name="c"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">c</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">connectsTo</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodconnectsTo">Structures_Graph_Node::connectsTo()</a> in Node.php</div>
- <div class="index-item-description">Test wether this node has an arc to the target node</div>
- </dd>
- <dt class="field">
- <span class="method-title">connectTo</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodconnectTo">Structures_Graph_Node::connectTo()</a> in Node.php</div>
- <div class="index-item-description">Connect this node to another one.</div>
- </dd>
- </dl>
- <a name="g"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">g</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">getData</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetData">Structures_Graph_Node::getData()</a> in Node.php</div>
- <div class="index-item-description">Node data getter.</div>
- </dd>
- <dt class="field">
- <span class="method-title">getGraph</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetGraph">Structures_Graph_Node::getGraph()</a> in Node.php</div>
- <div class="index-item-description">Node graph getter</div>
- </dd>
- <dt class="field">
- <span class="method-title">getMetadata</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetMetadata">Structures_Graph_Node::getMetadata()</a> in Node.php</div>
- <div class="index-item-description">Node metadata getter</div>
- </dd>
- <dt class="field">
- <span class="method-title">getNeighbours</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetNeighbours">Structures_Graph_Node::getNeighbours()</a> in Node.php</div>
- <div class="index-item-description">Return nodes connected to this one.</div>
- </dd>
- <dt class="field">
- <span class="method-title">getNodes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodgetNodes">Structures_Graph::getNodes()</a> in Graph.php</div>
- <div class="index-item-description">Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted.</div>
- </dd>
- <dt class="field">
- <span class="include-title">Graph.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_php.html">Graph.php</a> in Graph.php</div>
- </dd>
- </dl>
- <a name="i"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">i</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">inDegree</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodinDegree">Structures_Graph_Node::inDegree()</a> in Node.php</div>
- <div class="index-item-description">Calculate the in degree of the node.</div>
- </dd>
- <dt class="field">
- <span class="method-title">isAcyclic</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html#methodisAcyclic">Structures_Graph_Manipulator_AcyclicTest::isAcyclic()</a> in AcyclicTest.php</div>
- <div class="index-item-description">isAcyclic returns true if a graph contains no cycles, false otherwise.</div>
- </dd>
- <dt class="field">
- <span class="method-title">isDirected</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodisDirected">Structures_Graph::isDirected()</a> in Graph.php</div>
- <div class="index-item-description">Return true if a graph is directed</div>
- </dd>
- </dl>
- <a name="m"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">m</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">metadataKeyExists</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodmetadataKeyExists">Structures_Graph_Node::metadataKeyExists()</a> in Node.php</div>
- <div class="index-item-description">Test for existence of metadata under a given key.</div>
- </dd>
- </dl>
- <a name="n"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">n</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="include-title">Node.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_Node_php.html">Node.php</a> in Node.php</div>
- </dd>
- </dl>
- <a name="o"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">o</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">outDegree</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodoutDegree">Structures_Graph_Node::outDegree()</a> in Node.php</div>
- <div class="index-item-description">Calculate the out degree of the node.</div>
- </dd>
- </dl>
- <a name="r"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">r</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">removeNode</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodremoveNode">Structures_Graph::removeNode()</a> in Graph.php</div>
- <div class="index-item-description">Remove a Node from the Graph</div>
- </dd>
- </dl>
- <a name="s"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">s</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">setData</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodsetData">Structures_Graph_Node::setData()</a> in Node.php</div>
- <div class="index-item-description">Node data setter</div>
- </dd>
- <dt class="field">
- <span class="method-title">setGraph</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodsetGraph">Structures_Graph_Node::setGraph()</a> in Node.php</div>
- <div class="index-item-description">Node graph setter. This method should not be called directly. Use Graph::addNode instead.</div>
- </dd>
- <dt class="field">
- <span class="method-title">setMetadata</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodsetMetadata">Structures_Graph_Node::setMetadata()</a> in Node.php</div>
- <div class="index-item-description">Node metadata setter</div>
- </dd>
- <dt class="field">
- <span class="method-title">sort</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html#methodsort">Structures_Graph_Manipulator_TopologicalSorter::sort()</a> in TopologicalSorter.php</div>
- <div class="index-item-description">sort returns the graph's nodes, sorted by topological order.</div>
- </dd>
- <dt class="field">
- Structures_Graph
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html">Structures_Graph</a> in Graph.php</div>
- <div class="index-item-description">The Structures_Graph class represents a graph data structure.</div>
- </dd>
- <dt class="field">
- <span class="method-title">Structures_Graph</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodStructures_Graph">Structures_Graph::Structures_Graph()</a> in Graph.php</div>
- <div class="index-item-description">Constructor</div>
- </dd>
- <dt class="field">
- <span class="const-title">STRUCTURES_GRAPH_ERROR_GENERIC</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_php.html#defineSTRUCTURES_GRAPH_ERROR_GENERIC">STRUCTURES_GRAPH_ERROR_GENERIC</a> in Graph.php</div>
- </dd>
- <dt class="field">
- Structures_Graph_Manipulator_AcyclicTest
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html">Structures_Graph_Manipulator_AcyclicTest</a> in AcyclicTest.php</div>
- <div class="index-item-description">The Structures_Graph_Manipulator_AcyclicTest is a graph manipulator which tests whether a graph contains a cycle.</div>
- </dd>
- <dt class="field">
- Structures_Graph_Manipulator_TopologicalSorter
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html">Structures_Graph_Manipulator_TopologicalSorter</a> in TopologicalSorter.php</div>
- <div class="index-item-description">The Structures_Graph_Manipulator_TopologicalSorter is a manipulator which is able to return the set of nodes in a graph, sorted by topological order.</div>
- </dd>
- <dt class="field">
- <span class="method-title">Structures_Graph_Node</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodStructures_Graph_Node">Structures_Graph_Node::Structures_Graph_Node()</a> in Node.php</div>
- <div class="index-item-description">Constructor</div>
- </dd>
- <dt class="field">
- Structures_Graph_Node
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a> in Node.php</div>
- <div class="index-item-description">The Structures_Graph_Node class represents a Node that can be member of a graph node set.</div>
- </dd>
- </dl>
- <a name="t"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">t</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="include-title">TopologicalSorter.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_Manipulator_TopologicalSorter_php.html">TopologicalSorter.php</a> in TopologicalSorter.php</div>
- </dd>
- </dl>
- <a name="u"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">u</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">unsetMetadata</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodunsetMetadata">Structures_Graph_Node::unsetMetadata()</a> in Node.php</div>
- <div class="index-item-description">Delete metadata by key</div>
- </dd>
- </dl>
-
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex.html#a">a</a>
- <a class="index-letter" href="elementindex.html#c">c</a>
- <a class="index-letter" href="elementindex.html#g">g</a>
- <a class="index-letter" href="elementindex.html#i">i</a>
- <a class="index-letter" href="elementindex.html#m">m</a>
- <a class="index-letter" href="elementindex.html#n">n</a>
- <a class="index-letter" href="elementindex.html#o">o</a>
- <a class="index-letter" href="elementindex.html#r">r</a>
- <a class="index-letter" href="elementindex.html#s">s</a>
- <a class="index-letter" href="elementindex.html#t">t</a>
- <a class="index-letter" href="elementindex.html#u">u</a>
-</div> </body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <a name="top"></a>
-<h2>[Structures_Graph] element index</h2>
-<a href="elementindex.html">All elements</a>
-<br />
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex_Structures_Graph.html#a">a</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#c">c</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#g">g</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#i">i</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#m">m</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#n">n</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#o">o</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#r">r</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#s">s</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#t">t</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#u">u</a>
-</div>
-
- <a name="a"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">a</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">addNode</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodaddNode">Structures_Graph::addNode()</a> in Graph.php</div>
- <div class="index-item-description">Add a Node to the Graph</div>
- </dd>
- <dt class="field">
- <span class="include-title">AcyclicTest.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_Manipulator_AcyclicTest_php.html">AcyclicTest.php</a> in AcyclicTest.php</div>
- </dd>
- </dl>
- <a name="c"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">c</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">connectsTo</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodconnectsTo">Structures_Graph_Node::connectsTo()</a> in Node.php</div>
- <div class="index-item-description">Test wether this node has an arc to the target node</div>
- </dd>
- <dt class="field">
- <span class="method-title">connectTo</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodconnectTo">Structures_Graph_Node::connectTo()</a> in Node.php</div>
- <div class="index-item-description">Connect this node to another one.</div>
- </dd>
- </dl>
- <a name="g"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">g</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">getData</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetData">Structures_Graph_Node::getData()</a> in Node.php</div>
- <div class="index-item-description">Node data getter.</div>
- </dd>
- <dt class="field">
- <span class="method-title">getGraph</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetGraph">Structures_Graph_Node::getGraph()</a> in Node.php</div>
- <div class="index-item-description">Node graph getter</div>
- </dd>
- <dt class="field">
- <span class="method-title">getMetadata</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetMetadata">Structures_Graph_Node::getMetadata()</a> in Node.php</div>
- <div class="index-item-description">Node metadata getter</div>
- </dd>
- <dt class="field">
- <span class="method-title">getNeighbours</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodgetNeighbours">Structures_Graph_Node::getNeighbours()</a> in Node.php</div>
- <div class="index-item-description">Return nodes connected to this one.</div>
- </dd>
- <dt class="field">
- <span class="method-title">getNodes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodgetNodes">Structures_Graph::getNodes()</a> in Graph.php</div>
- <div class="index-item-description">Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted.</div>
- </dd>
- <dt class="field">
- <span class="include-title">Graph.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_php.html">Graph.php</a> in Graph.php</div>
- </dd>
- </dl>
- <a name="i"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">i</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">inDegree</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodinDegree">Structures_Graph_Node::inDegree()</a> in Node.php</div>
- <div class="index-item-description">Calculate the in degree of the node.</div>
- </dd>
- <dt class="field">
- <span class="method-title">isAcyclic</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html#methodisAcyclic">Structures_Graph_Manipulator_AcyclicTest::isAcyclic()</a> in AcyclicTest.php</div>
- <div class="index-item-description">isAcyclic returns true if a graph contains no cycles, false otherwise.</div>
- </dd>
- <dt class="field">
- <span class="method-title">isDirected</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodisDirected">Structures_Graph::isDirected()</a> in Graph.php</div>
- <div class="index-item-description">Return true if a graph is directed</div>
- </dd>
- </dl>
- <a name="m"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">m</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">metadataKeyExists</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodmetadataKeyExists">Structures_Graph_Node::metadataKeyExists()</a> in Node.php</div>
- <div class="index-item-description">Test for existence of metadata under a given key.</div>
- </dd>
- </dl>
- <a name="n"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">n</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="include-title">Node.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_Node_php.html">Node.php</a> in Node.php</div>
- </dd>
- </dl>
- <a name="o"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">o</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">outDegree</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodoutDegree">Structures_Graph_Node::outDegree()</a> in Node.php</div>
- <div class="index-item-description">Calculate the out degree of the node.</div>
- </dd>
- </dl>
- <a name="r"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">r</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">removeNode</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodremoveNode">Structures_Graph::removeNode()</a> in Graph.php</div>
- <div class="index-item-description">Remove a Node from the Graph</div>
- </dd>
- </dl>
- <a name="s"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">s</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">setData</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodsetData">Structures_Graph_Node::setData()</a> in Node.php</div>
- <div class="index-item-description">Node data setter</div>
- </dd>
- <dt class="field">
- <span class="method-title">setGraph</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodsetGraph">Structures_Graph_Node::setGraph()</a> in Node.php</div>
- <div class="index-item-description">Node graph setter. This method should not be called directly. Use Graph::addNode instead.</div>
- </dd>
- <dt class="field">
- <span class="method-title">setMetadata</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodsetMetadata">Structures_Graph_Node::setMetadata()</a> in Node.php</div>
- <div class="index-item-description">Node metadata setter</div>
- </dd>
- <dt class="field">
- <span class="method-title">sort</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html#methodsort">Structures_Graph_Manipulator_TopologicalSorter::sort()</a> in TopologicalSorter.php</div>
- <div class="index-item-description">sort returns the graph's nodes, sorted by topological order.</div>
- </dd>
- <dt class="field">
- Structures_Graph
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html">Structures_Graph</a> in Graph.php</div>
- <div class="index-item-description">The Structures_Graph class represents a graph data structure.</div>
- </dd>
- <dt class="field">
- <span class="method-title">Structures_Graph</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph.html#methodStructures_Graph">Structures_Graph::Structures_Graph()</a> in Graph.php</div>
- <div class="index-item-description">Constructor</div>
- </dd>
- <dt class="field">
- <span class="const-title">STRUCTURES_GRAPH_ERROR_GENERIC</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_php.html#defineSTRUCTURES_GRAPH_ERROR_GENERIC">STRUCTURES_GRAPH_ERROR_GENERIC</a> in Graph.php</div>
- </dd>
- <dt class="field">
- Structures_Graph_Manipulator_AcyclicTest
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html">Structures_Graph_Manipulator_AcyclicTest</a> in AcyclicTest.php</div>
- <div class="index-item-description">The Structures_Graph_Manipulator_AcyclicTest is a graph manipulator which tests whether a graph contains a cycle.</div>
- </dd>
- <dt class="field">
- Structures_Graph_Manipulator_TopologicalSorter
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html">Structures_Graph_Manipulator_TopologicalSorter</a> in TopologicalSorter.php</div>
- <div class="index-item-description">The Structures_Graph_Manipulator_TopologicalSorter is a manipulator which is able to return the set of nodes in a graph, sorted by topological order.</div>
- </dd>
- <dt class="field">
- <span class="method-title">Structures_Graph_Node</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodStructures_Graph_Node">Structures_Graph_Node::Structures_Graph_Node()</a> in Node.php</div>
- <div class="index-item-description">Constructor</div>
- </dd>
- <dt class="field">
- Structures_Graph_Node
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html">Structures_Graph_Node</a> in Node.php</div>
- <div class="index-item-description">The Structures_Graph_Node class represents a Node that can be member of a graph node set.</div>
- </dd>
- </dl>
- <a name="t"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">t</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="include-title">TopologicalSorter.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/_Structures_Graph_Manipulator_TopologicalSorter_php.html">TopologicalSorter.php</a> in TopologicalSorter.php</div>
- </dd>
- </dl>
- <a name="u"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">u</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <span class="method-title">unsetMetadata</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Structures_Graph/Structures_Graph_Node.html#methodunsetMetadata">Structures_Graph_Node::unsetMetadata()</a> in Node.php</div>
- <div class="index-item-description">Delete metadata by key</div>
- </dd>
- </dl>
-
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex_Structures_Graph.html#a">a</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#c">c</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#g">g</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#i">i</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#m">m</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#n">n</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#o">o</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#r">r</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#s">s</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#t">t</a>
- <a class="index-letter" href="elementindex_Structures_Graph.html#u">u</a>
-</div> </body>
-</html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>phpDocumentor Parser Errors and Warnings</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <a href="#Post-parsing">Post-parsing</a><br>
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </body>
-</html>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <!-- Generated by phpDocumentor on Fri, 30 Jan 2004 16:37:28 +0000 -->
- <title>Structures_Graph Documentation</title>
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
-</head>
-
-<FRAMESET rows='100,*'>
- <FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
- <FRAMESET cols='25%,*'>
- <FRAME src='li_Structures_Graph.html' name='left_bottom' frameborder="1" bordercolor="#999999">
- <FRAME src='Structures_Graph/tutorial_Structures_Graph.pkg.html' name='right' frameborder="1" bordercolor="#999999">
- </FRAMESET>
- <NOFRAMES>
- <H2>Frame Alert</H2>
- <P>This document is designed to be viewed using the frames feature.
- If you see this message, you are using a non-frame-capable web client.</P>
- </NOFRAMES>
-</FRAMESET>
-</HTML>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="package-title">Structures_Graph</div>
-<div class="package-details">
-
- <dl class="tree">
-
- <dt class="folder-title">Description</dt>
- <dd>
- <a href='classtrees_Structures_Graph.html' target='right'>Class trees</a><br />
- <a href='elementindex_Structures_Graph.html' target='right'>Index of elements</a><br />
- <a href="todolist.html" target="right">Todo List</a><br />
- </dd>
-
-
-
- <dt class="folder-title">Tutorials/Manuals</dt>
- <dd>
- <dl class="tree">
- <dt class="folder-title">Package-level</dt>
- <dd>
- <div><a href="Structures_Graph/tutorial_Structures_Graph.pkg.html" target="right">Structures_Graph Tutorial</a></div>
-
- </dd>
- </dl>
-
-
- </dd>
- <dt class="folder-title">Classes</dt>
- <dd><a href='Structures_Graph/Structures_Graph.html' target='right'>Structures_Graph</a></dd>
- <dd><a href='Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html' target='right'>Structures_Graph_Manipulator_AcyclicTest</a></dd>
- <dd><a href='Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html' target='right'>Structures_Graph_Manipulator_TopologicalSorter</a></dd>
- <dd><a href='Structures_Graph/Structures_Graph_Node.html' target='right'>Structures_Graph_Node</a></dd>
- <dt class="folder-title">Files</dt>
- <dd><a href='Structures_Graph/_Structures_Graph_Manipulator_AcyclicTest_php.html' target='right'>AcyclicTest.php</a></dd>
- <dd><a href='Structures_Graph/_Structures_Graph_php.html' target='right'>Graph.php</a></dd>
- <dd><a href='Structures_Graph/_Structures_Graph_Node_php.html' target='right'>Node.php</a></dd>
- <dd><a href='Structures_Graph/_Structures_Graph_Manipulator_TopologicalSorter_php.html' target='right'>TopologicalSorter.php</a></dd>
-
-
- </dl>
-</div>
-<p class="notes"><a href="http://www.phpdoc.org" target="_blank">phpDocumentor v <span class="field">1.2.3</span></a></p>
-</BODY>
-</HTML>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <link rel="stylesheet" href="media/banner.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="banner">
- <div class="banner-title">Structures_Graph</div>
- <div class="banner-menu">
- <table cellpadding="0" cellspacing="0" style="width: 100%">
- <tr>
- <td>
- </td>
- <td style="width: 2em">&nbsp;</td>
- <td style="text-align: right">
- </td>
- </tr>
- </table>
- </div>
- </div>
- </body>
- </html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Todo List</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div align="center"><h1>Todo List</h1></div>
-<h2>Structures_Graph</h2>
-<h3><a href="Structures_Graph/Structures_Graph.html#methodremoveNode">Structures_Graph::removeNode()</a></h3>
-<ul>
- <li>This is unimplemented</li>
-</ul>
- <p class="notes" id="credit">
- Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
- </p>
- </body>
-</html>
+
<refnamediv>
<refname><classname>Structures_Graph</classname> Tutorial</refname>
<refpurpose>A first tour of graph datastructure manipulation</refpurpose>
@@ -93665,15 +91116,7 @@ for ($i=0;$i<sizeof($arcs);$i++) {
</para>
</refsect1>
</refentry>
-
-(cd ..; tar czf docs/arch.tgz "{arch}")
-rm -Rf "../{arch}"
-rm -Rf ./html
-mkdir -p ./html
-phpdoc --directory ../Structures,./tutorials --target ./html --title "Structures_Graph Documentation" --output "HTML:frames" --defaultpackagename structures_graph --defaultcategoryname structures --pear
-(cd ..; tar --absolute-names -xzf docs/arch.tgz)
-#rm arch.tgz
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +-----------------------------------------------------------------------------+
// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
@@ -93734,10 +91177,9 @@ class Structures_Graph_Manipulator_AcyclicTest {
* This is a variant of Structures_Graph::inDegree which does
* not count nodes marked as visited.
*
- * @access private
* @return integer Number of non-visited nodes that link to this one
*/
- function _nonVisitedInDegree(&$node) {
+ protected static function _nonVisitedInDegree(&$node) {
$result = 0;
$graphNodes =& $node->_graph->getNodes();
foreach (array_keys($graphNodes) as $key) {
@@ -93750,9 +91192,9 @@ class Structures_Graph_Manipulator_AcyclicTest {
/* _isAcyclic {{{ */
/**
- * @access private
- */
- function _isAcyclic(&$graph) {
+ * Check if the graph is acyclic
+ */
+ protected static function _isAcyclic(&$graph) {
// Mark every node as not visited
$nodes =& $graph->getNodes();
$nodeKeys = array_keys($nodes);
@@ -93796,9 +91238,8 @@ class Structures_Graph_Manipulator_AcyclicTest {
* isAcyclic returns true if a graph contains no cycles, false otherwise.
*
* @return boolean true iff graph is acyclic
- * @access public
*/
- function isAcyclic(&$graph) {
+ public static function isAcyclic(&$graph) {
// We only test graphs
if (!is_a($graph, 'Structures_Graph')) return Pear::raiseError('Structures_Graph_Manipulator_AcyclicTest::isAcyclic received an object that is not a Structures_Graph', STRUCTURES_GRAPH_ERROR_GENERIC);
if (!$graph->isDirected()) return false; // Only directed graphs may be acyclic
@@ -93809,7 +91250,7 @@ class Structures_Graph_Manipulator_AcyclicTest {
}
/* }}} */
?>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +-----------------------------------------------------------------------------+
// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
@@ -93837,22 +91278,14 @@ class Structures_Graph_Manipulator_AcyclicTest {
/**
* This file contains the definition of the Structures_Graph_Manipulator_TopologicalSorter class.
*
- * @see Structures_Graph_Manipulator_TopologicalSorter
* @package Structures_Graph
*/
-/* dependencies {{{ */
-/** */
require_once 'PEAR.php';
-/** */
require_once 'Structures/Graph.php';
-/** */
require_once 'Structures/Graph/Node.php';
-/** */
require_once 'Structures/Graph/Manipulator/AcyclicTest.php';
-/* }}} */
-/* class Structures_Graph_Manipulator_TopologicalSorter {{{ */
/**
* The Structures_Graph_Manipulator_TopologicalSorter is a manipulator
* which is able to return the set of nodes in a graph, sorted by topological
@@ -93861,44 +91294,55 @@ require_once 'Structures/Graph/Manipulator/AcyclicTest.php';
* A graph may only be sorted topologically iff it's a DAG. You can test it
* with the Structures_Graph_Manipulator_AcyclicTest.
*
- * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
- * @copyright (c) 2004 by Sérgio Carvalho
- * @see Structures_Graph_Manipulator_AcyclicTest
- * @package Structures_Graph
+ * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
+ * @copyright (c) 2004 by Sérgio Carvalho
+ * @see Structures_Graph_Manipulator_AcyclicTest
+ * @package Structures_Graph
*/
-class Structures_Graph_Manipulator_TopologicalSorter {
- /* _nonVisitedInDegree {{{ */
+class Structures_Graph_Manipulator_TopologicalSorter
+{
/**
- *
- * This is a variant of Structures_Graph::inDegree which does
- * not count nodes marked as visited.
- *
- * @access private
- * @return integer Number of non-visited nodes that link to this one
- */
- function _nonVisitedInDegree(&$node) {
+ * This is a variant of Structures_Graph::inDegree which does
+ * not count nodes marked as visited.
+ *
+ * @param object $node Node to check
+ *
+ * @return integer Number of non-visited nodes that link to this one
+ */
+ protected static function _nonVisitedInDegree(&$node)
+ {
$result = 0;
$graphNodes =& $node->_graph->getNodes();
foreach (array_keys($graphNodes) as $key) {
- if ((!$graphNodes[$key]->getMetadata('topological-sort-visited')) && $graphNodes[$key]->connectsTo($node)) $result++;
+ if ((!$graphNodes[$key]->getMetadata('topological-sort-visited'))
+ && $graphNodes[$key]->connectsTo($node)
+ ) {
+ $result++;
+ }
}
return $result;
}
- /* }}} */
- /* _sort {{{ */
/**
- * @access private
- */
- function _sort(&$graph) {
+ * Sort implementation
+ *
+ * @param object $graph Graph to sort
+ *
+ * @return void
+ */
+ protected static function _sort(&$graph)
+ {
// Mark every node as not visited
$nodes =& $graph->getNodes();
$nodeKeys = array_keys($nodes);
$refGenerator = array();
- foreach($nodeKeys as $key) {
+ foreach ($nodeKeys as $key) {
$refGenerator[] = false;
- $nodes[$key]->setMetadata('topological-sort-visited', $refGenerator[sizeof($refGenerator) - 1]);
+ $nodes[$key]->setMetadata(
+ 'topological-sort-visited',
+ $refGenerator[sizeof($refGenerator) - 1]
+ );
}
// Iteratively peel off leaf nodes
@@ -93906,43 +91350,61 @@ class Structures_Graph_Manipulator_TopologicalSorter {
do {
// Find out which nodes are leafs (excluding visited nodes)
$leafNodes = array();
- foreach($nodeKeys as $key) {
- if ((!$nodes[$key]->getMetadata('topological-sort-visited')) && Structures_Graph_Manipulator_TopologicalSorter::_nonVisitedInDegree($nodes[$key]) == 0) {
+ foreach ($nodeKeys as $key) {
+ if ((!$nodes[$key]->getMetadata('topological-sort-visited'))
+ && static::_nonVisitedInDegree($nodes[$key]) == 0
+ ) {
$leafNodes[] =& $nodes[$key];
}
}
// Mark leafs as visited
$refGenerator[] = $topologicalLevel;
- for ($i=sizeof($leafNodes) - 1; $i>=0; $i--) {
+ for ($i = sizeof($leafNodes) - 1; $i>=0; $i--) {
$visited =& $leafNodes[$i]->getMetadata('topological-sort-visited');
$visited = true;
$leafNodes[$i]->setMetadata('topological-sort-visited', $visited);
- $leafNodes[$i]->setMetadata('topological-sort-level', $refGenerator[sizeof($refGenerator) - 1]);
+ $leafNodes[$i]->setMetadata(
+ 'topological-sort-level',
+ $refGenerator[sizeof($refGenerator) - 1]
+ );
}
$topologicalLevel++;
} while (sizeof($leafNodes) > 0);
// Cleanup visited marks
- foreach($nodeKeys as $key) $nodes[$key]->unsetMetadata('topological-sort-visited');
+ foreach ($nodeKeys as $key) {
+ $nodes[$key]->unsetMetadata('topological-sort-visited');
+ }
}
- /* }}} */
- /* sort {{{ */
/**
- *
- * sort returns the graph's nodes, sorted by topological order.
- *
- * The result is an array with
- * as many entries as topological levels. Each entry in this array is an array of nodes within
- * the given topological level.
- *
- * @return array The graph's nodes, sorted by topological order.
- * @access public
- */
- function sort(&$graph) {
+ * Sort returns the graph's nodes, sorted by topological order.
+ *
+ * The result is an array with as many entries as topological levels.
+ * Each entry in this array is an array of nodes within
+ * the given topological level.
+ *
+ * @param object $graph Graph to sort
+ *
+ * @return array The graph's nodes, sorted by topological order.
+ */
+ public static function sort(&$graph)
+ {
// We only sort graphs
- if (!is_a($graph, 'Structures_Graph')) return Pear::raiseError('Structures_Graph_Manipulator_TopologicalSorter::sort received an object that is not a Structures_Graph', STRUCTURES_GRAPH_ERROR_GENERIC);
- if (!Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph)) return Pear::raiseError('Structures_Graph_Manipulator_TopologicalSorter::sort received an graph that has cycles', STRUCTURES_GRAPH_ERROR_GENERIC);
+ if (!is_a($graph, 'Structures_Graph')) {
+ return Pear::raiseError(
+ 'Structures_Graph_Manipulator_TopologicalSorter::sort received'
+ . ' an object that is not a Structures_Graph',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
+ if (!Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph)) {
+ return Pear::raiseError(
+ 'Structures_Graph_Manipulator_TopologicalSorter::sort'
+ . ' received an graph that has cycles',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
Structures_Graph_Manipulator_TopologicalSorter::_sort($graph);
$result = array();
@@ -93950,19 +91412,21 @@ class Structures_Graph_Manipulator_TopologicalSorter {
// Fill out result array
$nodes =& $graph->getNodes();
$nodeKeys = array_keys($nodes);
- foreach($nodeKeys as $key) {
- if (!array_key_exists($nodes[$key]->getMetadata('topological-sort-level'), $result)) $result[$nodes[$key]->getMetadata('topological-sort-level')] = array();
- $result[$nodes[$key]->getMetadata('topological-sort-level')][] =& $nodes[$key];
+ foreach ($nodeKeys as $key) {
+ if (!array_key_exists($nodes[$key]->getMetadata('topological-sort-level'), $result)) {
+ $result[$nodes[$key]->getMetadata('topological-sort-level')]
+ = array();
+ }
+ $result[$nodes[$key]->getMetadata('topological-sort-level')][]
+ =& $nodes[$key];
$nodes[$key]->unsetMetadata('topological-sort-level');
}
return $result;
}
- /* }}} */
}
-/* }}} */
?>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +-----------------------------------------------------------------------------+
// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
@@ -94095,7 +91559,7 @@ class Structures_Graph_Node {
* @return mixed Data to store in node
* @access public
*/
- function setData($data) {
+ function setData(&$data) {
$this->_data =& $data;
}
/* }}} */
@@ -94177,7 +91641,7 @@ class Structures_Graph_Node {
* @param mixed Data
* @access public
*/
- function setMetadata($key, $data) {
+ function setMetadata($key, &$data) {
$this->_metadata[$key] =& $data;
}
/* }}} */
@@ -94304,7 +91768,7 @@ class Structures_Graph_Node {
/* }}} */
}
?>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +-----------------------------------------------------------------------------+
// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
@@ -94332,14 +91796,11 @@ class Structures_Graph_Node {
/**
* The Graph.php file contains the definition of the Structures_Graph class
*
- * @see Structures_Graph
* @package Structures_Graph
*/
/* dependencies {{{ */
-/** PEAR base classes */
require_once 'PEAR.php';
-/** Graph Node */
require_once 'Structures/Graph/Node.php';
/* }}} */
@@ -94354,65 +91815,86 @@ define('STRUCTURES_GRAPH_ERROR_GENERIC', 100);
* directional, and can be traveled only one way. In an undirected graph, arcs
* are bidirectional, and can be traveled both ways.
*
- * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
- * @copyright (c) 2004 by Sérgio Carvalho
- * @package Structures_Graph
+ * @author Sérgio Carvalho <sergio.carvalho@portugalmail.com>
+ * @copyright (c) 2004 by Sérgio Carvalho
+ * @package Structures_Graph
*/
/* }}} */
-class Structures_Graph {
- /* fields {{{ */
+class Structures_Graph
+{
/**
+ * List of node objects in this graph
* @access private
*/
var $_nodes = array();
+
/**
+ * If the graph is directed or not
* @access private
*/
var $_directed = false;
- /* }}} */
- /* Constructor {{{ */
+
/**
- *
- * Constructor
- *
- * @param boolean Set to true if the graph is directed. Set to false if it is not directed. (Optional, defaults to true)
- * @access public
- */
- function Structures_Graph($directed = true) {
+ * Constructor
+ *
+ * @param boolean $directed Set to true if the graph is directed.
+ * Set to false if it is not directed.
+ */
+ public function __construct($directed = true)
+ {
$this->_directed = $directed;
}
- /* }}} */
- /* isDirected {{{ */
/**
- *
- * Return true if a graph is directed
- *
- * @return boolean true if the graph is directed
- * @access public
- */
- function isDirected() {
+ * Old constructor (PHP4-style; kept for BC with extending classes)
+ *
+ * @param boolean $directed Set to true if the graph is directed.
+ * Set to false if it is not directed.
+ *
+ * @return void
+ */
+ public function Structures_Graph($directed = true)
+ {
+ $this->__construct($directed);
+ }
+
+ /**
+ * Return true if a graph is directed
+ *
+ * @return boolean true if the graph is directed
+ */
+ public function isDirected()
+ {
return (boolean) $this->_directed;
}
- /* }}} */
- /* addNode {{{ */
/**
- *
- * Add a Node to the Graph
- *
- * @param Structures_Graph_Node The node to be added.
- * @access public
- */
- function addNode(&$newNode) {
+ * Add a Node to the Graph
+ *
+ * @param Structures_Graph_Node $newNode The node to be added.
+ *
+ * @return void
+ */
+ public function addNode(&$newNode)
+ {
// We only add nodes
- if (!is_a($newNode, 'Structures_Graph_Node')) return Pear::raiseError('Structures_Graph::addNode received an object that is not a Structures_Graph_Node', STRUCTURES_GRAPH_ERROR_GENERIC);
- // Graphs are node *sets*, so duplicates are forbidden. We allow nodes that are exactly equal, but disallow equal references.
- foreach($this->_nodes as $key => $node) {
+ if (!is_a($newNode, 'Structures_Graph_Node')) {
+ return Pear::raiseError(
+ 'Structures_Graph::addNode received an object that is not'
+ . ' a Structures_Graph_Node',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
+
+ //Graphs are node *sets*, so duplicates are forbidden.
+ // We allow nodes that are exactly equal, but disallow equal references.
+ foreach ($this->_nodes as $key => $node) {
/*
- ZE1 equality operators choke on the recursive cycle introduced by the _graph field in the Node object.
- So, we'll check references the hard way (change $this->_nodes[$key] and check if the change reflects in
+ ZE1 equality operators choke on the recursive cycle introduced
+ by the _graph field in the Node object.
+ So, we'll check references the hard way
+ (change $this->_nodes[$key] and check if the change reflects in
$node)
*/
$savedData = $this->_nodes[$key];
@@ -94420,45 +91902,69 @@ class Structures_Graph {
$this->_nodes[$key] = true;
if ($node === true) {
$this->_nodes[$key] = false;
- if ($node === false) $referenceIsEqualFlag = true;
+ if ($node === false) {
+ $referenceIsEqualFlag = true;
+ }
}
$this->_nodes[$key] = $savedData;
- if ($referenceIsEqualFlag) return Pear::raiseError('Structures_Graph::addNode received an object that is a duplicate for this dataset', STRUCTURES_GRAPH_ERROR_GENERIC);
+ if ($referenceIsEqualFlag) {
+ return Pear::raiseError(
+ 'Structures_Graph::addNode received an object that is'
+ . ' a duplicate for this dataset',
+ STRUCTURES_GRAPH_ERROR_GENERIC
+ );
+ }
}
$this->_nodes[] =& $newNode;
$newNode->setGraph($this);
}
- /* }}} */
- /* removeNode (unimplemented) {{{ */
/**
- *
- * Remove a Node from the Graph
- *
- * @todo This is unimplemented
- * @param Structures_Graph_Node The node to be removed from the graph
- * @access public
- */
- function removeNode(&$node) {
+ * Remove a Node from the Graph
+ *
+ * @param Structures_Graph_Node $node The node to be removed from the graph
+ *
+ * @return void
+ * @todo This is unimplemented
+ */
+ public function removeNode(&$node)
+ {
}
- /* }}} */
- /* getNodes {{{ */
/**
- *
- * Return the node set, in no particular order. For ordered node sets, use a Graph Manipulator insted.
- *
- * @access public
- * @see Structures_Graph_Manipulator_TopologicalSorter
- * @return array The set of nodes in this graph
- */
- function &getNodes() {
+ * Return the node set, in no particular order.
+ * For ordered node sets, use a Graph Manipulator insted.
+ *
+ * @return array The set of nodes in this graph
+ * @see Structures_Graph_Manipulator_TopologicalSorter
+ */
+ public function &getNodes()
+ {
return $this->_nodes;
}
- /* }}} */
}
?>
-
+
+require_once dirname(__FILE__) . '/helper.inc';
+
+class Structures_Graph_AllTests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('Structures_Graph Tests');
+
+ $dir = new GlobIterator(dirname(__FILE__) . '/*Test.php');
+ $suite->addTestFiles($dir);
+
+ return $suite;
+ }
+}
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
// +-----------------------------------------------------------------------------+
// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
@@ -94484,8 +91990,7 @@ class Structures_Graph {
// +-----------------------------------------------------------------------------+
//
-require_once 'Structures/Graph.php';
-require_once 'PHPUnit/Framework.php';
+require_once dirname(__FILE__) . '/helper.inc';
/**
* @access private
@@ -94538,23 +92043,23 @@ class BasicGraph extends PHPUnit_Framework_TestCase
$this->_graph = new Structures_Graph();
$data = 1;
$node = new Structures_Graph_Node();
- $node->setData(&$data);
+ $node->setData($data);
$this->_graph->addNode($node);
$data = 2;
$dataInNode =& $this->_graph->getNodes();
$dataInNode =& $dataInNode[0];
$dataInNode =& $dataInNode->getData();
- $this->assertTrue($data === $dataInNode);
+ $this->assertEquals($data, $dataInNode);
}
function test_metadata_references() {
$this->_graph = new Structures_Graph();
$data = 1;
$node = new Structures_Graph_Node();
- $node->setMetadata('5', &$data);
+ $node->setMetadata('5', $data);
$data = 2;
$dataInNode =& $node->getMetadata('5');
- $this->assertTrue($data === $dataInNode);
+ $this->assertEquals($data, $dataInNode);
}
function test_metadata_key_exists() {
@@ -94629,632 +92134,460 @@ class BasicGraph extends PHPUnit_Framework_TestCase
}
}
?>
-
+
+require_once dirname(__FILE__) . '/helper.inc';
+require_once 'Structures/Graph/Manipulator/TopologicalSorter.php';
-/**
- * Master Unit Test Suite file for Structures_Graph
- *
- * This top-level test suite file organizes
- * all class test suite files,
- * so that the full suite can be run
- * by PhpUnit or via "pear run-tests -u".
- *
- * PHP version 5
- *
- * @category XML
- * @package XML_Util
- * @subpackage UnitTesting
- * @author Chuck Burgess <ashnazg@php.net>
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
- * @link http://pear.php.net/package/XML_Util
- * @since 1.2.0a1
- */
+class TopologicalSorterTest extends PHPUnit_Framework_TestCase
+{
+ public function testSort()
+ {
+ $graph = new Structures_Graph();
+
+ $name1 = 'node1';
+ $node1 = new Structures_Graph_Node();
+ $node1->setData($name1);
+ $graph->addNode($node1);
+
+ $name11 = 'node11';
+ $node11 = new Structures_Graph_Node();
+ $node11->setData($name11);
+ $graph->addNode($node11);
+ $node1->connectTo($node11);
+
+ $name12 = 'node12';
+ $node12 = new Structures_Graph_Node();
+ $node12->setData($name12);
+ $graph->addNode($node12);
+ $node1->connectTo($node12);
+
+ $name121 = 'node121';
+ $node121 = new Structures_Graph_Node();
+ $node121->setData($name121);
+ $graph->addNode($node121);
+ $node12->connectTo($node121);
+
+ $name2 = 'node2';
+ $node2 = new Structures_Graph_Node();
+ $node2->setData($name2);
+ $graph->addNode($node2);
+
+ $name21 = 'node21';
+ $node21 = new Structures_Graph_Node();
+ $node21->setData($name21);
+ $graph->addNode($node21);
+ $node2->connectTo($node21);
+
+ $nodes = Structures_Graph_Manipulator_TopologicalSorter::sort($graph);
+ $this->assertCount(2, $nodes[0]);
+ $this->assertEquals('node1', $nodes[0][0]->getData());
+ $this->assertEquals('node2', $nodes[0][1]->getData());
+
+ $this->assertCount(3, $nodes[1]);
+ $this->assertEquals('node11', $nodes[1][0]->getData());
+ $this->assertEquals('node12', $nodes[1][1]->getData());
+ $this->assertEquals('node21', $nodes[1][2]->getData());
+
+ $this->assertCount(1, $nodes[2]);
+ $this->assertEquals('node121', $nodes[2][0]->getData());
+ }
+}
+?>
+
+require_once dirname(__FILE__) . '/helper.inc';
+require_once 'Structures/Graph/Manipulator/AcyclicTest.php';
+class AcyclicTestTest extends PHPUnit_Framework_TestCase
+{
+ public function testIsAcyclicFalse()
+ {
+ $graph = new Structures_Graph();
+ $node1 = new Structures_Graph_Node();
+ $graph->addNode($node1);
-/**
- * Check PHP version... PhpUnit v3+ requires at least PHP v5.1.4
- */
-if (version_compare(PHP_VERSION, "5.1.4") < 0) {
- // Cannnot run test suites
- echo 'Cannot run test suite via PhpUnit... requires at least PHP v5.1.4.' . PHP_EOL;
- echo 'Use "pear run-tests -p xml_util" to run the PHPT tests directly.' . PHP_EOL;
- exit(1);
-}
+ $node2 = new Structures_Graph_Node();
+ $graph->addNode($node2);
+ $node1->connectTo($node2);
+ $node3 = new Structures_Graph_Node();
+ $graph->addNode($node3);
+ $node2->connectTo($node3);
-/**
- * Derive the "main" method name
- * @internal PhpUnit would have to rename PHPUnit_MAIN_METHOD to PHPUNIT_MAIN_METHOD
- * to make this usage meet the PEAR CS... we cannot rename it here.
- */
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Structures_Graph_AllTests::main');
-}
+ $node3->connectTo($node1);
+ $this->assertFalse(
+ Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph),
+ 'Graph is cyclic'
+ );
+ }
-/*
- * Files needed by PhpUnit
- */
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
-require_once 'PHPUnit/Extensions/PhptTestSuite.php';
+ public function testIsAcyclicTrue()
+ {
+ $graph = new Structures_Graph();
+ $node1 = new Structures_Graph_Node();
+ $graph->addNode($node1);
-/*
- * You must add each additional class-level test suite file here
- */
-require_once dirname(__FILE__).'/testCase/BasicGraph.php';
+ $node2 = new Structures_Graph_Node();
+ $graph->addNode($node2);
+ $node1->connectTo($node2);
+
+ $node3 = new Structures_Graph_Node();
+ $graph->addNode($node3);
+ $node2->connectTo($node3);
+
+ $this->assertTrue(
+ Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph),
+ 'Graph is acyclic'
+ );
+ }
+}
+?>
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
+// +-----------------------------------------------------------------------------+
+// | Copyright (c) 2003 Sérgio Gonçalves Carvalho |
+// +-----------------------------------------------------------------------------+
+// | This file is part of Structures_Graph. |
+// | |
+// | Structures_Graph is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU Lesser General Public License as published by |
+// | the Free Software Foundation; either version 2.1 of the License, or |
+// | (at your option) any later version. |
+// | |
+// | Structures_Graph is distributed in the hope that it will be useful, |
+// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+// | GNU Lesser General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU Lesser General Public License |
+// | along with Structures_Graph; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
+// | 02111-1307 USA |
+// +-----------------------------------------------------------------------------+
+// | Author: Sérgio Carvalho <sergio.carvalho@portugalmail.com> |
+// +-----------------------------------------------------------------------------+
+//
+require_once dirname(__FILE__) . '/helper.inc';
/**
- * Master Unit Test Suite class for Structures_Graph
- *
- * This top-level test suite class organizes
- * all class test suite files,
- * so that the full suite can be run
- * by PhpUnit or via "pear run-tests -up Structures_Graph".
- *
- * @category Structures
- * @package Structures_Graph
- * @subpackage UnitTesting
- * @author Chuck Burgess <ashnazg@php.net>
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: @package_version@
- * @link http://pear.php.net/package/XML_Util
- * @since 1.2.0a1
+ * @access private
*/
-class Structures_Graph_AllTests
+class BasicGraph extends PHPUnit_Framework_TestCase
{
+ var $_graph = null;
- /**
- * Launches the TextUI test runner
- *
- * @return void
- * @uses PHPUnit_TextUI_TestRunner
- */
- public static function main()
- {
- PHPUnit_TextUI_TestRunner::run(self::suite());
+ function test_create_graph() {
+ $this->_graph = new Structures_Graph();
+ $this->assertTrue(is_a($this->_graph, 'Structures_Graph'));
}
+ function test_add_node() {
+ $this->_graph = new Structures_Graph();
+ $data = 1;
+ $node = new Structures_Graph_Node($data);
+ $this->_graph->addNode($node);
+ $node = new Structures_Graph_Node($data);
+ $this->_graph->addNode($node);
+ $node = new Structures_Graph_Node($data);
+ $this->_graph->addNode($node);
+ }
- /**
- * Adds all class test suites into the master suite
- *
- * @return PHPUnit_Framework_TestSuite a master test suite
- * containing all class test suites
- * @uses PHPUnit_Framework_TestSuite
- */
- public static function suite()
- {
- $suite = new PHPUnit_Framework_TestSuite(
- 'Structures_Graph Full Suite of Unit Tests');
+ function test_connect_node() {
+ $this->_graph = new Structures_Graph();
+ $data = 1;
+ $node1 = new Structures_Graph_Node($data);
+ $node2 = new Structures_Graph_Node($data);
+ $this->_graph->addNode($node1);
+ $this->_graph->addNode($node2);
+ $node1->connectTo($node2);
- /*
- * You must add each additional class-level test suite name here
- */
- $suite->addTestSuite('BasicGraph');
+ $node =& $this->_graph->getNodes();
+ $node =& $node[0];
+ $node = $node->getNeighbours();
+ $node =& $node[0];
+ /*
+ ZE1 == and === operators fail on $node,$node2 because of the recursion introduced
+ by the _graph field in the Node object. So, we'll use the stupid method for reference
+ testing
+ */
+ $node = true;
+ $this->assertTrue($node2);
+ $node = false;
+ $this->assertFalse($node2);
+ }
- return $suite;
+ function test_data_references() {
+ $this->_graph = new Structures_Graph();
+ $data = 1;
+ $node = new Structures_Graph_Node();
+ $node->setData($data);
+ $this->_graph->addNode($node);
+ $data = 2;
+ $dataInNode =& $this->_graph->getNodes();
+ $dataInNode =& $dataInNode[0];
+ $dataInNode =& $dataInNode->getData();
+ $this->assertEquals($data, $dataInNode);
}
-}
-/**
- * Call the main method if this file is executed directly
- * @internal PhpUnit would have to rename PHPUnit_MAIN_METHOD to PHPUNIT_MAIN_METHOD
- * to make this usage meet the PEAR CS... we cannot rename it here.
- */
-if (PHPUnit_MAIN_METHOD == 'Structures_Graph_AllTests::main') {
- Structures_Graph_AllTests::main();
-}
+ function test_metadata_references() {
+ $this->_graph = new Structures_Graph();
+ $data = 1;
+ $node = new Structures_Graph_Node();
+ $node->setMetadata('5', $data);
+ $data = 2;
+ $dataInNode =& $node->getMetadata('5');
+ $this->assertEquals($data, $dataInNode);
+ }
+
+ function test_metadata_key_exists() {
+ $this->_graph = new Structures_Graph();
+ $data = 1;
+ $node = new Structures_Graph_Node();
+ $node->setMetadata('5', $data);
+ $this->assertTrue($node->metadataKeyExists('5'));
+ $this->assertFalse($node->metadataKeyExists('1'));
+ }
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+ function test_directed_degree() {
+ $this->_graph = new Structures_Graph(true);
+ $node = array();
+ $node[] = new Structures_Graph_Node();
+ $node[] = new Structures_Graph_Node();
+ $node[] = new Structures_Graph_Node();
+ $this->_graph->addNode($node[0]);
+ $this->_graph->addNode($node[1]);
+ $this->_graph->addNode($node[2]);
+ $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 0 arcs');
+ $this->assertEquals(0, $node[1]->inDegree(), 'inDegree test failed for node 1 with 0 arcs');
+ $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 0 arcs');
+ $this->assertEquals(0, $node[0]->outDegree(), 'outDegree test failed for node 0 with 0 arcs');
+ $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 0 arcs');
+ $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 0 arcs');
+ $node[0]->connectTo($node[1]);
+ $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 1 arc');
+ $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 1 arc');
+ $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 1 arc');
+ $this->assertEquals(1, $node[0]->outDegree(), 'outDegree test failed for node 0 with 1 arc');
+ $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 1 arc');
+ $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 1 arc');
+ $node[0]->connectTo($node[2]);
+ $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 2 arcs');
+ $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 2 arcs');
+ $this->assertEquals(1, $node[2]->inDegree(), 'inDegree test failed for node 2 with 2 arcs');
+ $this->assertEquals(2, $node[0]->outDegree(), 'outDegree test failed for node 0 with 2 arcs');
+ $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 2 arcs');
+ $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 2 arcs');
+ }
+
+ function test_undirected_degree() {
+ $this->_graph = new Structures_Graph(false);
+ $node = array();
+ $node[] = new Structures_Graph_Node();
+ $node[] = new Structures_Graph_Node();
+ $node[] = new Structures_Graph_Node();
+ $this->_graph->addNode($node[0]);
+ $this->_graph->addNode($node[1]);
+ $this->_graph->addNode($node[2]);
+ $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 0 arcs');
+ $this->assertEquals(0, $node[1]->inDegree(), 'inDegree test failed for node 1 with 0 arcs');
+ $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 0 arcs');
+ $this->assertEquals(0, $node[0]->outDegree(), 'outDegree test failed for node 0 with 0 arcs');
+ $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 0 arcs');
+ $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 0 arcs');
+ $node[0]->connectTo($node[1]);
+ $this->assertEquals(1, $node[0]->inDegree(), 'inDegree test failed for node 0 with 1 arc');
+ $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 1 arc');
+ $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 1 arc');
+ $this->assertEquals(1, $node[0]->outDegree(), 'outDegree test failed for node 0 with 1 arc');
+ $this->assertEquals(1, $node[1]->outDegree(), 'outDegree test failed for node 1 with 1 arc');
+ $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 1 arc');
+ $node[0]->connectTo($node[2]);
+ $this->assertEquals(2, $node[0]->inDegree(), 'inDegree test failed for node 0 with 2 arcs');
+ $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 2 arcs');
+ $this->assertEquals(1, $node[2]->inDegree(), 'inDegree test failed for node 2 with 2 arcs');
+ $this->assertEquals(2, $node[0]->outDegree(), 'outDegree test failed for node 0 with 2 arcs');
+ $this->assertEquals(1, $node[1]->outDegree(), 'outDegree test failed for node 1 with 2 arcs');
+ $this->assertEquals(1, $node[2]->outDegree(), 'outDegree test failed for node 2 with 2 arcs');
+ }
+}
?>
-
- Version 2.1, February 1999
+
+if ('@php_dir@' == '@'.'php_dir'.'@') {
+ // This package hasn't been installed.
+ // Adjust path to ensure includes find files in working directory.
+ set_include_path(dirname(dirname(__FILE__))
+ . PATH_SEPARATOR . dirname(__FILE__)
+ . PATH_SEPARATOR . get_include_path());
+}
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+require_once 'Structures/Graph.php';
+
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
-
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
/**
* File/Directory manipulation
*
@@ -95265,7 +92598,6 @@ That's all there is to it!
* @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -95778,13 +93110,11 @@ class System
$path_elements[] = dirname($program);
$program = basename($program);
} else {
- // Honor safe mode
- if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) {
- $path = getenv('PATH');
- if (!$path) {
- $path = getenv('Path'); // some OSes are just stupid enough to do this
- }
+ $path = getenv('PATH');
+ if (!$path) {
+ $path = getenv('Path'); // some OSes are just stupid enough to do this
}
+
$path_elements = explode(PATH_SEPARATOR, $path);
}
@@ -95796,17 +93126,14 @@ class System
if (strpos($program, '.') !== false) {
array_unshift($exe_suffixes, '');
}
- // is_executable() is not available on windows for PHP4
- $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file';
} else {
$exe_suffixes = array('');
- $pear_is_executable = 'is_executable';
}
foreach ($exe_suffixes as $suff) {
foreach ($path_elements as $dir) {
$file = $dir . DIRECTORY_SEPARATOR . $program . $suff;
- if (@$pear_is_executable($file)) {
+ if (is_executable($file)) {
return $file;
}
}
@@ -95901,9 +93228,6 @@ class System
return $files;
}
}<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
/**
* XML_Util
*
@@ -95950,54 +93274,54 @@ class System
*/
/**
- * error code for invalid chars in XML name
+ * Error code for invalid chars in XML name
*/
define('XML_UTIL_ERROR_INVALID_CHARS', 51);
/**
- * error code for invalid chars in XML name
+ * Error code for invalid chars in XML name
*/
define('XML_UTIL_ERROR_INVALID_START', 52);
/**
- * error code for non-scalar tag content
+ * Error code for non-scalar tag content
*/
define('XML_UTIL_ERROR_NON_SCALAR_CONTENT', 60);
/**
- * error code for missing tag name
+ * Error code for missing tag name
*/
define('XML_UTIL_ERROR_NO_TAG_NAME', 61);
/**
- * replace XML entities
+ * Replace XML entities
*/
define('XML_UTIL_REPLACE_ENTITIES', 1);
/**
- * embedd content in a CData Section
+ * Embedd content in a CData Section
*/
define('XML_UTIL_CDATA_SECTION', 5);
/**
- * do not replace entitites
+ * Do not replace entitites
*/
define('XML_UTIL_ENTITIES_NONE', 0);
/**
- * replace all XML entitites
+ * Replace all XML entitites
* This setting will replace <, >, ", ' and &
*/
define('XML_UTIL_ENTITIES_XML', 1);
/**
- * replace only required XML entitites
+ * Replace only required XML entitites
* This setting will replace <, " and &
*/
define('XML_UTIL_ENTITIES_XML_REQUIRED', 2);
/**
- * replace HTML entitites
+ * Replace HTML entitites
* @link http://www.php.net/htmlentities
*/
define('XML_UTIL_ENTITIES_HTML', 3);
@@ -96013,33 +93337,30 @@ define('XML_UTIL_COLLAPSE_ALL', 1);
define('XML_UTIL_COLLAPSE_XHTML_ONLY', 2);
/**
- * utility class for working with XML documents
+ * Utility class for working with XML documents
*
-
* @category XML
* @package XML_Util
* @author Stephan Schmidt <schst@php.net>
* @copyright 2003-2008 Stephan Schmidt <schst@php.net>
* @license http://opensource.org/licenses/bsd-license New BSD License
- * @version Release: 1.2.3
+ * @version Release: 1.3.0
* @link http://pear.php.net/package/XML_Util
*/
class XML_Util
{
/**
- * return API version
+ * Return API version
*
* @return string $version API version
- * @access public
- * @static
*/
- function apiVersion()
+ public static function apiVersion()
{
return '1.1';
}
/**
- * replace XML entities
+ * Replace XML entities
*
* With the optional second parameter, you may select, which
* entities should be replaced.
@@ -96074,27 +93395,33 @@ class XML_Util
* by the htmlentities() function
*
* @return string string with replaced chars
- * @access public
- * @static
- * @see reverseEntities()
+ * @see reverseEntities()
*/
- function replaceEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML,
- $encoding = 'ISO-8859-1')
- {
+ public static function replaceEntities(
+ $string, $replaceEntities = XML_UTIL_ENTITIES_XML, $encoding = 'ISO-8859-1'
+ ) {
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_XML:
- return strtr($string, array(
- '&' => '&amp;',
- '>' => '&gt;',
- '<' => '&lt;',
- '"' => '&quot;',
- '\'' => '&apos;' ));
+ return strtr(
+ $string,
+ array(
+ '&' => '&amp;',
+ '>' => '&gt;',
+ '<' => '&lt;',
+ '"' => '&quot;',
+ '\'' => '&apos;'
+ )
+ );
break;
case XML_UTIL_ENTITIES_XML_REQUIRED:
- return strtr($string, array(
- '&' => '&amp;',
- '<' => '&lt;',
- '"' => '&quot;' ));
+ return strtr(
+ $string,
+ array(
+ '&' => '&amp;',
+ '<' => '&lt;',
+ '"' => '&quot;'
+ )
+ );
break;
case XML_UTIL_ENTITIES_HTML:
return htmlentities($string, ENT_COMPAT, $encoding);
@@ -96104,7 +93431,7 @@ class XML_Util
}
/**
- * reverse XML entities
+ * Reverse XML entities
*
* With the optional second parameter, you may select, which
* entities should be reversed.
@@ -96140,27 +93467,33 @@ class XML_Util
* by the html_entity_decode() function
*
* @return string string with replaced chars
- * @access public
- * @static
- * @see replaceEntities()
+ * @see replaceEntities()
*/
- function reverseEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML,
- $encoding = 'ISO-8859-1')
- {
+ public static function reverseEntities(
+ $string, $replaceEntities = XML_UTIL_ENTITIES_XML, $encoding = 'ISO-8859-1'
+ ) {
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_XML:
- return strtr($string, array(
- '&amp;' => '&',
- '&gt;' => '>',
- '&lt;' => '<',
- '&quot;' => '"',
- '&apos;' => '\'' ));
+ return strtr(
+ $string,
+ array(
+ '&amp;' => '&',
+ '&gt;' => '>',
+ '&lt;' => '<',
+ '&quot;' => '"',
+ '&apos;' => '\''
+ )
+ );
break;
case XML_UTIL_ENTITIES_XML_REQUIRED:
- return strtr($string, array(
- '&amp;' => '&',
- '&lt;' => '<',
- '&quot;' => '"' ));
+ return strtr(
+ $string,
+ array(
+ '&amp;' => '&',
+ '&lt;' => '<',
+ '&quot;' => '"'
+ )
+ );
break;
case XML_UTIL_ENTITIES_HTML:
return html_entity_decode($string, ENT_COMPAT, $encoding);
@@ -96170,7 +93503,7 @@ class XML_Util
}
/**
- * build an xml declaration
+ * Build an xml declaration
*
* <code>
* require_once 'XML/Util.php';
@@ -96184,13 +93517,12 @@ class XML_Util
* @param bool $standalone document is standalone (or not)
*
* @return string xml declaration
- * @access public
- * @static
- * @uses attributesToString() to serialize the attributes of the XML declaration
+ * @uses attributesToString() to serialize the attributes of the
+ * XML declaration
*/
- function getXMLDeclaration($version = '1.0', $encoding = null,
- $standalone = null)
- {
+ public static function getXMLDeclaration(
+ $version = '1.0', $encoding = null, $standalone = null
+ ) {
$attributes = array(
'version' => $version,
);
@@ -96203,12 +93535,14 @@ class XML_Util
$attributes['standalone'] = $standalone ? 'yes' : 'no';
}
- return sprintf('<?xml%s?>',
- XML_Util::attributesToString($attributes, false));
+ return sprintf(
+ '<?xml%s?>',
+ XML_Util::attributesToString($attributes, false)
+ );
}
/**
- * build a document type declaration
+ * Build a document type declaration
*
* <code>
* require_once 'XML/Util.php';
@@ -96223,12 +93557,11 @@ class XML_Util
* @param string $internalDtd internal dtd entries
*
* @return string doctype declaration
- * @access public
- * @static
- * @since 0.2
+ * @since 0.2
*/
- function getDocTypeDeclaration($root, $uri = null, $internalDtd = null)
- {
+ public static function getDocTypeDeclaration(
+ $root, $uri = null, $internalDtd = null
+ ) {
if (is_array($uri)) {
$ref = sprintf(' PUBLIC "%s" "%s"', $uri['id'], $uri['uri']);
} elseif (!empty($uri)) {
@@ -96245,7 +93578,7 @@ class XML_Util
}
/**
- * create string representation of an attribute list
+ * Create string representation of an attribute list
*
* <code>
* require_once 'XML/Util.php';
@@ -96277,14 +93610,13 @@ class XML_Util
* XML_UTIL_ENTITIES_HTML)
*
* @return string string representation of the attributes
- * @access public
- * @static
- * @uses replaceEntities() to replace XML entities in attribute values
- * @todo allow sort also to be an options array
+ * @uses replaceEntities() to replace XML entities in attribute values
+ * @todo allow sort also to be an options array
*/
- function attributesToString($attributes, $sort = true, $multiline = false,
- $indent = ' ', $linebreak = "\n", $entities = XML_UTIL_ENTITIES_XML)
- {
+ public static function attributesToString(
+ $attributes, $sort = true, $multiline = false,
+ $indent = ' ', $linebreak = "\n", $entities = XML_UTIL_ENTITIES_XML
+ ) {
/*
* second parameter may be an array
*/
@@ -96312,7 +93644,7 @@ class XML_Util
if ($sort) {
ksort($attributes);
}
- if ( !$multiline || count($attributes) == 1) {
+ if (!$multiline || count($attributes) == 1) {
foreach ($attributes as $key => $value) {
if ($entities != XML_UTIL_ENTITIES_NONE) {
if ($entities === XML_UTIL_CDATA_SECTION) {
@@ -96348,26 +93680,23 @@ class XML_Util
* or only XHTML (XML_UTIL_COLLAPSE_XHTML_ONLY) ones.
*
* @return string XML
- * @access public
- * @static
- * @todo PEAR CS - unable to avoid "space after open parens" error
- * in the IF branch
*/
- function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL)
+ public static function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL)
{
if ($mode == XML_UTIL_COLLAPSE_XHTML_ONLY) {
return preg_replace(
'/<(area|base(?:font)?|br|col|frame|hr|img|input|isindex|link|meta|'
. 'param)([^>]*)><\/\\1>/s',
'<\\1\\2 />',
- $xml);
+ $xml
+ );
} else {
return preg_replace('/<(\w+)([^>]*)><\/\\1>/s', '<\\1\\2 />', $xml);
}
}
/**
- * create a tag
+ * Create a tag
*
* This method will call XML_Util::createTagFromArray(), which
* is more flexible.
@@ -96398,16 +93727,15 @@ class XML_Util
* @param bool $sortAttributes Whether to sort the attributes or not
*
* @return string XML tag
- * @access public
- * @static
- * @see createTagFromArray()
- * @uses createTagFromArray() to create the tag
+ * @see createTagFromArray()
+ * @uses createTagFromArray() to create the tag
*/
- function createTag($qname, $attributes = array(), $content = null,
+ public static function createTag(
+ $qname, $attributes = array(), $content = null,
$namespaceUri = null, $replaceEntities = XML_UTIL_REPLACE_ENTITIES,
$multiline = false, $indent = '_auto', $linebreak = "\n",
- $sortAttributes = true)
- {
+ $sortAttributes = true
+ ) {
$tag = array(
'qname' => $qname,
'attributes' => $attributes
@@ -96423,13 +93751,15 @@ class XML_Util
$tag['namespaceUri'] = $namespaceUri;
}
- return XML_Util::createTagFromArray($tag, $replaceEntities, $multiline,
- $indent, $linebreak, $sortAttributes);
+ return XML_Util::createTagFromArray(
+ $tag, $replaceEntities, $multiline,
+ $indent, $linebreak, $sortAttributes
+ );
}
/**
- * create a tag from an array
- * this method awaits an array in the following format
+ * Create a tag from an array.
+ * This method awaits an array in the following format
* <pre>
* array(
* // qualified name of the tag
@@ -96478,27 +93808,31 @@ class XML_Util
* @param bool $sortAttributes Whether to sort the attributes or not
*
* @return string XML tag
- * @access public
- * @static
- * @see createTag()
+ *
+ * @see createTag()
* @uses attributesToString() to serialize the attributes of the tag
* @uses splitQualifiedName() to get local part and namespace of a qualified name
* @uses createCDataSection()
* @uses raiseError()
*/
- function createTagFromArray($tag, $replaceEntities = XML_UTIL_REPLACE_ENTITIES,
+ public static function createTagFromArray(
+ $tag, $replaceEntities = XML_UTIL_REPLACE_ENTITIES,
$multiline = false, $indent = '_auto', $linebreak = "\n",
- $sortAttributes = true)
- {
+ $sortAttributes = true
+ ) {
if (isset($tag['content']) && !is_scalar($tag['content'])) {
- return XML_Util::raiseError('Supplied non-scalar value as tag content',
- XML_UTIL_ERROR_NON_SCALAR_CONTENT);
+ return XML_Util::raiseError(
+ 'Supplied non-scalar value as tag content',
+ XML_UTIL_ERROR_NON_SCALAR_CONTENT
+ );
}
if (!isset($tag['qname']) && !isset($tag['localPart'])) {
- return XML_Util::raiseError('You must either supply a qualified name '
+ return XML_Util::raiseError(
+ 'You must either supply a qualified name '
. '(qname) or local tag name (localPart).',
- XML_UTIL_ERROR_NO_TAG_NAME);
+ XML_UTIL_ERROR_NO_TAG_NAME
+ );
}
// if no attributes hav been set, use empty attributes
@@ -96535,8 +93869,8 @@ class XML_Util
if (isset($tag['namespaceUri']) && !empty($tag['namespaceUri'])) {
// is a namespace given
if (isset($tag['namespace']) && !empty($tag['namespace'])) {
- $tag['attributes']['xmlns:' . $tag['namespace']] =
- $tag['namespaceUri'];
+ $tag['attributes']['xmlns:' . $tag['namespace']]
+ = $tag['namespaceUri'];
} else {
// define this Uri as the default namespace
$tag['attributes']['xmlns'] = $tag['namespaceUri'];
@@ -96551,8 +93885,10 @@ class XML_Util
}
// create attribute list
- $attList = XML_Util::attributesToString($tag['attributes'],
- $sortAttributes, $multiline, $indent, $linebreak);
+ $attList = XML_Util::attributesToString(
+ $tag['attributes'],
+ $sortAttributes, $multiline, $indent, $linebreak
+ );
if (!isset($tag['content']) || (string)$tag['content'] == '') {
$tag = sprintf('<%s%s />', $tag['qname'], $attList);
} else {
@@ -96563,18 +93899,21 @@ class XML_Util
$tag['content'] = XML_Util::createCDataSection($tag['content']);
break;
default:
- $tag['content'] = XML_Util::replaceEntities($tag['content'],
- $replaceEntities);
+ $tag['content'] = XML_Util::replaceEntities(
+ $tag['content'], $replaceEntities
+ );
break;
}
- $tag = sprintf('<%s%s>%s</%s>', $tag['qname'], $attList, $tag['content'],
- $tag['qname']);
+ $tag = sprintf(
+ '<%s%s>%s</%s>', $tag['qname'], $attList, $tag['content'],
+ $tag['qname']
+ );
}
return $tag;
}
/**
- * create a start element
+ * Create a start element
*
* <code>
* require_once 'XML/Util.php';
@@ -96595,14 +93934,13 @@ class XML_Util
* @param bool $sortAttributes Whether to sort the attributes or not
*
* @return string XML start element
- * @access public
- * @static
- * @see createEndElement(), createTag()
+ * @see createEndElement(), createTag()
*/
- function createStartElement($qname, $attributes = array(), $namespaceUri = null,
+ public static function createStartElement(
+ $qname, $attributes = array(), $namespaceUri = null,
$multiline = false, $indent = '_auto', $linebreak = "\n",
- $sortAttributes = true)
- {
+ $sortAttributes = true
+ ) {
// if no attributes hav been set, use empty attributes
if (!isset($attributes) || !is_array($attributes)) {
$attributes = array();
@@ -96630,14 +93968,16 @@ class XML_Util
}
// create attribute list
- $attList = XML_Util::attributesToString($attributes, $sortAttributes,
- $multiline, $indent, $linebreak);
+ $attList = XML_Util::attributesToString(
+ $attributes, $sortAttributes,
+ $multiline, $indent, $linebreak
+ );
$element = sprintf('<%s%s>', $qname, $attList);
return $element;
}
/**
- * create an end element
+ * Create an end element
*
* <code>
* require_once 'XML/Util.php';
@@ -96649,18 +93989,16 @@ class XML_Util
* @param string $qname qualified tagname (including namespace)
*
* @return string XML end element
- * @access public
- * @static
- * @see createStartElement(), createTag()
+ * @see createStartElement(), createTag()
*/
- function createEndElement($qname)
+ public static function createEndElement($qname)
{
$element = sprintf('</%s>', $qname);
return $element;
}
/**
- * create an XML comment
+ * Create an XML comment
*
* <code>
* require_once 'XML/Util.php';
@@ -96672,17 +94010,15 @@ class XML_Util
* @param string $content content of the comment
*
* @return string XML comment
- * @access public
- * @static
*/
- function createComment($content)
+ public static function createComment($content)
{
$comment = sprintf('<!-- %s -->', $content);
return $comment;
}
/**
- * create a CData section
+ * Create a CData section
*
* <code>
* require_once 'XML/Util.php';
@@ -96694,18 +94030,17 @@ class XML_Util
* @param string $data data of the CData section
*
* @return string CData section with content
- * @access public
- * @static
*/
- function createCDataSection($data)
+ public static function createCDataSection($data)
{
- return sprintf('<![CDATA[%s]]>',
- preg_replace('/\]\]>/', ']]]]><![CDATA[>', strval($data)));
-
+ return sprintf(
+ '<![CDATA[%s]]>',
+ preg_replace('/\]\]>/', ']]]]><![CDATA[>', strval($data))
+ );
}
/**
- * split qualified name and return namespace and local part
+ * Split qualified name and return namespace and local part
*
* <code>
* require_once 'XML/Util.php';
@@ -96725,10 +94060,8 @@ class XML_Util
* @param string $defaultNs default namespace (optional)
*
* @return array array containing namespace and local part
- * @access public
- * @static
*/
- function splitQualifiedName($qname, $defaultNs = null)
+ public static function splitQualifiedName($qname, $defaultNs = null)
{
if (strstr($qname, ':')) {
$tmp = explode(':', $qname);
@@ -96744,7 +94077,7 @@ class XML_Util
}
/**
- * check, whether string is valid XML name
+ * Check, whether string is valid XML name
*
* <p>XML names are used for tagname, attribute names and various
* other, lesser known entities.</p>
@@ -96765,33 +94098,39 @@ class XML_Util
* @param string $string string that should be checked
*
* @return mixed true, if string is a valid XML name, PEAR error otherwise
- * @access public
- * @static
+ *
* @todo support for other charsets
* @todo PEAR CS - unable to avoid 85-char limit on second preg_match
*/
- function isValidName($string)
+ public static function isValidName($string)
{
// check for invalid chars
if (!preg_match('/^[[:alpha:]_]\\z/', $string{0})) {
- return XML_Util::raiseError('XML names may only start with letter '
- . 'or underscore', XML_UTIL_ERROR_INVALID_START);
+ return XML_Util::raiseError(
+ 'XML names may only start with letter or underscore',
+ XML_UTIL_ERROR_INVALID_START
+ );
}
// check for invalid chars
- if (!preg_match('/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?[[:alpha:]_]([[:alnum:]\_\-\.]+)?\\z/',
- $string)
- ) {
- return XML_Util::raiseError('XML names may only contain alphanumeric '
+ $match = preg_match(
+ '/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?'
+ . '[[:alpha:]_]([[:alnum:]\_\-\.]+)?\\z/',
+ $string
+ );
+ if (!$match) {
+ return XML_Util::raiseError(
+ 'XML names may only contain alphanumeric '
. 'chars, period, hyphen, colon and underscores',
- XML_UTIL_ERROR_INVALID_CHARS);
+ XML_UTIL_ERROR_INVALID_CHARS
+ );
}
// XML name is valid
return true;
}
/**
- * replacement for XML_Util::raiseError
+ * Replacement for XML_Util::raiseError
*
* Avoids the necessity to always require
* PEAR.php
@@ -96800,18 +94139,16 @@ class XML_Util
* @param int $code error code
*
* @return PEAR_Error
- * @access public
- * @static
- * @todo PEAR CS - should this use include_once instead?
+ * @todo PEAR CS - should this use include_once instead?
*/
- function raiseError($msg, $code)
+ public static function raiseError($msg, $code)
{
- require_once 'phar://install-pear-nozlib.phar/' . 'PEAR.php';
+ include_once 'phar://install-pear-nozlib.phar/' . 'PEAR.php';
return PEAR::raiseError($msg, $code);
}
}
?>
-package.xml
+package.xml
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>XML_Util</name>
<channel>pear.php.net</channel>
@@ -96835,11 +94172,11 @@ package.xml
<email>davey@php.net</email>
<active>no</active>
</helper>
- <date>2014-06-07</date>
- <time>10:18:11</time>
+ <date>2015-02-27</date>
+ <time>12:11:41</time>
<version>
- <release>1.2.3</release>
- <api>1.2.0</api>
+ <release>1.3.0</release>
+ <api>1.3.0</api>
</version>
<stability>
<release>stable</release>
@@ -96847,7 +94184,8 @@ package.xml
</stability>
<license uri="http://opensource.org/licenses/bsd-license">BSD License</license>
<notes>
-Bug #20293 Broken installation for 1.2.2
+* Set minimum PHP version to 5.3.0
+* Mark static methods with static keyword
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@@ -96872,7 +94210,7 @@ Bug #20293 Broken installation for 1.2.2
<file baseinstalldir="/" md5sum="1850856692ff6c6df5e8acb16e1080ce" name="tests/testBug_4950.phpt" role="test" />
<file baseinstalldir="/" md5sum="b4127883df40a4b0d1736ad42215ee25" name="tests/testBug_5392.phpt" role="test" />
<file baseinstalldir="/" md5sum="b133427f8ea9b60c5bec7400cd5e4c7f" name="tests/testBug_18343.phpt" role="test" />
- <file baseinstalldir="/" md5sum="2697c0187cca3fae63ce8f925059746b" name="XML/Util.php" role="php">
+ <file baseinstalldir="/" md5sum="b702b9cd014402420453c66ae7a96803" name="XML/Util.php" role="php">
<tasks:replace from="@version@" to="version" type="package-info" />
</file>
</dir>
@@ -96880,7 +94218,7 @@ Bug #20293 Broken installation for 1.2.2
<dependencies>
<required>
<php>
- <min>4.3.0</min>
+ <min>5.3.0</min>
</php>
<pearinstaller>
<min>1.4.3</min>
@@ -97292,9 +94630,25 @@ Request #19750 examples/example.php encoding
Bug #20293 Broken installation for 1.2.2
</notes>
</release>
+ <release>
+ <version>
+ <release>1.3.0</release>
+ <api>1.3.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2015-02-27</date>
+ <license uri="http://opensource.org/licenses/bsd-license">BSD License</license>
+ <notes>
+* Set minimum PHP version to 5.3.0
+* Mark static methods with static keyword
+ </notes>
+ </release>
</changelog>
</package>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
@@ -97593,7 +94947,7 @@ Bug #20293 Broken installation for 1.2.2
print '</pre>';
print "\n<br><br>\n";
?>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
@@ -97738,7 +95092,7 @@ Bug #20293 Broken installation for 1.2.2
?>
-
+
XML_Util::apiVersion() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -97756,7 +95110,7 @@ echo XML_Util::apiVersion() . PHP_EOL;
TEST: basic apiVersion() call
1.1
-
+
XML_Util::attributesToString() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -97874,7 +95228,7 @@ TEST: replace only required XML entities
TEST: replace HTML entities
boo="b&gt;&lt;z" foo="b@&amp;r"
-
+
XML_Util::collapseEmptyTags() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -97926,7 +95280,7 @@ TEST: one empty tag, with COLLAPSE_XHTML_ONLY set
TEST: one empty tag alongside non-empty tag, with COLLAPSE_XHTML_ONLY set
<foo></foo><b></b><bar>baz</bar>
-
+
XML_Util::createCDataSection() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -97944,7 +95298,7 @@ echo XML_Util::createCDataSection("I am content.") . PHP_EOL;
TEST: basic usage
<![CDATA[I am content.]]>
-
+
XML_Util::createComment() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -97962,7 +95316,7 @@ echo XML_Util::createComment("I am comment.") . PHP_EOL;
TEST: basic usage
<!-- I am comment. -->
-
+
XML_Util::createEndElement() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -97986,7 +95340,7 @@ TEST: basic usage (myTag)
TEST: basic usage with a namespaced tag (myNs:myTag)
</myNs:myTag>
-
+
XML_Util::createStartElement() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98110,7 +95464,7 @@ TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only
TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), linebreak = '^', and sortAttributes = false
<myNs:myTag foo="bar"^ boo="baz"^ xmlns:myNs="http://www.w3c.org/myNs#">
-
+
XML_Util::createTag() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98265,7 +95619,7 @@ TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = tru
TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = false
<myNs:myTag foo="bar"^ boo="baz"^ xmlns:myNs="http://www.w3c.org/myNs#">This is inside the tag and has &lt; &amp; @ &gt; in it</myNs:myTag>
-
+
XML_Util::createTagFromArray() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98468,7 +95822,7 @@ TEST: qname is derived from localPart only
TEST: namespaceUri is given, but namespace is not
<foo xmlns="http://bar.org" />
-
+
XML_Util::getDocTypeDeclaration() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98512,7 +95866,7 @@ TEST: using root and an array URI and an internal DTD entry
<!DOCTYPE rootTag PUBLIC "-//PHP//PEAR/DTD PACKAGE 0.1" "http://pear.php.net/dtd/package-1.0" [
<!ELEMENT additionalInfo (#PCDATA)>
]>
-
+
XML_Util::getXmlDeclaration() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98548,7 +95902,7 @@ TEST: using version, encoding, and standalone flag
TEST: using version and standalone flag
<?xml version="1.0" standalone="yes"?>
-
+
XML_Util::isValidName() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98594,7 +95948,7 @@ Invalid XML name: XML names may only contain alphanumeric chars, period, hyphen,
TEST: invalid tag that doesn't start with a letter
Invalid XML name: XML names may only start with letter or underscore
-
+
XML_Util::raiseError() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98613,7 +95967,7 @@ if (is_a($error, 'PEAR_Error')) {
=====XML_Util::raiseError() basic tests=====
PEAR Error: I am an error
-
+
XML_Util::replaceEntities() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98695,7 +96049,7 @@ This string contains &lt; &amp; &gt;.
TEST: utf8 usage with ENTITIES_HTML and UTF-8
This data contains special chars like &lt;, &gt;, &amp; and &quot; as well as &auml;, &ouml;, &szlig;, &agrave; and &ecirc;
-
+
XML_Util::reverseEntities() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98776,7 +96130,7 @@ This string contains < & >.
TEST: utf8 usage with ENTITIES_HTML and UTF-8
This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê
-
+
XML_Util::splitQualifiedName() basic tests
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98808,7 +96162,7 @@ localPart => stylesheet
TEST: basic usage with namespace
namespace => myNs
localPart => stylesheet
-
+
XML_Util tests for Bug #4950 "Incorrect CDATA serializing"
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98829,7 +96183,7 @@ echo XML_Util::createTag("test", array(), "Content ]]></test> here!",
TEST: test case provided in bug report
<test><![CDATA[Content ]]]]><![CDATA[></test> here!]]></test>
-
+
XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding"
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98856,7 +96210,7 @@ echo $reversed . PHP_EOL;
TEST: test case provided in bug report
This data contains special chars like &lt;, &gt;, &amp; and &quot; as well as &auml;, &ouml;, &szlig;, &agrave; and &ecirc;
This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê
-
+
XML_Util tests for Bug #18343 Entities in file names decoded during packaging
--CREDITS--
Chuck Burgess <ashnazg@php.net>
@@ -98918,10 +96272,7 @@ Testing with ENTITIES_HTML:
Testing with REPLACE_ENTITIES:
<install as="Horde/Feed/fixtures/lexicon/http-p.moreover.com-cgi-local-page%2Fo=rss&amp;s=Newsweek" name="test/Horde/Feed/fixtures/lexicon/http-p.moreover.com-cgi-local-page%2Fo=rss&amp;s=Newsweek" />
-
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
+
/**
* XML_Util
*
@@ -98968,54 +96319,54 @@ Testing with REPLACE_ENTITIES:
*/
/**
- * error code for invalid chars in XML name
+ * Error code for invalid chars in XML name
*/
define('XML_UTIL_ERROR_INVALID_CHARS', 51);
/**
- * error code for invalid chars in XML name
+ * Error code for invalid chars in XML name
*/
define('XML_UTIL_ERROR_INVALID_START', 52);
/**
- * error code for non-scalar tag content
+ * Error code for non-scalar tag content
*/
define('XML_UTIL_ERROR_NON_SCALAR_CONTENT', 60);
/**
- * error code for missing tag name
+ * Error code for missing tag name
*/
define('XML_UTIL_ERROR_NO_TAG_NAME', 61);
/**
- * replace XML entities
+ * Replace XML entities
*/
define('XML_UTIL_REPLACE_ENTITIES', 1);
/**
- * embedd content in a CData Section
+ * Embedd content in a CData Section
*/
define('XML_UTIL_CDATA_SECTION', 5);
/**
- * do not replace entitites
+ * Do not replace entitites
*/
define('XML_UTIL_ENTITIES_NONE', 0);
/**
- * replace all XML entitites
+ * Replace all XML entitites
* This setting will replace <, >, ", ' and &
*/
define('XML_UTIL_ENTITIES_XML', 1);
/**
- * replace only required XML entitites
+ * Replace only required XML entitites
* This setting will replace <, " and &
*/
define('XML_UTIL_ENTITIES_XML_REQUIRED', 2);
/**
- * replace HTML entitites
+ * Replace HTML entitites
* @link http://www.php.net/htmlentities
*/
define('XML_UTIL_ENTITIES_HTML', 3);
@@ -99031,33 +96382,30 @@ define('XML_UTIL_COLLAPSE_ALL', 1);
define('XML_UTIL_COLLAPSE_XHTML_ONLY', 2);
/**
- * utility class for working with XML documents
+ * Utility class for working with XML documents
*
-
* @category XML
* @package XML_Util
* @author Stephan Schmidt <schst@php.net>
* @copyright 2003-2008 Stephan Schmidt <schst@php.net>
* @license http://opensource.org/licenses/bsd-license New BSD License
- * @version Release: 1.2.3
+ * @version Release: 1.3.0
* @link http://pear.php.net/package/XML_Util
*/
class XML_Util
{
/**
- * return API version
+ * Return API version
*
* @return string $version API version
- * @access public
- * @static
*/
- function apiVersion()
+ public static function apiVersion()
{
return '1.1';
}
/**
- * replace XML entities
+ * Replace XML entities
*
* With the optional second parameter, you may select, which
* entities should be replaced.
@@ -99092,27 +96440,33 @@ class XML_Util
* by the htmlentities() function
*
* @return string string with replaced chars
- * @access public
- * @static
- * @see reverseEntities()
+ * @see reverseEntities()
*/
- function replaceEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML,
- $encoding = 'ISO-8859-1')
- {
+ public static function replaceEntities(
+ $string, $replaceEntities = XML_UTIL_ENTITIES_XML, $encoding = 'ISO-8859-1'
+ ) {
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_XML:
- return strtr($string, array(
- '&' => '&amp;',
- '>' => '&gt;',
- '<' => '&lt;',
- '"' => '&quot;',
- '\'' => '&apos;' ));
+ return strtr(
+ $string,
+ array(
+ '&' => '&amp;',
+ '>' => '&gt;',
+ '<' => '&lt;',
+ '"' => '&quot;',
+ '\'' => '&apos;'
+ )
+ );
break;
case XML_UTIL_ENTITIES_XML_REQUIRED:
- return strtr($string, array(
- '&' => '&amp;',
- '<' => '&lt;',
- '"' => '&quot;' ));
+ return strtr(
+ $string,
+ array(
+ '&' => '&amp;',
+ '<' => '&lt;',
+ '"' => '&quot;'
+ )
+ );
break;
case XML_UTIL_ENTITIES_HTML:
return htmlentities($string, ENT_COMPAT, $encoding);
@@ -99122,7 +96476,7 @@ class XML_Util
}
/**
- * reverse XML entities
+ * Reverse XML entities
*
* With the optional second parameter, you may select, which
* entities should be reversed.
@@ -99158,27 +96512,33 @@ class XML_Util
* by the html_entity_decode() function
*
* @return string string with replaced chars
- * @access public
- * @static
- * @see replaceEntities()
+ * @see replaceEntities()
*/
- function reverseEntities($string, $replaceEntities = XML_UTIL_ENTITIES_XML,
- $encoding = 'ISO-8859-1')
- {
+ public static function reverseEntities(
+ $string, $replaceEntities = XML_UTIL_ENTITIES_XML, $encoding = 'ISO-8859-1'
+ ) {
switch ($replaceEntities) {
case XML_UTIL_ENTITIES_XML:
- return strtr($string, array(
- '&amp;' => '&',
- '&gt;' => '>',
- '&lt;' => '<',
- '&quot;' => '"',
- '&apos;' => '\'' ));
+ return strtr(
+ $string,
+ array(
+ '&amp;' => '&',
+ '&gt;' => '>',
+ '&lt;' => '<',
+ '&quot;' => '"',
+ '&apos;' => '\''
+ )
+ );
break;
case XML_UTIL_ENTITIES_XML_REQUIRED:
- return strtr($string, array(
- '&amp;' => '&',
- '&lt;' => '<',
- '&quot;' => '"' ));
+ return strtr(
+ $string,
+ array(
+ '&amp;' => '&',
+ '&lt;' => '<',
+ '&quot;' => '"'
+ )
+ );
break;
case XML_UTIL_ENTITIES_HTML:
return html_entity_decode($string, ENT_COMPAT, $encoding);
@@ -99188,7 +96548,7 @@ class XML_Util
}
/**
- * build an xml declaration
+ * Build an xml declaration
*
* <code>
* require_once 'XML/Util.php';
@@ -99202,13 +96562,12 @@ class XML_Util
* @param bool $standalone document is standalone (or not)
*
* @return string xml declaration
- * @access public
- * @static
- * @uses attributesToString() to serialize the attributes of the XML declaration
+ * @uses attributesToString() to serialize the attributes of the
+ * XML declaration
*/
- function getXMLDeclaration($version = '1.0', $encoding = null,
- $standalone = null)
- {
+ public static function getXMLDeclaration(
+ $version = '1.0', $encoding = null, $standalone = null
+ ) {
$attributes = array(
'version' => $version,
);
@@ -99221,12 +96580,14 @@ class XML_Util
$attributes['standalone'] = $standalone ? 'yes' : 'no';
}
- return sprintf('<?xml%s?>',
- XML_Util::attributesToString($attributes, false));
+ return sprintf(
+ '<?xml%s?>',
+ XML_Util::attributesToString($attributes, false)
+ );
}
/**
- * build a document type declaration
+ * Build a document type declaration
*
* <code>
* require_once 'XML/Util.php';
@@ -99241,12 +96602,11 @@ class XML_Util
* @param string $internalDtd internal dtd entries
*
* @return string doctype declaration
- * @access public
- * @static
- * @since 0.2
+ * @since 0.2
*/
- function getDocTypeDeclaration($root, $uri = null, $internalDtd = null)
- {
+ public static function getDocTypeDeclaration(
+ $root, $uri = null, $internalDtd = null
+ ) {
if (is_array($uri)) {
$ref = sprintf(' PUBLIC "%s" "%s"', $uri['id'], $uri['uri']);
} elseif (!empty($uri)) {
@@ -99263,7 +96623,7 @@ class XML_Util
}
/**
- * create string representation of an attribute list
+ * Create string representation of an attribute list
*
* <code>
* require_once 'XML/Util.php';
@@ -99295,14 +96655,13 @@ class XML_Util
* XML_UTIL_ENTITIES_HTML)
*
* @return string string representation of the attributes
- * @access public
- * @static
- * @uses replaceEntities() to replace XML entities in attribute values
- * @todo allow sort also to be an options array
+ * @uses replaceEntities() to replace XML entities in attribute values
+ * @todo allow sort also to be an options array
*/
- function attributesToString($attributes, $sort = true, $multiline = false,
- $indent = ' ', $linebreak = "\n", $entities = XML_UTIL_ENTITIES_XML)
- {
+ public static function attributesToString(
+ $attributes, $sort = true, $multiline = false,
+ $indent = ' ', $linebreak = "\n", $entities = XML_UTIL_ENTITIES_XML
+ ) {
/*
* second parameter may be an array
*/
@@ -99330,7 +96689,7 @@ class XML_Util
if ($sort) {
ksort($attributes);
}
- if ( !$multiline || count($attributes) == 1) {
+ if (!$multiline || count($attributes) == 1) {
foreach ($attributes as $key => $value) {
if ($entities != XML_UTIL_ENTITIES_NONE) {
if ($entities === XML_UTIL_CDATA_SECTION) {
@@ -99366,26 +96725,23 @@ class XML_Util
* or only XHTML (XML_UTIL_COLLAPSE_XHTML_ONLY) ones.
*
* @return string XML
- * @access public
- * @static
- * @todo PEAR CS - unable to avoid "space after open parens" error
- * in the IF branch
*/
- function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL)
+ public static function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL)
{
if ($mode == XML_UTIL_COLLAPSE_XHTML_ONLY) {
return preg_replace(
'/<(area|base(?:font)?|br|col|frame|hr|img|input|isindex|link|meta|'
. 'param)([^>]*)><\/\\1>/s',
'<\\1\\2 />',
- $xml);
+ $xml
+ );
} else {
return preg_replace('/<(\w+)([^>]*)><\/\\1>/s', '<\\1\\2 />', $xml);
}
}
/**
- * create a tag
+ * Create a tag
*
* This method will call XML_Util::createTagFromArray(), which
* is more flexible.
@@ -99416,16 +96772,15 @@ class XML_Util
* @param bool $sortAttributes Whether to sort the attributes or not
*
* @return string XML tag
- * @access public
- * @static
- * @see createTagFromArray()
- * @uses createTagFromArray() to create the tag
+ * @see createTagFromArray()
+ * @uses createTagFromArray() to create the tag
*/
- function createTag($qname, $attributes = array(), $content = null,
+ public static function createTag(
+ $qname, $attributes = array(), $content = null,
$namespaceUri = null, $replaceEntities = XML_UTIL_REPLACE_ENTITIES,
$multiline = false, $indent = '_auto', $linebreak = "\n",
- $sortAttributes = true)
- {
+ $sortAttributes = true
+ ) {
$tag = array(
'qname' => $qname,
'attributes' => $attributes
@@ -99441,13 +96796,15 @@ class XML_Util
$tag['namespaceUri'] = $namespaceUri;
}
- return XML_Util::createTagFromArray($tag, $replaceEntities, $multiline,
- $indent, $linebreak, $sortAttributes);
+ return XML_Util::createTagFromArray(
+ $tag, $replaceEntities, $multiline,
+ $indent, $linebreak, $sortAttributes
+ );
}
/**
- * create a tag from an array
- * this method awaits an array in the following format
+ * Create a tag from an array.
+ * This method awaits an array in the following format
* <pre>
* array(
* // qualified name of the tag
@@ -99496,27 +96853,31 @@ class XML_Util
* @param bool $sortAttributes Whether to sort the attributes or not
*
* @return string XML tag
- * @access public
- * @static
- * @see createTag()
+ *
+ * @see createTag()
* @uses attributesToString() to serialize the attributes of the tag
* @uses splitQualifiedName() to get local part and namespace of a qualified name
* @uses createCDataSection()
* @uses raiseError()
*/
- function createTagFromArray($tag, $replaceEntities = XML_UTIL_REPLACE_ENTITIES,
+ public static function createTagFromArray(
+ $tag, $replaceEntities = XML_UTIL_REPLACE_ENTITIES,
$multiline = false, $indent = '_auto', $linebreak = "\n",
- $sortAttributes = true)
- {
+ $sortAttributes = true
+ ) {
if (isset($tag['content']) && !is_scalar($tag['content'])) {
- return XML_Util::raiseError('Supplied non-scalar value as tag content',
- XML_UTIL_ERROR_NON_SCALAR_CONTENT);
+ return XML_Util::raiseError(
+ 'Supplied non-scalar value as tag content',
+ XML_UTIL_ERROR_NON_SCALAR_CONTENT
+ );
}
if (!isset($tag['qname']) && !isset($tag['localPart'])) {
- return XML_Util::raiseError('You must either supply a qualified name '
+ return XML_Util::raiseError(
+ 'You must either supply a qualified name '
. '(qname) or local tag name (localPart).',
- XML_UTIL_ERROR_NO_TAG_NAME);
+ XML_UTIL_ERROR_NO_TAG_NAME
+ );
}
// if no attributes hav been set, use empty attributes
@@ -99553,8 +96914,8 @@ class XML_Util
if (isset($tag['namespaceUri']) && !empty($tag['namespaceUri'])) {
// is a namespace given
if (isset($tag['namespace']) && !empty($tag['namespace'])) {
- $tag['attributes']['xmlns:' . $tag['namespace']] =
- $tag['namespaceUri'];
+ $tag['attributes']['xmlns:' . $tag['namespace']]
+ = $tag['namespaceUri'];
} else {
// define this Uri as the default namespace
$tag['attributes']['xmlns'] = $tag['namespaceUri'];
@@ -99569,8 +96930,10 @@ class XML_Util
}
// create attribute list
- $attList = XML_Util::attributesToString($tag['attributes'],
- $sortAttributes, $multiline, $indent, $linebreak);
+ $attList = XML_Util::attributesToString(
+ $tag['attributes'],
+ $sortAttributes, $multiline, $indent, $linebreak
+ );
if (!isset($tag['content']) || (string)$tag['content'] == '') {
$tag = sprintf('<%s%s />', $tag['qname'], $attList);
} else {
@@ -99581,18 +96944,21 @@ class XML_Util
$tag['content'] = XML_Util::createCDataSection($tag['content']);
break;
default:
- $tag['content'] = XML_Util::replaceEntities($tag['content'],
- $replaceEntities);
+ $tag['content'] = XML_Util::replaceEntities(
+ $tag['content'], $replaceEntities
+ );
break;
}
- $tag = sprintf('<%s%s>%s</%s>', $tag['qname'], $attList, $tag['content'],
- $tag['qname']);
+ $tag = sprintf(
+ '<%s%s>%s</%s>', $tag['qname'], $attList, $tag['content'],
+ $tag['qname']
+ );
}
return $tag;
}
/**
- * create a start element
+ * Create a start element
*
* <code>
* require_once 'XML/Util.php';
@@ -99613,14 +96979,13 @@ class XML_Util
* @param bool $sortAttributes Whether to sort the attributes or not
*
* @return string XML start element
- * @access public
- * @static
- * @see createEndElement(), createTag()
+ * @see createEndElement(), createTag()
*/
- function createStartElement($qname, $attributes = array(), $namespaceUri = null,
+ public static function createStartElement(
+ $qname, $attributes = array(), $namespaceUri = null,
$multiline = false, $indent = '_auto', $linebreak = "\n",
- $sortAttributes = true)
- {
+ $sortAttributes = true
+ ) {
// if no attributes hav been set, use empty attributes
if (!isset($attributes) || !is_array($attributes)) {
$attributes = array();
@@ -99648,14 +97013,16 @@ class XML_Util
}
// create attribute list
- $attList = XML_Util::attributesToString($attributes, $sortAttributes,
- $multiline, $indent, $linebreak);
+ $attList = XML_Util::attributesToString(
+ $attributes, $sortAttributes,
+ $multiline, $indent, $linebreak
+ );
$element = sprintf('<%s%s>', $qname, $attList);
return $element;
}
/**
- * create an end element
+ * Create an end element
*
* <code>
* require_once 'XML/Util.php';
@@ -99667,18 +97034,16 @@ class XML_Util
* @param string $qname qualified tagname (including namespace)
*
* @return string XML end element
- * @access public
- * @static
- * @see createStartElement(), createTag()
+ * @see createStartElement(), createTag()
*/
- function createEndElement($qname)
+ public static function createEndElement($qname)
{
$element = sprintf('</%s>', $qname);
return $element;
}
/**
- * create an XML comment
+ * Create an XML comment
*
* <code>
* require_once 'XML/Util.php';
@@ -99690,17 +97055,15 @@ class XML_Util
* @param string $content content of the comment
*
* @return string XML comment
- * @access public
- * @static
*/
- function createComment($content)
+ public static function createComment($content)
{
$comment = sprintf('<!-- %s -->', $content);
return $comment;
}
/**
- * create a CData section
+ * Create a CData section
*
* <code>
* require_once 'XML/Util.php';
@@ -99712,18 +97075,17 @@ class XML_Util
* @param string $data data of the CData section
*
* @return string CData section with content
- * @access public
- * @static
*/
- function createCDataSection($data)
+ public static function createCDataSection($data)
{
- return sprintf('<![CDATA[%s]]>',
- preg_replace('/\]\]>/', ']]]]><![CDATA[>', strval($data)));
-
+ return sprintf(
+ '<![CDATA[%s]]>',
+ preg_replace('/\]\]>/', ']]]]><![CDATA[>', strval($data))
+ );
}
/**
- * split qualified name and return namespace and local part
+ * Split qualified name and return namespace and local part
*
* <code>
* require_once 'XML/Util.php';
@@ -99743,10 +97105,8 @@ class XML_Util
* @param string $defaultNs default namespace (optional)
*
* @return array array containing namespace and local part
- * @access public
- * @static
*/
- function splitQualifiedName($qname, $defaultNs = null)
+ public static function splitQualifiedName($qname, $defaultNs = null)
{
if (strstr($qname, ':')) {
$tmp = explode(':', $qname);
@@ -99762,7 +97122,7 @@ class XML_Util
}
/**
- * check, whether string is valid XML name
+ * Check, whether string is valid XML name
*
* <p>XML names are used for tagname, attribute names and various
* other, lesser known entities.</p>
@@ -99783,33 +97143,39 @@ class XML_Util
* @param string $string string that should be checked
*
* @return mixed true, if string is a valid XML name, PEAR error otherwise
- * @access public
- * @static
+ *
* @todo support for other charsets
* @todo PEAR CS - unable to avoid 85-char limit on second preg_match
*/
- function isValidName($string)
+ public static function isValidName($string)
{
// check for invalid chars
if (!preg_match('/^[[:alpha:]_]\\z/', $string{0})) {
- return XML_Util::raiseError('XML names may only start with letter '
- . 'or underscore', XML_UTIL_ERROR_INVALID_START);
+ return XML_Util::raiseError(
+ 'XML names may only start with letter or underscore',
+ XML_UTIL_ERROR_INVALID_START
+ );
}
// check for invalid chars
- if (!preg_match('/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?[[:alpha:]_]([[:alnum:]\_\-\.]+)?\\z/',
- $string)
- ) {
- return XML_Util::raiseError('XML names may only contain alphanumeric '
+ $match = preg_match(
+ '/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?'
+ . '[[:alpha:]_]([[:alnum:]\_\-\.]+)?\\z/',
+ $string
+ );
+ if (!$match) {
+ return XML_Util::raiseError(
+ 'XML names may only contain alphanumeric '
. 'chars, period, hyphen, colon and underscores',
- XML_UTIL_ERROR_INVALID_CHARS);
+ XML_UTIL_ERROR_INVALID_CHARS
+ );
}
// XML name is valid
return true;
}
/**
- * replacement for XML_Util::raiseError
+ * Replacement for XML_Util::raiseError
*
* Avoids the necessity to always require
* PEAR.php
@@ -99818,15 +97184,13 @@ class XML_Util
* @param int $code error code
*
* @return PEAR_Error
- * @access public
- * @static
- * @todo PEAR CS - should this use include_once instead?
+ * @todo PEAR CS - should this use include_once instead?
*/
- function raiseError($msg, $code)
+ public static function raiseError($msg, $code)
{
- require_once 'PEAR.php';
+ include_once 'PEAR.php';
return PEAR::raiseError($msg, $code);
}
}
?>
-
+