本文整理匯總了PHP中PEAR_PackageFile::getValidationWarnings方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_PackageFile::getValidationWarnings方法的具體用法?PHP PEAR_PackageFile::getValidationWarnings怎麽用?PHP PEAR_PackageFile::getValidationWarnings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PEAR_PackageFile
的用法示例。
在下文中一共展示了PEAR_PackageFile::getValidationWarnings方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: realpath
function _parsePackageXml(&$descfile, &$tmpdir)
{
if (substr($descfile, -4) == '.xml') {
$tmpdir = false;
} else {
// {{{ Decompress pack in tmp dir -------------------------------------
// To allow relative package file names
$descfile = realpath($descfile);
if (PEAR::isError($tmpdir = System::mktemp('-d'))) {
return $tmpdir;
}
$this->log(3, '+ tmp dir created at ' . $tmpdir);
// }}}
}
// Parse xml file -----------------------------------------------
$pkg = new PEAR_PackageFile($this->config, $this->debug, $tmpdir);
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
$p =& $pkg->fromAnyFile($descfile, PEAR_VALIDATE_INSTALLING);
PEAR::staticPopErrorHandling();
if (PEAR::isError($p)) {
foreach ($pkg->getValidationWarnings(true) as $err) {
$loglevel = $err['level'] == 'error' ? 0 : 1;
if (!isset($this->_options['soft'])) {
$this->log($loglevel, ucfirst($err['level']) . ': ' . $err['message']);
}
}
return $this->raiseError('Installation failed: invalid package file');
} else {
$descfile = $p->getPackageFile();
}
return $p;
}