本文整理匯總了PHP中PEAR_Registry::listAllPackages方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_Registry::listAllPackages方法的具體用法?PHP PEAR_Registry::listAllPackages怎麽用?PHP PEAR_Registry::listAllPackages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PEAR_Registry
的用法示例。
在下文中一共展示了PEAR_Registry::listAllPackages方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rebuildDB
/**
* Rebuild the dependency DB by reading registry entries.
* @return true|PEAR_Error
*/
function rebuildDB()
{
$depdb = array('_version' => $this->_version);
if (!$this->hasWriteAccess()) {
// allow startup for read-only with older Registry
return $depdb;
}
$packages = $this->_registry->listAllPackages();
if (PEAR::isError($packages)) {
return $packages;
}
foreach ($packages as $channel => $ps) {
foreach ($ps as $package) {
$package = $this->_registry->getPackage($package, $channel);
if (PEAR::isError($package)) {
return $package;
}
$this->_setPackageDeps($depdb, $package);
}
}
$error = $this->_writeDepDB($depdb);
if (PEAR::isError($error)) {
return $error;
}
$this->_cache = $depdb;
return true;
}
示例2: foreach
/**
* @param PEAR_Frontend_*
* @param array
* @param PEAR_Config
*/
function PEAR_Downloader(&$ui, $options, &$config)
{
parent::PEAR_Common();
$this->_options = $options;
$this->config =& $config;
$this->_preferredState = $this->config->get('preferred_state');
$this->ui =& $ui;
if (!$this->_preferredState) {
// don't inadvertantly use a non-set preferred_state
$this->_preferredState = null;
}
if (isset($this->_options['installroot'])) {
$this->config->setInstallRoot($this->_options['installroot']);
}
$this->_registry =& $config->getRegistry();
if (isset($this->_options['alldeps']) || isset($this->_options['onlyreqdeps'])) {
$this->_installed = $this->_registry->listAllPackages();
foreach ($this->_installed as $key => $unused) {
if (!count($unused)) {
continue;
}
$strtolower = create_function('$a', 'return strtolower($a);');
array_walk($this->_installed[$key], $strtolower);
}
}
}
示例3: rebuildDB
/**
* Rebuild the dependency DB by reading registry entries.
* @return true|PEAR_Error
*/
function rebuildDB()
{
$depdb = array('_version' => $this->_version);
$packages = $this->_registry->listAllPackages();
foreach ($packages as $channel => $ps) {
foreach ($ps as $package) {
$package = $this->_registry->getPackage($package, $channel);
$this->_setPackageDeps($depdb, $package);
}
}
$error = $this->_writeDepDB($depdb);
if (PEAR::isError($error)) {
return $error;
}
$this->_cache = $depdb;
return true;
}