Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122325992
ponder-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
Thu, Jul 17, 05:34
Size
492 B
Mime Type
text/x-php
Expires
Sat, Jul 19, 05:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27442873
Attached To
rPH Phabricator
ponder-mailkey-populate.php
View Options
<?php
echo
"Populating Questions with mail keys...
\n
"
;
foreach
(
new
LiskMigrationIterator
(
new
PonderQuestion
())
as
$question
)
{
$id
=
$question
->
getID
();
echo
"Question {$id}: "
;
if
(!
$question
->
getMailKey
())
{
queryfx
(
$question
->
establishConnection
(
'w'
),
'UPDATE %T SET mailKey = %s WHERE id = %d'
,
$question
->
getTableName
(),
Filesystem
::
readRandomCharacters
(
20
),
$id
);
echo
"Generated Key
\n
"
;
}
else
{
echo
"-
\n
"
;
}
}
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment