本文整理汇总了PHP中PackageManager::parseNRV方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::parseNRV方法的具体用法?PHP PackageManager::parseNRV怎么用?PHP PackageManager::parseNRV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageManager
的用法示例。
在下文中一共展示了PackageManager::parseNRV方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculate
/**
*
*/
static function calculate($package)
{
$deps = new Deps();
if ($package instanceof Package) {
$di = new DepsItem($package);
} else {
$nvr = PackageManager::parseNRV($package);
$di = new DepsItem($nvr['name']);
$di->merge($nvr['version'], $nvr['rel']);
if (count($di->getFiltered()) == 0) {
return false;
}
}
//if ( count($di->getFiltered()) == 1 &&
// Лучший из доступных пакетов установлен?
if (PackageManager::getInstalledPackage($di->getPackageName(), $di->getFiltered(true)->version)) {
return $di->getFiltered(true);
}
$deps->queue = array(&$di);
while (!is_null($fpi = $di->popNext()) && !$deps->push($fpi)) {
$deps->queue = array(&$di);
}
// restore queue
if (is_null($fpi)) {
return false;
}
$di->pushBack($fpi);
return $deps->getPackagesToDeploy();
}
示例2: uninstall
/**
* Удаление пакета
*/
static function uninstall($package)
{
$nvr = PackageManager::parseNRV($package);
// проверка обратных зависимостей
$res = Deps::isNoNeeded($nvr, $unstatisfied);
if (count($res) == 0) {
return IO::out('Packages to uninstall not found', IO::MESSAGE_FAIL);
}
if ($res === false) {
io::out('Unable uninstall package ~WHITE~' . $nvr['name'] . '~~~ because', IO::MESSAGE_FAIL);
foreach ($unstatisfied as $p => $d) {
io::out('Package ' . $p . ' require ' . implode(', ', array_keys($d)));
}
return false;
}
io::out('Packages to be removed: ', false);
foreach ($res as $p) {
io::out($p->name . '(' . $p->version . ') ', false);
}
io::out();
if (IO::NO == io::dialog('Continue?', IO::YES | IO::NO, IO::NO)) {
return 1;
}
foreach ($res as $p) {
io::out('~WHITE~Undeploying ' . $p->name . '(' . $p->version . '):~~~');
$r = Deployer::undeploy(Deployer::getPackageRollbackDir($p));
if ($r || IO::OK != IO::dialog('Some part of rollback failed. Remove anyway?', IO::YES | IO::NO, IO::YES)) {
Deployer::getPackageRollbackDir($p)->delete();
$p->file->delete();
PackageManager::get()->packagesSequence->removePackage($p->name, $p->version);
}
}
}