本文整理汇总了PHP中DiffusionRequest::getSymbolicCommit方法的典型用法代码示例。如果您正苦于以下问题:PHP DiffusionRequest::getSymbolicCommit方法的具体用法?PHP DiffusionRequest::getSymbolicCommit怎么用?PHP DiffusionRequest::getSymbolicCommit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiffusionRequest
的用法示例。
在下文中一共展示了DiffusionRequest::getSymbolicCommit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildPropertyView
protected function buildPropertyView(DiffusionRequest $drequest, PhabricatorActionListView $actions)
{
$viewer = $this->getRequest()->getUser();
$view = id(new PHUIPropertyListView())->setUser($viewer)->setActionList($actions);
$stable_commit = $drequest->getStableCommit();
$callsign = $drequest->getRepository()->getCallsign();
$view->addProperty(pht('Commit'), phutil_tag('a', array('href' => $drequest->generateURI(array('action' => 'commit', 'commit' => $stable_commit))), $drequest->getRepository()->formatCommitName($stable_commit)));
if ($drequest->getSymbolicType() == 'tag') {
$symbolic = $drequest->getSymbolicCommit();
$view->addProperty(pht('Tag'), $symbolic);
$tags = $this->callConduitWithDiffusionRequest('diffusion.tagsquery', array('names' => array($symbolic), 'needMessages' => true));
$tags = DiffusionRepositoryTag::newFromConduit($tags);
$tags = mpull($tags, null, 'getName');
$tag = idx($tags, $symbolic);
if ($tag && strlen($tag->getMessage())) {
$view->addSectionHeader(pht('Tag Content'));
$view->addTextContent($this->markupText($tag->getMessage()));
}
}
return $view;
}
示例2: buildPropertyView
protected function buildPropertyView(DiffusionRequest $drequest, PhabricatorActionListView $actions)
{
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView())->setUser($viewer)->setActionList($actions);
$stable_commit = $drequest->getStableCommit();
$callsign = $drequest->getRepository()->getCallsign();
$view->addProperty(pht('Commit'), phutil_tag('a', array('href' => $drequest->generateURI(array('action' => 'commit', 'commit' => $stable_commit))), $drequest->getRepository()->formatCommitName($stable_commit)));
if ($drequest->getSymbolicType() == 'tag') {
$symbolic = $drequest->getSymbolicCommit();
$view->addProperty(pht('Tag'), $symbolic);
$tags = $this->callConduitWithDiffusionRequest('diffusion.tagsquery', array('names' => array($symbolic), 'needMessages' => true));
$tags = DiffusionRepositoryTag::newFromConduit($tags);
$tags = mpull($tags, null, 'getName');
$tag = idx($tags, $symbolic);
if ($tag && strlen($tag->getMessage())) {
$view->addSectionHeader(pht('Tag Content'));
$view->addTextContent($this->markupText($tag->getMessage()));
}
}
$repository = $drequest->getRepository();
$owners = 'PhabricatorOwnersApplication';
if (PhabricatorApplication::isClassInstalled($owners)) {
$package_query = id(new PhabricatorOwnersPackageQuery())->setViewer($viewer)->withControl($repository->getPHID(), array($drequest->getPath()));
$package_query->execute();
$packages = $package_query->getControllingPackagesForPath($repository->getPHID(), $drequest->getPath());
if ($packages) {
$ownership = id(new PHUIStatusListView())->setUser($viewer);
foreach ($packages as $package) {
$icon = 'fa-list-alt';
$color = 'grey';
$item = id(new PHUIStatusItemView())->setIcon($icon, $color)->setTarget($viewer->renderHandle($package->getPHID()));
$ownership->addItem($item);
}
} else {
$ownership = phutil_tag('em', array(), pht('None'));
}
$view->addProperty(pht('Packages'), $ownership);
}
return $view;
}
示例3: buildPropertyView
protected function buildPropertyView(DiffusionRequest $drequest)
{
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView())->setUser($viewer);
if ($drequest->getSymbolicType() == 'tag') {
$symbolic = $drequest->getSymbolicCommit();
$view->addProperty(pht('Tag'), $symbolic);
$tags = $this->callConduitWithDiffusionRequest('diffusion.tagsquery', array('names' => array($symbolic), 'needMessages' => true));
$tags = DiffusionRepositoryTag::newFromConduit($tags);
$tags = mpull($tags, null, 'getName');
$tag = idx($tags, $symbolic);
if ($tag && strlen($tag->getMessage())) {
$view->addSectionHeader(pht('Tag Content'), 'fa-tag');
$view->addTextContent($this->markupText($tag->getMessage()));
}
}
if ($view->hasAnyProperties()) {
return $view;
}
return null;
}