本文整理汇总了PHP中PhabricatorApplication::getAllApplications方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplication::getAllApplications方法的具体用法?PHP PhabricatorApplication::getAllApplications怎么用?PHP PhabricatorApplication::getAllApplications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplication
的用法示例。
在下文中一共展示了PhabricatorApplication::getAllApplications方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInUseMessage
public function getInUseMessage()
{
$applications = PhabricatorApplication::getAllApplications();
$applications = mpull($applications, null, 'getPHID');
$application = idx($applications, $this->getApplicationPHID());
if ($application) {
$message = pht('The address %s is configured to be used by the %s Application.', $this->getAddress(), $application->getName());
} else {
$message = pht('The address %s is configured to be used by an application.', $this->getAddress());
}
return $message;
}
示例2: getQuicksandURIPatternBlacklist
private function getQuicksandURIPatternBlacklist()
{
$applications = PhabricatorApplication::getAllApplications();
$blacklist = array();
foreach ($applications as $application) {
$blacklist[] = $application->getQuicksandURIPatternBlacklist();
}
return array_mergev($blacklist);
}
示例3: loadPage
public function loadPage()
{
$apps = PhabricatorApplication::getAllApplications();
if ($this->classes) {
$classes = array_fuse($this->classes);
foreach ($apps as $key => $app) {
if (empty($classes[get_class($app)])) {
unset($apps[$key]);
}
}
}
if ($this->phids) {
$phids = array_fuse($this->phids);
foreach ($apps as $key => $app) {
if (empty($phids[$app->getPHID()])) {
unset($apps[$key]);
}
}
}
if (strlen($this->nameContains)) {
foreach ($apps as $key => $app) {
if (stripos($app->getName(), $this->nameContains) === false) {
unset($apps[$key]);
}
}
}
if ($this->installed !== null) {
foreach ($apps as $key => $app) {
if ($app->isInstalled() != $this->installed) {
unset($apps[$key]);
}
}
}
if ($this->beta !== null) {
foreach ($apps as $key => $app) {
if ($app->isBeta() != $this->beta) {
unset($apps[$key]);
}
}
}
if ($this->firstParty !== null) {
foreach ($apps as $key => $app) {
if ($app->isFirstParty() != $this->firstParty) {
unset($apps[$key]);
}
}
}
if ($this->unlisted !== null) {
foreach ($apps as $key => $app) {
if ($app->isUnlisted() != $this->unlisted) {
unset($apps[$key]);
}
}
}
if ($this->launchable !== null) {
foreach ($apps as $key => $app) {
if ($app->isLaunchable() != $this->launchable) {
unset($apps[$key]);
}
}
}
switch ($this->order) {
case self::ORDER_NAME:
$apps = msort($apps, 'getName');
break;
case self::ORDER_APPLICATION:
$apps = $apps;
break;
default:
throw new Exception(pht('Unknown order "%s"!', $this->order));
}
return $apps;
}
示例4: getDefaultObjectTypePolicyMap
private static function getDefaultObjectTypePolicyMap()
{
static $map;
if ($map === null) {
$map = array();
$apps = PhabricatorApplication::getAllApplications();
foreach ($apps as $app) {
$map += $app->getDefaultObjectTypePolicyMap();
}
}
return $map;
}
示例5: getByClass
public static function getByClass($class_name)
{
$selected = null;
$applications = PhabricatorApplication::getAllApplications();
foreach ($applications as $application) {
if (get_class($application) == $class_name) {
$selected = $application;
break;
}
}
if (!$selected) {
throw new Exception("No application '{$class_name}'!");
}
return $selected;
}
示例6: testApplicationsInstalled
public function testApplicationsInstalled()
{
$all = PhabricatorApplication::getAllApplications();
$installed = PhabricatorApplication::getAllInstalledApplications();
$this->assertEqual(count($all), count($installed), 'In test cases, all applications should default to installed.');
}
示例7: testGetAllApplications
public function testGetAllApplications()
{
PhabricatorApplication::getAllApplications();
$this->assertTrue(true);
}