Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2896540
ponder-mailkey-populate.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
595 B
Referenced Files
None
Subscribers
None
ponder-mailkey-populate.php
View Options
<?php
echo
pht
(
'Populating Questions with mail keys...'
)
.
"\n"
;
$table
=
new
PonderQuestion
(
)
;
$table
->
openTransaction
(
)
;
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$question
)
{
$id
=
$question
->
getID
(
)
;
echo
pht
(
'Question %d: '
,
$id
)
;
if
(
!
$question
->
getMailKey
(
)
)
{
queryfx
(
$question
->
establishConnection
(
'w'
)
,
'UPDATE %T SET mailKey = %s WHERE id = %d'
,
$question
->
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
Jan 19 2025, 23:14 (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129776
Default Alt Text
ponder-mailkey-populate.php (595 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment