12 foreach ($policies as $policy) {
13 $old_name = "PhabricatorPolicyRule{$policy}";
14 $new_name = "Phabricator{$policy}PolicyRule";
15 $map[$old_name] = $new_name;
18 echo pht('Migrating policies...')."\n";
19 $table = new PhabricatorPolicy();
20 $conn_w = $table->establishConnection('w');
22 foreach (new LiskMigrationIterator($table) as $policy) {
23 $old_rules = $policy->getRules();
26 foreach ($old_rules as $rule) {
27 $existing_rule = $rule['rule'];
28 $rule['rule'] = idx($map, $existing_rule, $existing_rule);
34 'UPDATE %T SET rules = %s WHERE id = %d',
35 $table->getTableName(),
36 json_encode($new_rules),