當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PEAR_Common::setPackageFileManager方法代碼示例

本文整理匯總了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;
//.........這裏部分代碼省略.........
開發者ID:Esleelkartea,項目名稱:kz-adeada-talleres-electricos-,代碼行數:101,代碼來源:PackageFileManager.php


注:本文中的PEAR_Common::setPackageFileManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。