Update to PEAR 1.7.2, Image_Canvas 0.3.1, Image_Color 1.0.3, Image_Graph 0.7.2, XML_Parser 1.3.1.
Removed PHP_Compat, and references to it. Removed ionCube/Zend/mmCache compatibility checks in test.php script. Changed minimum PHP requirement to 5.0 in test.php script.
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2005 The PHP Group
|
||||
* @copyright 1997-2008 The PHP Group
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @version CVS: $Id: v2.php,v 1.120 2005/11/14 14:06:17 cellog Exp $
|
||||
* @version CVS: $Id: v2.php,v 1.143 2008/05/13 05:28:51 cellog Exp $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
@@ -27,9 +27,9 @@ require_once 'PEAR/ErrorStack.php';
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2005 The PHP Group
|
||||
* @copyright 1997-2008 The PHP Group
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @version Release: 1.4.5
|
||||
* @version Release: 1.7.2
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
@@ -121,12 +121,17 @@ class PEAR_PackageFile_v2
|
||||
*
|
||||
* - package name
|
||||
* - channel name
|
||||
* - dependencies
|
||||
* - dependencies
|
||||
* @var boolean
|
||||
* @access private
|
||||
*/
|
||||
var $_incomplete = true;
|
||||
|
||||
/**
|
||||
* @var PEAR_PackageFile_v2_Validator
|
||||
*/
|
||||
var $_v2Validator;
|
||||
|
||||
/**
|
||||
* The constructor merely sets up the private error stack
|
||||
*/
|
||||
@@ -186,23 +191,24 @@ class PEAR_PackageFile_v2
|
||||
$a = false;
|
||||
return $a;
|
||||
}
|
||||
if ($this->getPackageType() == 'extsrc') {
|
||||
if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') {
|
||||
$releasetype = $this->getPackageType() . 'release';
|
||||
if (!is_array($installer->getInstallPackages())) {
|
||||
$a = false;
|
||||
return $a;
|
||||
}
|
||||
foreach ($installer->getInstallPackages() as $p) {
|
||||
if ($p->isExtension($this->_packageInfo['providesextension'])) {
|
||||
if ($p->getPackageType() != 'extsrc') {
|
||||
if ($p->getPackageType() != 'extsrc' && $p->getPackageType() != 'zendextsrc') {
|
||||
$a = false;
|
||||
return $a; // the user probably downloaded it separately
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($this->_packageInfo['extsrcrelease']['binarypackage'])) {
|
||||
if (isset($this->_packageInfo[$releasetype]['binarypackage'])) {
|
||||
$installer->log(0, 'Attempting to download binary version of extension "' .
|
||||
$this->_packageInfo['providesextension'] . '"');
|
||||
$params = $this->_packageInfo['extsrcrelease']['binarypackage'];
|
||||
$params = $this->_packageInfo[$releasetype]['binarypackage'];
|
||||
if (!is_array($params) || !isset($params[0])) {
|
||||
$params = array($params);
|
||||
}
|
||||
@@ -259,7 +265,8 @@ class PEAR_PackageFile_v2
|
||||
*/
|
||||
function getProvidesExtension()
|
||||
{
|
||||
if (in_array($this->getPackageType(), array('extsrc', 'extbin'))) {
|
||||
if (in_array($this->getPackageType(),
|
||||
array('extsrc', 'extbin', 'zendextsrc', 'zendextbin'))) {
|
||||
if (isset($this->_packageInfo['providesextension'])) {
|
||||
return $this->_packageInfo['providesextension'];
|
||||
}
|
||||
@@ -273,7 +280,8 @@ class PEAR_PackageFile_v2
|
||||
*/
|
||||
function isExtension($extension)
|
||||
{
|
||||
if (in_array($this->getPackageType(), array('extsrc', 'extbin'))) {
|
||||
if (in_array($this->getPackageType(),
|
||||
array('extsrc', 'extbin', 'zendextsrc', 'zendextbin'))) {
|
||||
return $this->_packageInfo['providesextension'] == $extension;
|
||||
}
|
||||
return false;
|
||||
@@ -465,6 +473,9 @@ class PEAR_PackageFile_v2
|
||||
*/
|
||||
function setRawState($state)
|
||||
{
|
||||
if (!isset($this->_packageInfo['stability'])) {
|
||||
$this->_packageInfo['stability'] = array();
|
||||
}
|
||||
$this->_packageInfo['stability']['release'] = $state;
|
||||
}
|
||||
|
||||
@@ -598,6 +609,10 @@ class PEAR_PackageFile_v2
|
||||
$common->debug = $this->_config->get('verbose');
|
||||
$this->_scripts = array();
|
||||
foreach ($taskfiles as $name => $tasks) {
|
||||
if (!isset($filelist[$name])) {
|
||||
// file was not installed due to installconditions
|
||||
continue;
|
||||
}
|
||||
$atts = $filelist[$name];
|
||||
foreach ($tasks as $tag => $raw) {
|
||||
$taskname = $this->getTask($tag);
|
||||
@@ -658,12 +673,17 @@ class PEAR_PackageFile_v2
|
||||
if (isset($this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'])) {
|
||||
if (isset($this->_packageInfo['contents']['dir']['file'][0])) {
|
||||
foreach ($this->_packageInfo['contents']['dir']['file'] as $i => $file) {
|
||||
if (isset($file['attribs']['baseinstalldir'])) {
|
||||
continue;
|
||||
}
|
||||
$this->_packageInfo['contents']['dir']['file'][$i]['attribs']['baseinstalldir']
|
||||
= $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'];
|
||||
}
|
||||
} else {
|
||||
$this->_packageInfo['contents']['dir']['file']['attribs']['baseinstalldir']
|
||||
= $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'];
|
||||
if (!isset($this->_packageInfo['contents']['dir']['file']['attribs']['baseinstalldir'])) {
|
||||
$this->_packageInfo['contents']['dir']['file']['attribs']['baseinstalldir']
|
||||
= $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -705,7 +725,7 @@ class PEAR_PackageFile_v2
|
||||
foreach ($dir['file'] as $file) {
|
||||
$attrs = $file['attribs'];
|
||||
$name = $attrs['name'];
|
||||
if ($baseinstall) {
|
||||
if ($baseinstall && !isset($attrs['baseinstalldir'])) {
|
||||
$attrs['baseinstalldir'] = $baseinstall;
|
||||
}
|
||||
$attrs['name'] = empty($path) ? $name : $path . '/' . $name;
|
||||
@@ -725,7 +745,7 @@ class PEAR_PackageFile_v2
|
||||
|
||||
function setLogger(&$logger)
|
||||
{
|
||||
if ($logger && (!is_object($logger) || !method_exists($logger, 'log'))) {
|
||||
if (!is_object($logger) || !method_exists($logger, 'log')) {
|
||||
return PEAR::raiseError('Logger must be compatible with PEAR_Common::log');
|
||||
}
|
||||
$this->_logger = &$logger;
|
||||
@@ -739,6 +759,14 @@ class PEAR_PackageFile_v2
|
||||
$this->_packageInfo['dependencies'] = $deps;
|
||||
}
|
||||
|
||||
/**
|
||||
* WARNING - do not use this function directly unless you know what you're doing
|
||||
*/
|
||||
function setCompatible($compat)
|
||||
{
|
||||
$this->_packageInfo['compatible'] = $compat;
|
||||
}
|
||||
|
||||
function setPackagefile($file, $archive = false)
|
||||
{
|
||||
$this->_packageFile = $file;
|
||||
@@ -909,7 +937,7 @@ class PEAR_PackageFile_v2
|
||||
|
||||
function getMaintainers($raw = false)
|
||||
{
|
||||
if (!$this->_isValid && !$this->validate()) {
|
||||
if (!isset($this->_packageInfo['lead'])) {
|
||||
return false;
|
||||
}
|
||||
if ($raw) {
|
||||
@@ -1013,8 +1041,8 @@ class PEAR_PackageFile_v2
|
||||
array('time', 'version',
|
||||
'stability', 'license', 'notes', 'contents', 'compatible',
|
||||
'dependencies', 'providesextension', 'srcpackage', 'srcuri',
|
||||
'phprelease', 'extsrcrelease',
|
||||
'extbinrelease', 'bundle', 'changelog'), array(), 'date');
|
||||
'phprelease', 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease',
|
||||
'zendextbinrelease', 'bundle', 'changelog'), array(), 'date');
|
||||
}
|
||||
$this->_packageInfo['date'] = $date;
|
||||
$this->_isValid = 0;
|
||||
@@ -1029,8 +1057,8 @@ class PEAR_PackageFile_v2
|
||||
array('version',
|
||||
'stability', 'license', 'notes', 'contents', 'compatible',
|
||||
'dependencies', 'providesextension', 'srcpackage', 'srcuri',
|
||||
'phprelease', 'extsrcrelease',
|
||||
'extbinrelease', 'bundle', 'changelog'), $time, 'time');
|
||||
'phprelease', 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease',
|
||||
'zendextbinrelease', 'bundle', 'changelog'), $time, 'time');
|
||||
}
|
||||
$this->_packageInfo['time'] = $time;
|
||||
}
|
||||
@@ -1144,6 +1172,9 @@ class PEAR_PackageFile_v2
|
||||
$this->flattenFilelist();
|
||||
if ($contents = $this->getContents()) {
|
||||
$ret = array();
|
||||
if (!isset($contents['dir'])) {
|
||||
return false;
|
||||
}
|
||||
if (!isset($contents['dir']['file'][0])) {
|
||||
$contents['dir']['file'] = array($contents['dir']['file']);
|
||||
}
|
||||
@@ -1169,12 +1200,12 @@ class PEAR_PackageFile_v2
|
||||
*/
|
||||
function getConfigureOptions()
|
||||
{
|
||||
if ($this->getPackageType() != 'extsrc') {
|
||||
if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
|
||||
return false;
|
||||
}
|
||||
$releases = $this->getReleases();
|
||||
if (isset($releases[0])) {
|
||||
$releases = $release[0];
|
||||
$releases = $releases[0];
|
||||
}
|
||||
if (isset($releases['configureoption'])) {
|
||||
if (!isset($releases['configureoption'][0])) {
|
||||
@@ -1378,6 +1409,9 @@ class PEAR_PackageFile_v2
|
||||
|
||||
function setDirtree($path)
|
||||
{
|
||||
if (!isset($this->_packageInfo['dirtree'])) {
|
||||
$this->_packageInfo['dirtree'] = array();
|
||||
}
|
||||
$this->_packageInfo['dirtree'][$path] = true;
|
||||
}
|
||||
|
||||
@@ -1535,7 +1569,7 @@ class PEAR_PackageFile_v2
|
||||
if (strtolower($dep['name']) == strtolower($package) &&
|
||||
$depchannel == $channel) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1553,7 +1587,7 @@ class PEAR_PackageFile_v2
|
||||
if (strtolower($dep['name']) == strtolower($package) &&
|
||||
$depchannel == $channel) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1613,7 +1647,8 @@ class PEAR_PackageFile_v2
|
||||
);
|
||||
foreach (array('required', 'optional') as $type) {
|
||||
$optional = ($type == 'optional') ? 'yes' : 'no';
|
||||
if (!isset($this->_packageInfo['dependencies'][$type])) {
|
||||
if (!isset($this->_packageInfo['dependencies'][$type])
|
||||
|| empty($this->_packageInfo['dependencies'][$type])) {
|
||||
continue;
|
||||
}
|
||||
foreach ($this->_packageInfo['dependencies'][$type] as $dtype => $deps) {
|
||||
@@ -1648,6 +1683,7 @@ class PEAR_PackageFile_v2
|
||||
if (!isset($dep['min']) &&
|
||||
!isset($dep['max'])) {
|
||||
$s['rel'] = 'has';
|
||||
$s['optional'] = $optional;
|
||||
} elseif (isset($dep['min']) &&
|
||||
isset($dep['max'])) {
|
||||
$s['rel'] = 'ge';
|
||||
@@ -1666,14 +1702,24 @@ class PEAR_PackageFile_v2
|
||||
$s1['optional'] = $optional;
|
||||
$ret[] = $s1;
|
||||
} elseif (isset($dep['min'])) {
|
||||
$s['rel'] = 'ge';
|
||||
if (isset($dep['exclude']) &&
|
||||
$dep['exclude'] == $dep['min']) {
|
||||
$s['rel'] = 'gt';
|
||||
} else {
|
||||
$s['rel'] = 'ge';
|
||||
}
|
||||
$s['version'] = $dep['min'];
|
||||
$s['optional'] = $optional;
|
||||
if ($dtype != 'php') {
|
||||
$s['name'] = $dep['name'];
|
||||
}
|
||||
} elseif (isset($dep['max'])) {
|
||||
$s['rel'] = 'le';
|
||||
if (isset($dep['exclude']) &&
|
||||
$dep['exclude'] == $dep['max']) {
|
||||
$s['rel'] = 'lt';
|
||||
} else {
|
||||
$s['rel'] = 'le';
|
||||
}
|
||||
$s['version'] = $dep['max'];
|
||||
$s['optional'] = $optional;
|
||||
if ($dtype != 'php') {
|
||||
@@ -1693,7 +1739,7 @@ class PEAR_PackageFile_v2
|
||||
}
|
||||
|
||||
/**
|
||||
* @return php|extsrc|extbin|bundle|false
|
||||
* @return php|extsrc|extbin|zendextsrc|zendextbin|bundle|false
|
||||
*/
|
||||
function getPackageType()
|
||||
{
|
||||
@@ -1706,6 +1752,12 @@ class PEAR_PackageFile_v2
|
||||
if (isset($this->_packageInfo['extbinrelease'])) {
|
||||
return 'extbin';
|
||||
}
|
||||
if (isset($this->_packageInfo['zendextsrcrelease'])) {
|
||||
return 'zendextsrc';
|
||||
}
|
||||
if (isset($this->_packageInfo['zendextbinrelease'])) {
|
||||
return 'zendextbin';
|
||||
}
|
||||
if (isset($this->_packageInfo['bundle'])) {
|
||||
return 'bundle';
|
||||
}
|
||||
@@ -1745,6 +1797,12 @@ class PEAR_PackageFile_v2
|
||||
|
||||
function getPackagexmlVersion()
|
||||
{
|
||||
if (isset($this->_packageInfo['zendextsrcrelease'])) {
|
||||
return '2.1';
|
||||
}
|
||||
if (isset($this->_packageInfo['zendextbinrelease'])) {
|
||||
return '2.1';
|
||||
}
|
||||
return '2.0';
|
||||
}
|
||||
|
||||
@@ -1753,7 +1811,8 @@ class PEAR_PackageFile_v2
|
||||
*/
|
||||
function getSourcePackage()
|
||||
{
|
||||
if (isset($this->_packageInfo['extbinrelease'])) {
|
||||
if (isset($this->_packageInfo['extbinrelease']) ||
|
||||
isset($this->_packageInfo['zendextbinrelease'])) {
|
||||
return array('channel' => $this->_packageInfo['srcchannel'],
|
||||
'package' => $this->_packageInfo['srcpackage']);
|
||||
}
|
||||
@@ -1837,7 +1896,8 @@ class PEAR_PackageFile_v2
|
||||
|
||||
function analyzeSourceCode($file, $string = false)
|
||||
{
|
||||
if (!isset($this->_v2Validator)) {
|
||||
if (!isset($this->_v2Validator) ||
|
||||
!is_a($this->_v2Validator, 'PEAR_PackageFile_v2_Validator')) {
|
||||
if (!class_exists('PEAR_PackageFile_v2_Validator')) {
|
||||
require_once 'PEAR/PackageFile/v2/Validator.php';
|
||||
}
|
||||
@@ -1851,7 +1911,8 @@ class PEAR_PackageFile_v2
|
||||
if (!isset($this->_packageInfo) || !is_array($this->_packageInfo)) {
|
||||
return false;
|
||||
}
|
||||
if (!isset($this->_v2Validator)) {
|
||||
if (!isset($this->_v2Validator) ||
|
||||
!is_a($this->_v2Validator, 'PEAR_PackageFile_v2_Validator')) {
|
||||
if (!class_exists('PEAR_PackageFile_v2_Validator')) {
|
||||
require_once 'PEAR/PackageFile/v2/Validator.php';
|
||||
}
|
||||
@@ -1893,16 +1954,16 @@ class PEAR_PackageFile_v2
|
||||
$this->getTasksNs();
|
||||
// transform all '-' to '/' and 'tasks:' to '' so tasks:replace becomes replace
|
||||
$task = str_replace(array($this->_tasksNs . ':', '-'), array('', ' '), $task);
|
||||
$task = str_replace(' ', '/', ucwords($task));
|
||||
$ps = (strtolower(substr(PHP_OS, 0, 3)) == 'win') ? ';' : ':';
|
||||
foreach (explode($ps, ini_get('include_path')) as $path) {
|
||||
if (file_exists($path . "/PEAR/Task/$task.php")) {
|
||||
include_once "PEAR/Task/$task.php";
|
||||
$task = str_replace('/', '_', $task);
|
||||
if (class_exists("PEAR_Task_$task")) {
|
||||
return "PEAR_Task_$task";
|
||||
}
|
||||
}
|
||||
$taskfile = str_replace(' ', '/', ucwords($task));
|
||||
$task = str_replace(array(' ', '/'), '_', ucwords($task));
|
||||
if (class_exists("PEAR_Task_$task")) {
|
||||
return "PEAR_Task_$task";
|
||||
}
|
||||
$fp = @fopen("PEAR/Task/$taskfile.php", 'r', true);
|
||||
if ($fp) {
|
||||
fclose($fp);
|
||||
require_once "PEAR/Task/$taskfile.php";
|
||||
return "PEAR_Task_$task";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user