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


PHP PhabricatorRepository::getCloneName方法代码示例

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


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

示例1: renderCloneURI

 private function renderCloneURI(PhabricatorRepository $repository, PhabricatorRepositoryURI $uri)
 {
     if ($repository->isSVN()) {
         $display = csprintf('svn checkout %R %R', (string) $uri->getDisplayURI(), $repository->getCloneName());
     } else {
         $display = csprintf('%R', (string) $uri->getDisplayURI());
     }
     $display = (string) $display;
     $viewer = $this->getViewer();
     return id(new DiffusionCloneURIView())->setViewer($viewer)->setRepository($repository)->setRepositoryURI($uri)->setDisplayURI($display);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:11,代码来源:DiffusionRepositoryController.php

示例2: renderCloneCommand

 private function renderCloneCommand(PhabricatorRepository $repository, $uri, $serve_mode = null, $manage_uri = null)
 {
     require_celerity_resource('diffusion-icons-css');
     Javelin::initBehavior('select-on-click');
     switch ($repository->getVersionControlSystem()) {
         case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
             $command = csprintf('git clone %R', $uri);
             break;
         case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
             $command = csprintf('hg clone %R', $uri);
             break;
         case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
             if ($repository->isHosted()) {
                 $command = csprintf('svn checkout %R %R', $uri, $repository->getCloneName());
             } else {
                 $command = csprintf('svn checkout %R', $uri);
             }
             break;
     }
     $input = javelin_tag('input', array('type' => 'text', 'value' => (string) $command, 'class' => 'diffusion-clone-uri', 'sigil' => 'select-on-click', 'readonly' => 'true'));
     $extras = array();
     if ($serve_mode) {
         if ($serve_mode === PhabricatorRepository::SERVE_READONLY) {
             $extras[] = pht('(Read Only)');
         }
     }
     if ($manage_uri) {
         if ($this->getRequest()->getUser()->isLoggedIn()) {
             $extras[] = phutil_tag('a', array('href' => $manage_uri), pht('Manage Credentials'));
         }
     }
     if ($extras) {
         $extras = phutil_implode_html(' ', $extras);
         $extras = phutil_tag('div', array('class' => 'diffusion-clone-extras'), $extras);
     }
     return array($input, $extras);
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:37,代码来源:DiffusionRepositoryController.php

示例3: buildBasicProperties

 private function buildBasicProperties(PhabricatorRepository $repository, PhabricatorActionListView $actions)
 {
     $viewer = $this->getRequest()->getUser();
     $view = id(new PHUIPropertyListView())->setUser($viewer)->setActionList($actions);
     $type = PhabricatorRepositoryType::getNameForRepositoryType($repository->getVersionControlSystem());
     $view->addProperty(pht('Type'), $type);
     $view->addProperty(pht('Callsign'), $repository->getCallsign());
     $clone_name = $repository->getDetail('clone-name');
     if ($repository->isHosted()) {
         $view->addProperty(pht('Clone/Checkout As'), $clone_name ? $clone_name . '/' : phutil_tag('em', array(), $repository->getCloneName() . '/'));
     }
     $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs($repository->getPHID(), PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
     if ($project_phids) {
         $this->loadHandles($project_phids);
         $project_text = $this->renderHandlesForPHIDs($project_phids);
     } else {
         $project_text = phutil_tag('em', array(), pht('None'));
     }
     $view->addProperty(pht('Projects'), $project_text);
     $view->addProperty(pht('Status'), $this->buildRepositoryStatus($repository));
     $view->addProperty(pht('Update Frequency'), $this->buildRepositoryUpdateInterval($repository));
     $description = $repository->getDetail('description');
     $view->addSectionHeader(pht('Description'));
     if (!strlen($description)) {
         $description = phutil_tag('em', array(), pht('No description provided.'));
     } else {
         $description = PhabricatorMarkupEngine::renderOneObject($repository, 'description', $viewer);
     }
     $view->addTextContent($description);
     return $view;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:31,代码来源:DiffusionRepositoryEditMainController.php


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