@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 50 lines 1.1 kB view raw
1<?php 2 3$table = new PhabricatorAuthSSHKey(); 4$conn_w = $table->establishConnection('w'); 5 6echo pht('Updating SSH public key indexes...')."\n"; 7 8$keys = new LiskMigrationIterator($table); 9foreach ($keys as $key) { 10 $id = $key->getID(); 11 12 echo pht('Updating key %d...', $id)."\n"; 13 14 try { 15 $hash = $key->toPublicKey()->getHash(); 16 } catch (Exception $ex) { 17 echo pht('Key has bad format! Removing key.')."\n"; 18 queryfx( 19 $conn_w, 20 'DELETE FROM %T WHERE id = %d', 21 $table->getTableName(), 22 $id); 23 continue; 24 } 25 26 $collision = queryfx_all( 27 $conn_w, 28 'SELECT * FROM %T WHERE keyIndex = %s AND id < %d', 29 $table->getTableName(), 30 $hash, 31 $key->getID()); 32 if ($collision) { 33 echo pht('Key is a duplicate! Removing key.')."\n"; 34 queryfx( 35 $conn_w, 36 'DELETE FROM %T WHERE id = %d', 37 $table->getTableName(), 38 $id); 39 continue; 40 } 41 42 queryfx( 43 $conn_w, 44 'UPDATE %T SET keyIndex = %s WHERE id = %d', 45 $table->getTableName(), 46 $hash, 47 $key->getID()); 48} 49 50echo pht('Done.')."\n";