本文整理汇总了PHP中PEAR_Common::setPackageFileManager方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Common::setPackageFileManager方法的具体用法?PHP PEAR_Common::setPackageFileManager怎么用?PHP PEAR_Common::setPackageFileManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEAR_Common
的用法示例。
在下文中一共展示了PEAR_Common::setPackageFileManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writePackageFile
/**
* Writes the package.xml file out with the newly created <release></release> tag
*
* ALWAYS use {@link debugPackageFile} to verify that output is correct before
* overwriting your package.xml
*
* @param boolean $debuginterface (optional) null if no debugging, true if web interface, false if command-line
*
* @throws PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS
* @throws PEAR_PACKAGEFILEMANAGER_ADD_MAINTAINERS
* @throws PEAR_PACKAGEFILEMANAGER_NONOTES
* @throws PEAR_PACKAGEFILEMANAGER_NOLICENSE
* @throws PEAR_PACKAGEFILEMANAGER_INVALID_PACKAGE
* @throws PEAR_PACKAGEFILEMANAGER_CANTWRITE_PKGFILE
* @throws PEAR_PACKAGEFILEMANAGER_CANTCOPY_PKGFILE
* @throws PEAR_PACKAGEFILEMANAGER_CANTOPEN_TMPPKGFILE
* @throws PEAR_PACKAGEFILEMANAGER_DEST_UNWRITABLE
* @return true|PEAR_Error
* @access public
* @since 0.1
*/
function writePackageFile($debuginterface = null)
{
if (!$this->_packageXml) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS);
}
if (!isset($this->_packageXml['maintainers']) || empty($this->_packageXml['maintainers'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_ADD_MAINTAINERS);
}
if (!isset($this->_options['notes']) || empty($this->_options['notes'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NONOTES);
}
if (!isset($this->_options['license']) || empty($this->_options['license'])) {
return $this->raiseError(PEAR_PACKAGEFILEMANAGER_NOLICENSE);
}
extract($this->_options);
$date = date('Y-m-d');
if (isset($package)) {
$this->_packageXml['package'] = $package;
}
if (isset($summary)) {
$this->_packageXml['summary'] = $summary;
}
if (isset($description)) {
$this->_packageXml['description'] = $description;
}
$this->_packageXml['release_date'] = $date;
$this->_packageXml['version'] = $version;
$this->_packageXml['release_license'] = $license;
$this->_packageXml['release_state'] = $state;
$this->_packageXml['release_notes'] = $notes;
$PEAR_Common = $this->_options['pearcommonclass'];
$this->_pear = new $PEAR_Common();
if (method_exists($this->_pear, 'setPackageFileManager')) {
$this->_pear->setPackageFileManager($this);
}
$this->_packageXml['filelist'] = $this->_getFileList();
$warnings = $this->getWarnings();
if (count($warnings)) {
$nl = isset($debuginterface) && $debuginterface ? '<br />' : "\n";
foreach ($warnings as $errmsg) {
echo 'WARNING: ' . $errmsg['message'] . $nl;
}
}
if (PEAR::isError($this->_packageXml['filelist'])) {
return $this->_packageXml['filelist'];
}
if (isset($this->_pear->pkginfo['provides'])) {
$this->_packageXml['provides'] = $this->_pear->pkginfo['provides'];
}
if ($this->_options['simpleoutput']) {
unset($this->_packageXml['provides']);
}
$this->_packageXml['release_deps'] = $this->_getDependencies();
$this->_updateChangeLog();
$common =& $this->_pear;
$warnings = $errors = array();
if (method_exists($common, 'setPackageFileManagerOptions')) {
$common->setPackageFileManagerOptions($this->_options);
}
$packagexml = $common->xmlFromInfo($this->_packageXml);
if (PEAR::isError($packagexml)) {
$errs = $packagexml->getUserinfo();
if (is_array($errs)) {
foreach ($errs as $error) {
if ($error['level'] == 'error') {
$errors[] = $error['message'];
} else {
$warnings[] = $error['message'];
}
}
}
} else {
$common->validatePackageInfo($packagexml, $warnings, $errors, $this->_options['packagedirectory']);
}
if (count($errors)) {
$ret = '';
$nl = isset($debuginterface) && $debuginterface ? '<br />' : "\n";
foreach ($errors as $errmsg) {
$ret .= $errmsg . $nl;
//.........这里部分代码省略.........