Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/resources/sql/autopatches/20140113.legalpadsig.2.php
12250 views
1
<?php
2
3
echo pht('Adding secretkeys to legalpad document signatures.')."\n";
4
5
$table = new LegalpadDocumentSignature();
6
$conn_w = $table->establishConnection('w');
7
$iterator = new LiskMigrationIterator($table);
8
foreach ($iterator as $sig) {
9
$id = $sig->getID();
10
11
echo pht('Populating signature %d...', $id)."\n";
12
13
if (!$sig->getSecretKey()) {
14
queryfx(
15
$conn_w,
16
'UPDATE %T SET secretKey = %s WHERE id = %d',
17
$table->getTableName(),
18
Filesystem::readRandomCharacters(20),
19
$id);
20
}
21
}
22
23
echo pht('Done.')."\n";
24
25