當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DiffusionRequest::initializeFromAphrontRequestDictionary方法代碼示例

本文整理匯總了PHP中DiffusionRequest::initializeFromAphrontRequestDictionary方法的典型用法代碼示例。如果您正苦於以下問題:PHP DiffusionRequest::initializeFromAphrontRequestDictionary方法的具體用法?PHP DiffusionRequest::initializeFromAphrontRequestDictionary怎麽用?PHP DiffusionRequest::initializeFromAphrontRequestDictionary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DiffusionRequest的用法示例。


在下文中一共展示了DiffusionRequest::initializeFromAphrontRequestDictionary方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initializeFromAphrontRequestDictionary

 protected function initializeFromAphrontRequestDictionary(array $data)
 {
     parent::initializeFromAphrontRequestDictionary($data);
     if (!strncmp($this->path, ':', 1)) {
         $this->path = substr($this->path, 1);
         $this->path = ltrim($this->path, '/');
     }
 }
開發者ID:nguyennamtien,項目名稱:phabricator,代碼行數:8,代碼來源:DiffusionSvnRequest.php

示例2: initializeFromAphrontRequestDictionary

 protected function initializeFromAphrontRequestDictionary(array $data)
 {
     parent::initializeFromAphrontRequestDictionary($data);
     if ($this->path === null) {
         $subpath = $this->repository->getDetail('svn-subpath');
         if ($subpath) {
             $this->path = $subpath;
         }
     }
     if (!strncmp($this->path, ':', 1)) {
         $this->path = substr($this->path, 1);
         $this->path = ltrim($this->path, '/');
     }
 }
開發者ID:hwang36,項目名稱:phabricator,代碼行數:14,代碼來源:DiffusionSvnRequest.php

示例3: initializeFromAphrontRequestDictionary

 protected function initializeFromAphrontRequestDictionary(array $data)
 {
     parent::initializeFromAphrontRequestDictionary($data);
     $path = $this->path;
     $parts = explode('/', $path);
     $branch = array_shift($parts);
     if ($branch != ':') {
         $this->branch = $this->decodeBranchName($branch);
     }
     foreach ($parts as $key => $part) {
         if ($part == '..') {
             unset($parts[$key]);
         }
     }
     $this->path = implode('/', $parts);
 }
開發者ID:netcomtec,項目名稱:phabricator,代碼行數:16,代碼來源:DiffusionMercurialRequest.php

示例4: initializeFromAphrontRequestDictionary

 protected function initializeFromAphrontRequestDictionary(array $data)
 {
     parent::initializeFromAphrontRequestDictionary($data);
     $path = $this->path;
     $parts = explode('/', $path);
     $branch = array_shift($parts);
     if ($branch != ':') {
         $this->branch = $this->decodeBranchName($branch);
     }
     foreach ($parts as $key => $part) {
         // Prevent any hyjinx since we're ultimately shipping this to the
         // filesystem under a lot of git workflows.
         if ($part == '..') {
             unset($parts[$key]);
         }
     }
     $this->path = implode('/', $parts);
     if ($this->repository) {
         $repository = $this->repository;
         // TODO: This is not terribly efficient and does not produce terribly
         // good error messages, but it seems better to put error handling code
         // here than to try to do it in every query.
         $branch = $this->getBranch();
         // TODO: Here, particularly, we should give the user a specific error
         // message to indicate whether they've typed in some bogus branch and/or
         // followed a bad link, or misconfigured the default branch in the
         // Repository tool.
         list($this->stableCommitName) = $repository->execxLocalCommand('rev-parse --verify %s/%s', DiffusionBranchInformation::DEFAULT_GIT_REMOTE, $branch);
         if ($this->commit) {
             list($commit) = $repository->execxLocalCommand('rev-parse --verify %s', $this->commit);
             // Beyond verifying them, expand commit short forms to full 40-character
             // hashes.
             $this->commit = trim($commit);
             // If we have a commit, overwrite the branch commit with the more
             // specific commit.
             $this->stableCommitName = $this->commit;
             /*
             
               TODO: Unclear if this is actually a good idea or not; it breaks commit views
               at the very least.
             
                     list($contains) = $repository->execxLocalCommand(
                       'branch --contains %s',
                       $this->commit);
                     $contains = array_filter(explode("\n", $contains));
                     $found = false;
                     foreach ($contains as $containing_branch) {
                       $containing_branch = trim($containing_branch, "* \n");
                       if ($containing_branch == $branch) {
                         $found = true;
                         break;
                       }
                     }
                     if (!$found) {
                       throw new Exception(
                         "Commit does not exist on this branch!");
                     }
             */
         }
     }
 }
開發者ID:netcomtec,項目名稱:phabricator,代碼行數:61,代碼來源:DiffusionGitRequest.php


注:本文中的DiffusionRequest::initializeFromAphrontRequestDictionary方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。