当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorRepository::getSymbolSources方法代码示例

本文整理汇总了PHP中PhabricatorRepository::getSymbolSources方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorRepository::getSymbolSources方法的具体用法?PHP PhabricatorRepository::getSymbolSources怎么用?PHP PhabricatorRepository::getSymbolSources使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorRepository的用法示例。


在下文中一共展示了PhabricatorRepository::getSymbolSources方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildSymbolIndexes

 private function buildSymbolIndexes(PhabricatorRepository $repository, array $visible_changesets)
 {
     assert_instances_of($visible_changesets, 'DifferentialChangeset');
     $engine = PhabricatorSyntaxHighlighter::newEngine();
     $langs = $repository->getSymbolLanguages();
     $langs = nonempty($langs, array());
     $sources = $repository->getSymbolSources();
     $sources = nonempty($sources, array());
     $symbol_indexes = array();
     if ($langs && $sources) {
         $have_symbols = id(new DiffusionSymbolQuery())->existsSymbolsInRepository($repository->getPHID());
         if (!$have_symbols) {
             return $symbol_indexes;
         }
     }
     $repository_phids = array_merge(array($repository->getPHID()), $sources);
     $indexed_langs = array_fill_keys($langs, true);
     foreach ($visible_changesets as $key => $changeset) {
         $lang = $engine->getLanguageFromFilename($changeset->getFilename());
         if (empty($indexed_langs) || isset($indexed_langs[$lang])) {
             $symbol_indexes[$key] = array('lang' => $lang, 'repositories' => $repository_phids);
         }
     }
     return $symbol_indexes;
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:25,代码来源:DifferentialRevisionViewController.php

示例2: buildSymbolsProperties

 private function buildSymbolsProperties(PhabricatorRepository $repository, PhabricatorActionListView $actions)
 {
     $viewer = $this->getRequest()->getUser();
     $view = id(new PHUIPropertyListView())->setUser($viewer)->setActionList($actions);
     $languages = $repository->getSymbolLanguages();
     if ($languages) {
         $languages = implode(', ', $languages);
     } else {
         $languages = phutil_tag('em', array(), pht('Any'));
     }
     $view->addProperty(pht('Languages'), $languages);
     $sources = $repository->getSymbolSources();
     if ($sources) {
         $handles = $viewer->loadHandles($sources);
         $sources = $handles->renderList();
     } else {
         $sources = phutil_tag('em', array(), pht('This Repository Only'));
     }
     $view->addProperty(pht('Use Symbols From'), $sources);
     return $view;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:21,代码来源:DiffusionRepositoryEditMainController.php


注:本文中的PhabricatorRepository::getSymbolSources方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。