本文整理汇总了PHP中PEAR_PackageFile::getPackagexmlVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_PackageFile::getPackagexmlVersion方法的具体用法?PHP PEAR_PackageFile::getPackagexmlVersion怎么用?PHP PEAR_PackageFile::getPackagexmlVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_PackageFile
的用法示例。
在下文中一共展示了PEAR_PackageFile::getPackagexmlVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validatePackageName
/**
* @access protected
*/
function validatePackageName()
{
if ($this->_state == PEAR_VALIDATE_PACKAGING || $this->_state == PEAR_VALIDATE_NORMAL) {
if ($this->_packagexml->getPackagexmlVersion() == '2.0' && $this->_packagexml->getExtends()) {
$version = $this->_packagexml->getVersion() . '';
$name = $this->_packagexml->getPackage();
$test = array_shift(explode('.', $version));
if ($test == '0') {
return true;
}
$vlen = strlen($test);
$majver = substr($name, strlen($name) - $vlen);
while ($majver && !is_numeric($majver[0])) {
$majver = substr($majver, 1);
}
if ($majver != $test) {
$this->_addWarning('package', "package {$name} extends package " . $this->_packagexml->getExtends() . ' and so the name should ' . 'have a postfix equal to the major version like "' . $this->_packagexml->getExtends() . $test . '"');
return true;
} elseif (substr($name, 0, strlen($name) - $vlen) != $this->_packagexml->getExtends()) {
$this->_addWarning('package', "package {$name} extends package " . $this->_packagexml->getExtends() . ' and so the name must ' . 'be an extension like "' . $this->_packagexml->getExtends() . $test . '"');
return true;
}
}
}
if (!$this->validPackageName($this->_packagexml->getPackage())) {
$this->_addFailure('name', 'package name ' . $this->_packagexml->getPackage() . ' is invalid');
return false;
}
}
示例2: getDeps
function getDeps()
{
if (isset($this->_packagefile)) {
$ver = $this->_packagefile->getPackagexmlVersion();
if (version_compare($ver, '2.0', '>=')) {
return $this->_packagefile->getDeps(true);
}
return $this->_packagefile->getDeps();
} elseif (isset($this->_downloadURL['info'])) {
$ver = $this->_downloadURL['info']->getPackagexmlVersion();
if (version_compare($ver, '2.0', '>=')) {
return $this->_downloadURL['info']->getDeps(true);
}
return $this->_downloadURL['info']->getDeps();
}
return array();
}
示例3: getDeps
function getDeps()
{
if (isset($this->_packagefile)) {
if ($this->_packagefile->getPackagexmlVersion() == '2.0') {
return $this->_packagefile->getDeps(true);
} else {
return $this->_packagefile->getDeps();
}
} elseif (isset($this->_downloadURL['info'])) {
if ($this->_downloadURL['info']->getPackagexmlVersion() == '2.0') {
return $this->_downloadURL['info']->getDeps(true);
} else {
return $this->_downloadURL['info']->getDeps();
}
} else {
return array();
}
}