@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use application PHIDs in Phlux

Summary: Ref T2715. PVAR -> app phids

Test Plan: Used `conduit.query` to load one.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6557

+53 -31
+2
src/__phutil_library_map__.php
··· 1728 1728 'PhluxDAO' => 'applications/phlux/storage/PhluxDAO.php', 1729 1729 'PhluxEditController' => 'applications/phlux/controller/PhluxEditController.php', 1730 1730 'PhluxListController' => 'applications/phlux/controller/PhluxListController.php', 1731 + 'PhluxPHIDTypeVariable' => 'applications/phlux/phid/PhluxPHIDTypeVariable.php', 1731 1732 'PhluxTransaction' => 'applications/phlux/storage/PhluxTransaction.php', 1732 1733 'PhluxTransactionQuery' => 'applications/phlux/query/PhluxTransactionQuery.php', 1733 1734 'PhluxVariable' => 'applications/phlux/storage/PhluxVariable.php', ··· 3769 3770 'PhluxDAO' => 'PhabricatorLiskDAO', 3770 3771 'PhluxEditController' => 'PhluxController', 3771 3772 'PhluxListController' => 'PhluxController', 3773 + 'PhluxPHIDTypeVariable' => 'PhabricatorPHIDType', 3772 3774 'PhluxTransaction' => 'PhabricatorApplicationTransaction', 3773 3775 'PhluxTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 3774 3776 'PhluxVariable' =>
-1
src/applications/phid/PhabricatorObjectHandle.php
··· 112 112 PhabricatorPHIDConstants::PHID_TYPE_PIMG => 'Pholio Image', 113 113 PhabricatorPHIDConstants::PHID_TYPE_BLOG => 'Blog', 114 114 PhabricatorPHIDConstants::PHID_TYPE_POST => 'Post', 115 - PhabricatorPHIDConstants::PHID_TYPE_PVAR => 'Variable', 116 115 PhabricatorPHIDConstants::PHID_TYPE_LEGD => 'Legalpad Document', 117 116 ); 118 117
-1
src/applications/phid/PhabricatorPHIDConstants.php
··· 19 19 const PHID_TYPE_ANSW = 'ANSW'; 20 20 const PHID_TYPE_PIMG = 'PIMG'; 21 21 const PHID_TYPE_CONP = 'CONP'; 22 - const PHID_TYPE_PVAR = 'PVAR'; 23 22 const PHID_TYPE_ACNT = 'ACNT'; 24 23 const PHID_TYPE_PDCT = 'PDCT'; 25 24 const PHID_TYPE_PRCH = 'PRCH';
-26
src/applications/phid/handle/PhabricatorObjectHandleData.php
··· 114 114 ->execute(); 115 115 return mpull($posts, null, 'getPHID'); 116 116 117 - case PhabricatorPHIDConstants::PHID_TYPE_PVAR: 118 - $vars = id(new PhluxVariableQuery()) 119 - ->withPHIDs($phids) 120 - ->setViewer($this->viewer) 121 - ->execute(); 122 - return mpull($vars, null, 'getPHID'); 123 - 124 117 case PhabricatorPHIDConstants::PHID_TYPE_XUSR: 125 118 $xusr_dao = new PhabricatorExternalAccount(); 126 119 $xusrs = $xusr_dao->loadAllWhere( ··· 328 321 $handle->setFullName($image->getName()); 329 322 $handle->setURI( 330 323 '/M'.$image->getMockID().'/'.$image->getID().'/'); 331 - $handle->setComplete(true); 332 - } 333 - $handles[$phid] = $handle; 334 - } 335 - break; 336 - 337 - case PhabricatorPHIDConstants::PHID_TYPE_PVAR: 338 - foreach ($phids as $phid) { 339 - $handle = new PhabricatorObjectHandle(); 340 - $handle->setPHID($phid); 341 - $handle->setType($type); 342 - if (empty($objects[$phid])) { 343 - $handle->setName('Unknown Variable'); 344 - } else { 345 - $var = $objects[$phid]; 346 - $key = $var->getVariableKey(); 347 - $handle->setName($key); 348 - $handle->setFullName('Phlux Variable "'.$key.'"'); 349 - $handle->setURI('/phlux/view/'.$key.'/'); 350 324 $handle->setComplete(true); 351 325 } 352 326 $handles[$phid] = $handle;
+49
src/applications/phlux/phid/PhluxPHIDTypeVariable.php
··· 1 + <?php 2 + 3 + final class PhluxPHIDTypeVariable extends PhabricatorPHIDType { 4 + 5 + const TYPECONST = 'PVAR'; 6 + 7 + public function getTypeConstant() { 8 + return self::TYPECONST; 9 + } 10 + 11 + public function getTypeName() { 12 + return pht('Variable'); 13 + } 14 + 15 + public function newObject() { 16 + return new PhluxVariable(); 17 + } 18 + 19 + public function loadObjects( 20 + PhabricatorObjectQuery $query, 21 + array $phids) { 22 + 23 + return id(new PhluxVariableQuery()) 24 + ->setViewer($query->getViewer()) 25 + ->withPHIDs($phids) 26 + ->execute(); 27 + } 28 + 29 + public function loadHandles( 30 + PhabricatorHandleQuery $query, 31 + array $handles, 32 + array $objects) { 33 + 34 + foreach ($handles as $phid => $handle) { 35 + $variable = $objects[$phid]; 36 + 37 + $key = $variable->getVariableKey(); 38 + 39 + $handle->setName($key); 40 + $handle->setFullName(pht('Variable "%s"', $key)); 41 + $handle->setURI("/phlux/view/{$key}/"); 42 + } 43 + } 44 + 45 + public function canLoadNamedObject($name) { 46 + return false; 47 + } 48 + 49 + }
+1 -1
src/applications/phlux/storage/PhluxTransaction.php
··· 10 10 } 11 11 12 12 public function getApplicationTransactionType() { 13 - return PhabricatorPHIDConstants::PHID_TYPE_PVAR; 13 + return PhluxPHIDTypeVariable::TYPECONST; 14 14 } 15 15 16 16 public function getApplicationTransactionCommentObject() {
+1 -2
src/applications/phlux/storage/PhluxVariable.php
··· 18 18 } 19 19 20 20 public function generatePHID() { 21 - return PhabricatorPHID::generateNewPHID( 22 - PhabricatorPHIDConstants::PHID_TYPE_PVAR); 21 + return PhabricatorPHID::generateNewPHID(PhluxPHIDTypeVariable::TYPECONST); 23 22 } 24 23 25 24