Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112019008
081.filekeys.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
Tue, May 6, 22:47
Size
550 B
Mime Type
text/x-php
Expires
Thu, May 8, 22:47 (2 d)
Engine
blob
Format
Raw Data
Handle
26012569
Attached To
rPH Phabricator
081.filekeys.php
View Options
<?php
echo
pht
(
'Generating file keys...'
).
"
\n
"
;
$table
=
new
PhabricatorFile
();
$table
->
openTransaction
();
$table
->
beginReadLocking
();
$files
=
$table
->
loadAllWhere
(
'secretKey IS NULL'
);
echo
pht
(
'%d files to generate keys for'
,
count
(
$files
));
foreach
(
$files
as
$file
)
{
queryfx
(
$file
->
establishConnection
(
'w'
),
'UPDATE %T SET secretKey = %s WHERE id = %d'
,
$file
->
getTableName
(),
$file
->
generateSecretKey
(),
$file
->
getID
());
echo
'.'
;
}
$table
->
endReadLocking
();
$table
->
saveTransaction
();
echo
"
\n
"
.
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment