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


PHP PEAR_Registry::deletePackage方法代碼示例

本文整理匯總了PHP中PEAR_Registry::deletePackage方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_Registry::deletePackage方法的具體用法?PHP PEAR_Registry::deletePackage怎麽用?PHP PEAR_Registry::deletePackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PEAR_Registry的用法示例。


在下文中一共展示了PEAR_Registry::deletePackage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: install


//.........這裏部分代碼省略.........
         }
     }
     // }}}
     $this->startFileTransaction();
     $usechannel = $channel;
     if ($channel == 'pecl.php.net') {
         $test = $installregistry->packageExists($pkgname, $channel);
         if (!$test) {
             $test = $installregistry->packageExists($pkgname, 'pear.php.net');
             $usechannel = 'pear.php.net';
         }
     } else {
         $test = $installregistry->packageExists($pkgname, $channel);
     }
     if (empty($options['upgrade']) && empty($options['soft'])) {
         // checks to do only when installing new packages
         if (empty($options['force']) && $test) {
             return $this->raiseError("{$channel}/{$pkgname} is already installed");
         }
     } else {
         // Upgrade
         if ($test) {
             $v1 = $installregistry->packageInfo($pkgname, 'version', $usechannel);
             $v2 = $pkg->getVersion();
             $cmp = version_compare("{$v1}", "{$v2}", 'gt');
             if (empty($options['force']) && !version_compare("{$v2}", "{$v1}", 'gt')) {
                 return $this->raiseError("upgrade to a newer version ({$v2} is not newer than {$v1})");
             }
         }
     }
     // Do cleanups for upgrade and install, remove old release's files first
     if ($test && empty($options['register-only'])) {
         // when upgrading, remove old release's files first:
         if (PEAR::isError($err = $this->_deletePackageFiles($pkgname, $usechannel, true))) {
             if (!isset($options['ignore-errors'])) {
                 return $this->raiseError($err);
             }
             if (!isset($options['soft'])) {
                 $this->log(0, 'WARNING: ' . $err->getMessage());
             }
         } else {
             $backedup = $err;
         }
     }
     // {{{ Copy files to dest dir ---------------------------------------
     // info from the package it self we want to access from _installFile
     $this->pkginfo =& $pkg;
     // used to determine whether we should build any C code
     $this->source_files = 0;
     $savechannel = $this->config->get('default_channel');
     if (empty($options['register-only']) && !is_dir($php_dir)) {
         if (PEAR::isError(System::mkdir(array('-p'), $php_dir))) {
             return $this->raiseError("no installation destination directory '{$php_dir}'\n");
         }
     }
     if (substr($pkgfile, -4) != '.xml') {
         $tmpdir .= DIRECTORY_SEPARATOR . $pkgname . '-' . $pkg->getVersion();
     }
     $this->configSet('default_channel', $channel);
     // {{{ install files
     $ver = $pkg->getPackagexmlVersion();
     if (version_compare($ver, '2.0', '>=')) {
         $filelist = $pkg->getInstallationFilelist();
     } else {
         $filelist = $pkg->getFileList();
     }
開發者ID:orcoliver,項目名稱:oneye,代碼行數:67,代碼來源:Installer.php


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