@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.

at recaptime-dev/main 67 lines 1.4 kB view raw
1<?php 2 3final class PhabricatorRepositoryURIIndex 4 extends PhabricatorRepositoryDAO { 5 6 protected $repositoryPHID; 7 protected $repositoryURI; 8 9 protected function getConfiguration() { 10 return array( 11 self::CONFIG_TIMESTAMPS => false, 12 self::CONFIG_COLUMN_SCHEMA => array( 13 'repositoryURI' => 'text', 14 ), 15 self::CONFIG_KEY_SCHEMA => array( 16 'key_repository' => array( 17 'columns' => array('repositoryPHID'), 18 ), 19 'key_uri' => array( 20 'columns' => array('repositoryURI(128)'), 21 ), 22 ), 23 ) + parent::getConfiguration(); 24 } 25 26 public static function updateRepositoryURIs( 27 $repository_phid, 28 array $uris) { 29 30 $table = new self(); 31 $conn_w = $table->establishConnection('w'); 32 33 $sql = array(); 34 foreach ($uris as $key => $uri) { 35 if (!strlen($uri)) { 36 unset($uris[$key]); 37 continue; 38 } 39 40 $sql[] = qsprintf( 41 $conn_w, 42 '(%s, %s)', 43 $repository_phid, 44 $uri); 45 } 46 47 $table->openTransaction(); 48 49 queryfx( 50 $conn_w, 51 'DELETE FROM %R WHERE repositoryPHID = %s', 52 $table, 53 $repository_phid); 54 55 if ($sql) { 56 queryfx( 57 $conn_w, 58 'INSERT INTO %R (repositoryPHID, repositoryURI) VALUES %LQ', 59 $table, 60 $sql); 61 } 62 63 $table->saveTransaction(); 64 65 } 66 67}