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

Add mail keys to ReleephRequests

Summary: Adding mail-keys; required for `PhabricatorApplicationTransaction` support.

Test Plan: Upgrade an old database with this patch, observe the matrix: {F42620}

Reviewers: wez, epriestley

Reviewed By: epriestley

CC: epriestley, aran

Maniphest Tasks: T2720

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

+45
+2
resources/sql/patches/20130507.releephrqmailkey.sql
··· 1 + ALTER TABLE {$NAMESPACE}_releeph.releeph_request 2 + ADD COLUMN `mailKey` varchar(20) NOT NULL;
+27
resources/sql/patches/20130507.releephrqmailkeypop.php
··· 1 + <?php 2 + 3 + echo "Populating Releeph requests with mail keys...\n"; 4 + 5 + $table = new ReleephRequest(); 6 + $table->openTransaction(); 7 + 8 + // From ponder-mailkey-populate.php... 9 + foreach (new LiskMigrationIterator($table) as $rq) { 10 + $id = $rq->getID(); 11 + 12 + echo "RQ{$id}: "; 13 + if (!$rq->getMailKey()) { 14 + queryfx( 15 + $rq->establishConnection('w'), 16 + 'UPDATE %T SET mailKey = %s WHERE id = %d', 17 + $rq->getTableName(), 18 + Filesystem::readRandomCharacters(20), 19 + $id); 20 + echo("Generated Key\n"); 21 + } else { 22 + echo "-\n"; 23 + } 24 + } 25 + 26 + $table->saveTransaction(); 27 + echo "Done.\n";
+8
src/applications/releeph/storage/ReleephRequest.php
··· 9 9 protected $userIntents = array(); 10 10 protected $inBranch; 11 11 protected $pickStatus; 12 + protected $mailKey; 12 13 13 14 // Information about the thing being requested 14 15 protected $requestCommitPHID; ··· 151 152 public function generatePHID() { 152 153 return PhabricatorPHID::generateNewPHID( 153 154 ReleephPHIDConstants::PHID_TYPE_RERQ); 155 + } 156 + 157 + public function save() { 158 + if (!$this->getMailKey()) { 159 + $this->setMailKey(Filesystem::readRandomCharacters(20)); 160 + } 161 + return parent::save(); 154 162 } 155 163 156 164
+8
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1274 1274 'type' => 'sql', 1275 1275 'name' => $this->getPatchPath('20130507.releephrqsimplifycols.sql'), 1276 1276 ), 1277 + '20130507.releephrqmailkey.sql' => array( 1278 + 'type' => 'sql', 1279 + 'name' => $this->getPatchPath('20130507.releephrqmailkey.sql'), 1280 + ), 1281 + '20130507.releephrqmailkeypop.php' => array( 1282 + 'type' => 'php', 1283 + 'name' => $this->getPatchPath('20130507.releephrqmailkeypop.php'), 1284 + ), 1277 1285 ); 1278 1286 } 1279 1287 }