當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。