Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F467506
legalpad-mailkey-populate.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
606 B
Referenced Files
None
Subscribers
None
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
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 3:14 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
80134
Default Alt Text
legalpad-mailkey-populate.php (606 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment