mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +01:00
c25a8fabfc
Summary: Ref T13603. Migrate all code which interacts with the "ObjectHasFile" edge to use the "Attachments" table instead. Test Plan: - Edited a paste's view policy, confirmed associated file secret was scrambled. - Verified I could still view paste content as a user who could not naturally view the underlying file. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13603 Differential Revision: https://secure.phabricator.com/D21819
26 lines
519 B
PHP
26 lines
519 B
PHP
<?php
|
|
|
|
$table = new PhabricatorFileImageMacro();
|
|
foreach (new LiskMigrationIterator($table) as $macro) {
|
|
$name = $macro->getName();
|
|
|
|
echo pht("Linking macro '%s'...", $name)."\n";
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
|
|
$phids[] = $macro->getFilePHID();
|
|
$phids[] = $macro->getAudioPHID();
|
|
$phids = array_filter($phids);
|
|
|
|
if ($phids) {
|
|
foreach ($phids as $phid) {
|
|
$editor->addEdge(
|
|
$macro->getPHID(),
|
|
25,
|
|
$phid);
|
|
}
|
|
$editor->save();
|
|
}
|
|
}
|
|
|
|
echo pht('Done.')."\n";
|