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


PHP PhabricatorFile::getPHID方法代碼示例

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


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

示例1: renderCommentForm

 private function renderCommentForm(PhabricatorFile $file)
 {
     $viewer = $this->getViewer();
     if (!$viewer->isLoggedIn()) {
         $login_href = id(new PhutilURI('/auth/start/'))->setQueryParam('next', '/' . $file->getMonogram());
         return id(new PHUIFormLayoutView())->addClass('phui-comment-panel-empty')->appendChild(id(new PHUIButtonView())->setTag('a')->setText(pht('Login to Comment'))->setHref((string) $login_href));
     }
     $draft = PhabricatorDraft::newFromUserAndKey($viewer, $file->getPHID());
     $post_uri = $this->getApplicationURI('thread/' . $file->getPHID() . '/');
     $form = id(new AphrontFormView())->setUser($viewer)->setAction($post_uri)->addSigil('lightbox-comment-form')->addClass('lightbox-comment-form')->setWorkflow(true)->appendChild(id(new PhabricatorRemarkupControl())->setUser($viewer)->setName('comment')->setValue($draft->getDraft()))->appendChild(id(new AphrontFormSubmitControl())->setValue(pht('Comment')));
     $view = phutil_tag_div('phui-comment-panel', $form);
     return $view;
 }
開發者ID:NeoArmageddon,項目名稱:phabricator,代碼行數:13,代碼來源:PhabricatorFileLightboxController.php

示例2: canViewFile

 private function canViewFile(array $users, PhabricatorFile $file)
 {
     $results = array();
     foreach ($users as $user) {
         $results[] = (bool) id(new PhabricatorFileQuery())->setViewer($user)->withPHIDs(array($file->getPHID()))->execute();
     }
     return $results;
 }
開發者ID:hrb518,項目名稱:phabricator,代碼行數:8,代碼來源:PhabricatorFileTestCase.php

示例3: buildTransactionView

 private function buildTransactionView(PhabricatorFile $file, array $xactions)
 {
     $user = $this->getRequest()->getUser();
     $engine = id(new PhabricatorMarkupEngine())->setViewer($user);
     foreach ($xactions as $xaction) {
         if ($xaction->getComment()) {
             $engine->addObject($xaction->getComment(), PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
         }
     }
     $engine->process();
     $timeline = id(new PhabricatorApplicationTransactionView())->setUser($user)->setObjectPHID($file->getPHID())->setTransactions($xactions)->setMarkupEngine($engine);
     $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
     $add_comment_header = $is_serious ? pht('Add Comment') : pht('Question File Integrity');
     $draft = PhabricatorDraft::newFromUserAndKey($user, $file->getPHID());
     $add_comment_form = id(new PhabricatorApplicationTransactionCommentView())->setUser($user)->setObjectPHID($file->getPHID())->setDraft($draft)->setHeaderText($add_comment_header)->setAction($this->getApplicationURI('/comment/' . $file->getID() . '/'))->setSubmitButtonName(pht('Add Comment'));
     return array($timeline, $add_comment_form);
 }
開發者ID:denghp,項目名稱:phabricator,代碼行數:17,代碼來源:PhabricatorFileInfoController.php

示例4: newChunkQuery

 private function newChunkQuery(PhabricatorUser $viewer, PhabricatorFile $file)
 {
     $engine = $file->instantiateStorageEngine();
     if (!$engine->isChunkEngine()) {
         throw new Exception(pht('File "%s" does not have chunks!', $file->getPHID()));
     }
     return id(new PhabricatorFileChunkQuery())->setViewer($viewer)->withChunkHandles(array($file->getStorageHandle()));
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:8,代碼來源:FileConduitAPIMethod.php

示例5: renderFileLink

 private function renderFileLink(PhabricatorFile $file, PhabricatorObjectHandle $handle, array $options)
 {
     return id(new PhabricatorFileLinkView())->setFilePHID($file->getPHID())->setFileName($this->assertFlatText($options['name']))->setFileDownloadURI($file->getDownloadURI())->setFileViewURI($file->getBestURI())->setFileViewable((bool) $options['viewable']);
 }
開發者ID:patelhardik,項目名稱:phabricator,代碼行數:4,代碼來源:PhabricatorEmbedFileRemarkupRule.php

示例6: updateFromFile

 /**
  * Set the specified file as the next version for the fragment.
  */
 public function updateFromFile(PhabricatorUser $viewer, PhabricatorFile $file)
 {
     $existing = id(new PhragmentFragmentVersionQuery())->setViewer($viewer)->withFragmentPHIDs(array($this->getPHID()))->execute();
     $sequence = count($existing);
     $this->openTransaction();
     $version = id(new PhragmentFragmentVersion());
     $version->setSequence($sequence);
     $version->setFragmentPHID($this->getPHID());
     $version->setFilePHID($file->getPHID());
     $version->save();
     $this->setLatestVersionPHID($version->getPHID());
     $this->save();
     $this->saveTransaction();
     $file->attachToObject($version->getPHID());
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:18,代碼來源:PhragmentFragment.php

示例7: getFileDictionary

 private function getFileDictionary(PhabricatorFile $file)
 {
     return array('id' => $file->getID(), 'phid' => $file->getPHID(), 'uri' => $file->getBestURI());
 }
開發者ID:hrb518,項目名稱:phabricator,代碼行數:4,代碼來源:PhabricatorFileDropUploadController.php


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