Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92654480
legalpad-mailkey-populate.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 10:38
Size
606 B
Mime Type
text/x-php
Expires
Sun, Nov 24, 10:38 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
22478553
Attached To
rPH Phabricator
legalpad-mailkey-populate.php
View Options
<?php
echo
pht
(
'Populating Legalpad Documents with mail keys...'
).
"
\n
"
;
$table
=
new
LegalpadDocument
();
$table
->
openTransaction
();
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$document
)
{
$id
=
$document
->
getID
();
echo
pht
(
'Document %s: '
,
$id
);
if
(!
$document
->
getMailKey
())
{
queryfx
(
$document
->
establishConnection
(
'w'
),
'UPDATE %T SET mailKey = %s WHERE id = %d'
,
$document
->
getTableName
(),
Filesystem
::
readRandomCharacters
(
20
),
$id
);
echo
pht
(
'Generated Key'
).
"
\n
"
;
}
else
{
echo
"-
\n
"
;
}
}
$table
->
saveTransaction
();
echo
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment