本文整理汇总了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();
}