@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<?php
2
3echo pht('Populating pastes with mail keys...')."\n";
4
5$table = new PhabricatorPaste();
6$table->openTransaction();
7$conn_w = $table->establishConnection('w');
8
9foreach (new LiskMigrationIterator($table) as $paste) {
10 $id = $paste->getID();
11
12 echo "P{$id}: ";
13 if (!$paste->getMailKey()) {
14 queryfx(
15 $conn_w,
16 'UPDATE %T SET mailKey = %s WHERE id = %d',
17 $paste->getTableName(),
18 Filesystem::readRandomCharacters(20),
19 $id);
20 echo pht('Generated Key')."\n";
21 } else {
22 echo "-\n";
23 }
24}
25
26$table->saveTransaction();
27echo pht('Done.')."\n";