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


PHP PhabricatorPHID类代码示例

本文整理汇总了PHP中PhabricatorPHID的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorPHID类的具体用法?PHP PhabricatorPHID怎么用?PHP PhabricatorPHID使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testTransactionRollback

 public function testTransactionRollback()
 {
     $check = array();
     $phid = new PhabricatorPHID();
     $phid->openTransaction();
     for ($ii = 0; $ii < 3; $ii++) {
         $test_phid = $this->generateTestPHID();
         $obj = new PhabricatorPHID();
         $obj->setPHID($test_phid);
         $obj->setPHIDType('TEST');
         $obj->setOwnerPHID('PHID-UNIT-!!!!');
         $obj->save();
         $check[] = $test_phid;
     }
     $phid->killTransaction();
     foreach ($check as $test_phid) {
         $this->assertNoSuchPHID($test_phid);
     }
 }
开发者ID:ramons03,项目名称:phabricator,代码行数:19,代码来源:AphrontIsolatedDatabaseConnectionTestCase.php

示例2: createBasicDummyHandle

 protected function createBasicDummyHandle($name, $type, $fullname = null, $uri = null)
 {
     $id = mt_rand(15, 9999);
     $handle = new PhabricatorObjectHandle();
     $handle->setName($name);
     $handle->setType($type);
     $handle->setPHID(PhabricatorPHID::generateNewPHID($type));
     if ($fullname) {
         $handle->setFullName($fullname);
     } else {
         $handle->setFullName(sprintf('%s%d: %s', substr($type, 0, 1), $id, $name));
     }
     if ($uri) {
         $handle->setURI($uri);
     }
     return $handle;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:17,代码来源:PhabricatorUIExample.php

示例3: execute

 protected function execute(ConduitAPIRequest $request)
 {
     $names = $request->getValue('names');
     $phids = array();
     foreach ($names as $name) {
         $phid = PhabricatorPHID::fromObjectName($name);
         if ($phid) {
             $phids[$name] = $phid;
         }
     }
     $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
     $result = array();
     foreach ($phids as $name => $phid) {
         if (isset($handles[$phid]) && $handles[$phid]->isComplete()) {
             $result[$name] = $this->buildHandleInformationDictionary($handles[$phid]);
         }
     }
     return $result;
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:19,代码来源:ConduitAPI_phid_lookup_Method.php

示例4: generateNewPHID

 public static function generateNewPHID($type, array $config = array())
 {
     $owner = idx($config, 'owner');
     $parent = idx($config, 'parent');
     if (!$type) {
         throw new Exception("Can not generate PHID with no type.");
     }
     $uniq = Filesystem::readRandomCharacters(20);
     $phid = 'PHID-' . $type . '-' . $uniq;
     $phid_rec = new PhabricatorPHID();
     $phid_rec->setPHIDType($type);
     $phid_rec->setOwnerPHID($owner);
     $phid_rec->setParentPHID($parent);
     $phid_rec->setPHID($phid);
     $phid_rec->save();
     return $phid;
 }
开发者ID:ramons03,项目名称:phabricator,代码行数:17,代码来源:PhabricatorPHID.php

示例5: save

 public function save()
 {
     $this->subscriptionClassKey = PhabricatorHash::digestForIndex($this->subscriptionClass);
     $this->subscriptionRefKey = PhabricatorHash::digestForIndex($this->subscriptionRef);
     $is_new = !$this->getID();
     $this->openTransaction();
     // If we're saving this subscription for the first time, we're also
     // going to set up the trigger for it.
     if ($is_new) {
         $trigger_phid = PhabricatorPHID::generateNewPHID(PhabricatorWorkerTriggerPHIDType::TYPECONST);
         $this->setTriggerPHID($trigger_phid);
     }
     $result = parent::save();
     if ($is_new) {
         $trigger_action = new PhabricatorScheduleTaskTriggerAction(array('class' => 'PhortuneSubscriptionWorker', 'data' => array('subscriptionPHID' => $this->getPHID()), 'options' => array('objectPHID' => $this->getPHID(), 'priority' => PhabricatorWorker::PRIORITY_BULK)));
         $trigger = $this->getTrigger();
         $trigger->setPHID($trigger_phid);
         $trigger->setAction($trigger_action);
         $trigger->save();
     }
     $this->saveTransaction();
     return $result;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:23,代码来源:PhortuneSubscription.php

示例6: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorRepositoryRepositoryPHIDType::TYPECONST);
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:4,代码来源:PhabricatorRepository.php

示例7: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorOwnersPackagePHIDType::TYPECONST);
 }
开发者ID:Houzz,项目名称:phabricator,代码行数:4,代码来源:PhabricatorOwnersPackage.php

示例8: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(DrydockRepositoryOperationPHIDType::TYPECONST);
 }
开发者ID:nilsdornblut,项目名称:phabricator,代码行数:4,代码来源:DrydockRepositoryOperation.php

示例9: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorDashboardPanelPHIDType::TYPECONST);
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:4,代码来源:PhabricatorDashboardPanel.php

示例10: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(DrydockLeasePHIDType::TYPECONST);
 }
开发者ID:Robert-Xie,项目名称:phabricator,代码行数:4,代码来源:DrydockLease.php

示例11: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorConfigConfigPHIDType::TYPECONST);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:4,代码来源:PhabricatorConfigEntry.php

示例12: id

$conn_w = id(new DifferentialRevision())->establishConnection('w');
$rows = new LiskRawMigrationIterator($conn_w, 'differential_comment');
$content_source = PhabricatorContentSource::newForSource(PhabricatorContentSource::SOURCE_LEGACY, array())->serialize();
echo pht('Migrating Differential comment text to modern storage...') . "\n";
foreach ($rows as $row) {
    $id = $row['id'];
    echo pht('Migrating Differential comment %d...', $id) . "\n";
    if (!strlen($row['content'])) {
        echo pht('Comment has no text, continuing.') . "\n";
        continue;
    }
    $revision = id(new DifferentialRevision())->load($row['revisionID']);
    if (!$revision) {
        echo pht('Comment has no valid revision, continuing.') . "\n";
        continue;
    }
    $revision_phid = $revision->getPHID();
    $dst_table = 'differential_inline_comment';
    $xaction_phid = PhabricatorPHID::generateNewPHID(PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST, DifferentialRevisionPHIDType::TYPECONST);
    $comment_phid = PhabricatorPHID::generateNewPHID(PhabricatorPHIDConstants::PHID_TYPE_XCMT, DifferentialRevisionPHIDType::TYPECONST);
    queryfx($conn_w, 'INSERT IGNORE INTO %T
      (phid, transactionPHID, authorPHID, viewPolicy, editPolicy,
        commentVersion, content, contentSource, isDeleted,
        dateCreated, dateModified, revisionPHID, changesetID,
        legacyCommentID)
      VALUES (%s, %s, %s, %s, %s,
        %d, %s, %s, %d,
        %d, %d, %s, %nd,
        %d)', 'differential_transaction_comment', $comment_phid, $xaction_phid, $row['authorPHID'], 'public', $row['authorPHID'], 1, $row['content'], $content_source, 0, $row['dateCreated'], $row['dateModified'], $revision_phid, null, $row['id']);
}
echo pht('Done.') . "\n";
开发者ID:pugong,项目名称:phabricator,代码行数:31,代码来源:20140211.dx.2.migcommenttext.php

示例13: foreach

 }
 // Build the main comment transaction.
 foreach ($main_comments as $main) {
     $xactions[] = array('type' => PhabricatorTransactions::TYPE_COMMENT, 'old' => null, 'new' => null, 'phid' => $main['transactionPHID'], 'comment' => $main);
 }
 // Build inline comment transactions.
 foreach ($inline_comments as $inline) {
     $xactions[] = array('type' => PhabricatorAuditActionConstants::INLINE, 'old' => null, 'new' => null, 'phid' => $inline['transactionPHID'], 'comment' => $inline);
 }
 foreach ($xactions as $xaction) {
     // Generate a new PHID, if we don't already have one from the comment
     // table. We pregenerated into the comment table to make this a little
     // easier, so we only need to write to one table.
     $xaction_phid = idx($xaction, 'phid');
     if (!$xaction_phid) {
         $xaction_phid = PhabricatorPHID::generateNewPHID(PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST, PhabricatorRepositoryCommitPHIDType::TYPECONST);
     }
     unset($xaction['phid']);
     $comment_phid = null;
     $comment_version = 0;
     if (idx($xaction, 'comment')) {
         $comment_phid = $xaction['comment']['phid'];
         $comment_version = 1;
     }
     $old = idx($xaction, 'old');
     $new = idx($xaction, 'new');
     $meta = idx($xaction, 'meta', array());
     queryfx($conn_w, 'INSERT INTO %T (phid, authorPHID, objectPHID, viewPolicy, editPolicy,
       commentPHID, commentVersion, transactionType, oldValue, newValue,
       contentSource, metadata, dateCreated, dateModified)
     VALUES (%s, %s, %s, %s, %s, %ns, %d, %s, %ns, %ns, %s, %s, %d, %d)', 'audit_transaction', $xaction_phid, $row['actorPHID'], $row['targetPHID'], 'public', $row['actorPHID'], $comment_phid, $comment_version, $xaction['type'], json_encode($old), json_encode($new), $content_source, json_encode($meta), $row['dateCreated'], $row['dateModified']);
开发者ID:denghp,项目名称:phabricator,代码行数:31,代码来源:20140725.audit.1.migxactions.php

示例14: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorOAuthServerClientPHIDType::TYPECONST);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:4,代码来源:PhabricatorOAuthServerClient.php

示例15: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorPeopleExternalPHIDType::TYPECONST);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:4,代码来源:PhabricatorExternalAccount.php


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