Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80909396
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, Sep 3, 05:11
Size
550 B
Mime Type
text/x-php
Expires
Thu, Sep 5, 05:11 (2 d)
Engine
blob
Format
Raw Data
Handle
20473067
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