1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-21 22:32:41 +01:00

phtize all the things

Summary: `pht`ize a whole bunch of strings in rP.

Test Plan: Intense eyeballing.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12797
This commit is contained in:
Joshua Spence 2015-05-22 17:27:56 +10:00
parent d3268aecc2
commit 36e2d02d6e
928 changed files with 5267 additions and 4239 deletions

View file

@ -74,7 +74,6 @@
"type": "xhpast", "type": "xhpast",
"include": "(\\.php$)", "include": "(\\.php$)",
"severity": { "severity": {
"16": "advice",
"34": "error" "34": "error"
}, },
"xhpast.blacklisted.function": { "xhpast.blacklisted.function": {

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Adding mailkeys to macros.\n"; echo pht('Adding mailkeys to macros.')."\n";
$table = new PhabricatorFileImageMacro(); $table = new PhabricatorFileImageMacro();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
@ -8,7 +8,7 @@ $iterator = new LiskMigrationIterator($table);
foreach ($iterator as $macro) { foreach ($iterator as $macro) {
$id = $macro->getID(); $id = $macro->getID();
echo "Populating macro {$id}...\n"; echo pht('Populating macro %d...', $id)."\n";
if (!$macro->getMailKey()) { if (!$macro->getMailKey()) {
queryfx( queryfx(
@ -20,4 +20,4 @@ foreach ($iterator as $macro) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Adding names to Drydock blueprints.\n"; echo pht('Adding names to Drydock blueprints.')."\n";
$table = new DrydockBlueprint(); $table = new DrydockBlueprint();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
@ -8,7 +8,7 @@ $iterator = new LiskMigrationIterator($table);
foreach ($iterator as $blueprint) { foreach ($iterator as $blueprint) {
$id = $blueprint->getID(); $id = $blueprint->getID();
echo "Populating blueprint {$id}...\n"; echo pht('Populating blueprint %d...', $id)."\n";
if (!strlen($blueprint->getBlueprintName())) { if (!strlen($blueprint->getBlueprintName())) {
queryfx( queryfx(
@ -20,4 +20,4 @@ foreach ($iterator as $blueprint) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Adding secretkeys to legalpad document signatures.\n"; echo pht('Adding secretkeys to legalpad document signatures.')."\n";
$table = new LegalpadDocumentSignature(); $table = new LegalpadDocumentSignature();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
@ -8,7 +8,7 @@ $iterator = new LiskMigrationIterator($table);
foreach ($iterator as $sig) { foreach ($iterator as $sig) {
$id = $sig->getID(); $id = $sig->getID();
echo "Populating signature {$id}...\n"; echo pht('Populating signature %d...', $id)."\n";
if (!$sig->getSecretKey()) { if (!$sig->getSecretKey()) {
queryfx( queryfx(
@ -20,4 +20,4 @@ foreach ($iterator as $sig) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -9,7 +9,7 @@ $conn_w = $session_table->establishConnection('w');
foreach (new LiskMigrationIterator($session_table) as $session) { foreach (new LiskMigrationIterator($session_table) as $session) {
$id = $session->getID(); $id = $session->getID();
echo "Migrating session {$id}...\n"; echo pht('Migrating session %d...', $id)."\n";
$old_type = $session->getType(); $old_type = $session->getType();
$new_type = preg_replace('/-.*$/', '', $old_type); $new_type = preg_replace('/-.*$/', '', $old_type);
@ -23,4 +23,4 @@ foreach (new LiskMigrationIterator($session_table) as $session) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,11 +3,11 @@
$table = new PhabricatorCalendarEvent(); $table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Assigning PHIDs to events...\n"; echo pht('Assigning PHIDs to events...')."\n";
foreach (new LiskMigrationIterator($table) as $event) { foreach (new LiskMigrationIterator($table) as $event) {
$id = $event->getID(); $id = $event->getID();
echo "Updating event {$id}...\n"; echo pht('Updating event %d...', $id)."\n";
if ($event->getPHID()) { if ($event->getPHID()) {
continue; continue;
} }
@ -19,4 +19,4 @@ foreach (new LiskMigrationIterator($table) as $event) {
$table->generatePHID(), $table->generatePHID(),
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,7 +3,8 @@
$table = new HeraldCondition(); $table = new HeraldCondition();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Migrating Herald conditions of type Herald rule from IDs to PHIDs...\n"; echo pht(
"Migrating Herald conditions of type Herald rule from IDs to PHIDs...\n");
foreach (new LiskMigrationIterator($table) as $condition) { foreach (new LiskMigrationIterator($table) as $condition) {
if ($condition->getFieldName() != HeraldAdapter::FIELD_RULE) { if ($condition->getFieldName() != HeraldAdapter::FIELD_RULE) {
continue; continue;
@ -14,7 +15,7 @@ foreach (new LiskMigrationIterator($table) as $condition) {
continue; continue;
} }
$id = $condition->getID(); $id = $condition->getID();
echo "Updating condition {$id}...\n"; echo pht('Updating condition %s...', $id)."\n";
$rule = id(new HeraldRuleQuery()) $rule = id(new HeraldRuleQuery())
->setViewer(PhabricatorUser::getOmnipotentUser()) ->setViewer(PhabricatorUser::getOmnipotentUser())
@ -28,4 +29,4 @@ foreach (new LiskMigrationIterator($table) as $condition) {
json_encode($rule->getPHID()), json_encode($rule->getPHID()),
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -5,10 +5,9 @@ $table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'project_profile'); $rows = new LiskRawMigrationIterator($conn_w, 'project_profile');
echo "Migrating project descriptions to custom storage...\n"; echo pht('Migrating project descriptions to custom storage...')."\n";
foreach ($rows as $row) { foreach ($rows as $row) {
$phid = $row['projectPHID']; $phid = $row['projectPHID'];
echo "Migrating {$phid}...\n";
$desc = $row['blurb']; $desc = $row['blurb'];
if (strlen($desc)) { if (strlen($desc)) {
@ -23,4 +22,4 @@ foreach ($rows as $row) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,18 +7,18 @@ $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
array())->serialize(); array())->serialize();
echo "Migrating Differential comment text to modern storage...\n"; echo pht('Migrating Differential comment text to modern storage...')."\n";
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating Differential comment {$id}...\n"; echo pht('Migrating Differential comment %d...', $id)."\n";
if (!strlen($row['content'])) { if (!strlen($row['content'])) {
echo "Comment has no text, continuing.\n"; echo pht('Comment has no text, continuing.')."\n";
continue; continue;
} }
$revision = id(new DifferentialRevision())->load($row['revisionID']); $revision = id(new DifferentialRevision())->load($row['revisionID']);
if (!$revision) { if (!$revision) {
echo "Comment has no valid revision, continuing.\n"; echo pht('Comment has no valid revision, continuing.')."\n";
continue; continue;
} }
@ -68,4 +68,4 @@ foreach ($rows as $row) {
$row['id']); $row['id']);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,14 +7,14 @@ $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
array())->serialize(); array())->serialize();
echo "Migrating Differential comments to modern storage...\n"; echo pht('Migrating Differential comments to modern storage...')."\n";
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating comment {$id}...\n"; echo pht('Migrating comment %d...', $id)."\n";
$revision = id(new DifferentialRevision())->load($row['revisionID']); $revision = id(new DifferentialRevision())->load($row['revisionID']);
if (!$revision) { if (!$revision) {
echo "No revision, continuing.\n"; echo pht('No revision, continuing.')."\n";
continue; continue;
} }
@ -219,4 +219,4 @@ foreach ($rows as $row) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,13 +3,13 @@
$table = new PhabricatorRepositoryVCSPassword(); $table = new PhabricatorRepositoryVCSPassword();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Upgrading password hashing for VCS passwords.\n"; echo pht('Upgrading password hashing for VCS passwords.')."\n";
$best_hasher = PhabricatorPasswordHasher::getBestHasher(); $best_hasher = PhabricatorPasswordHasher::getBestHasher();
foreach (new LiskMigrationIterator($table) as $password) { foreach (new LiskMigrationIterator($table) as $password) {
$id = $password->getID(); $id = $password->getID();
echo "Migrating VCS password {$id}...\n"; echo pht('Migrating VCS password %d...', $id)."\n";
$input_hash = $password->getPasswordHash(); $input_hash = $password->getPasswordHash();
$input_envelope = new PhutilOpaqueEnvelope($input_hash); $input_envelope = new PhutilOpaqueEnvelope($input_hash);
@ -24,4 +24,4 @@ foreach (new LiskMigrationIterator($table) as $password) {
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,12 +3,12 @@
$conn_w = id(new DifferentialRevision())->establishConnection('w'); $conn_w = id(new DifferentialRevision())->establishConnection('w');
$rows = new LiskRawMigrationIterator($conn_w, 'differential_auxiliaryfield'); $rows = new LiskRawMigrationIterator($conn_w, 'differential_auxiliaryfield');
echo "Modernizing Differential auxiliary field storage...\n"; echo pht('Modernizing Differential auxiliary field storage...')."\n";
$table_name = id(new DifferentialCustomFieldStorage())->getTableName(); $table_name = id(new DifferentialCustomFieldStorage())->getTableName();
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating row {$id}...\n"; echo pht('Migrating row %d...', $id)."\n";
queryfx( queryfx(
$conn_w, $conn_w,
'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue) 'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue)
@ -19,4 +19,4 @@ foreach ($rows as $row) {
$row['value']); $row['value']);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -11,10 +11,10 @@ $status_map = array(
$conn_w = id(new ManiphestTask())->establishConnection('w'); $conn_w = id(new ManiphestTask())->establishConnection('w');
echo "Migrating tasks to new status constants...\n"; echo pht('Migrating tasks to new status constants...')."\n";
foreach (new LiskMigrationIterator(new ManiphestTask()) as $task) { foreach (new LiskMigrationIterator(new ManiphestTask()) as $task) {
$id = $task->getID(); $id = $task->getID();
echo "Migrating T{$id}...\n"; echo pht('Migrating %s...', "T{$id}")."\n";
$status = $task->getStatus(); $status = $task->getStatus();
if (isset($status_map[$status])) { if (isset($status_map[$status])) {
@ -27,13 +27,13 @@ foreach (new LiskMigrationIterator(new ManiphestTask()) as $task) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";
echo "Migrating task transactions to new status constants...\n"; echo pht('Migrating task transactions to new status constants...')."\n";
foreach (new LiskMigrationIterator(new ManiphestTransaction()) as $xaction) { foreach (new LiskMigrationIterator(new ManiphestTransaction()) as $xaction) {
$id = $xaction->getID(); $id = $xaction->getID();
echo "Migrating {$id}...\n"; echo pht('Migrating %d...', $id)."\n";
if ($xaction->getTransactionType() == ManiphestTransaction::TYPE_STATUS) { if ($xaction->getTransactionType() == ManiphestTransaction::TYPE_STATUS) {
$old = $xaction->getOldValue(); $old = $xaction->getOldValue();
@ -55,14 +55,14 @@ foreach (new LiskMigrationIterator(new ManiphestTransaction()) as $xaction) {
$id); $id);
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";
$conn_w = id(new PhabricatorSavedQuery())->establishConnection('w'); $conn_w = id(new PhabricatorSavedQuery())->establishConnection('w');
echo "Migrating searches to new status constants...\n"; echo pht('Migrating searches to new status constants...')."\n";
foreach (new LiskMigrationIterator(new PhabricatorSavedQuery()) as $query) { foreach (new LiskMigrationIterator(new PhabricatorSavedQuery()) as $query) {
$id = $query->getID(); $id = $query->getID();
echo "Migrating {$id}...\n"; echo pht('Migrating %d...', $id)."\n";
if ($query->getEngineClassName() !== 'ManiphestTaskSearchEngine') { if ($query->getEngineClassName() !== 'ManiphestTaskSearchEngine') {
continue; continue;
@ -91,4 +91,4 @@ foreach (new LiskMigrationIterator(new PhabricatorSavedQuery()) as $query) {
} }
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -14,14 +14,14 @@ $tables = array(
id(new HarbormasterBuildTarget())->getTableName(), id(new HarbormasterBuildTarget())->getTableName(),
); );
echo "Renaming Harbormaster classes...\n"; echo pht('Renaming Harbormaster classes...')."\n";
$conn_w = id(new HarbormasterBuildStep())->establishConnection('w'); $conn_w = id(new HarbormasterBuildStep())->establishConnection('w');
foreach ($names as $name) { foreach ($names as $name) {
$old = $name; $old = $name;
$new = 'Harbormaster'.$name; $new = 'Harbormaster'.$name;
echo "Renaming {$old} -> {$new}...\n"; echo pht('Renaming %s -> %s...', $old, $new)."\n";
foreach ($tables as $table) { foreach ($tables as $table) {
queryfx( queryfx(
$conn_w, $conn_w,
@ -32,4 +32,4 @@ foreach ($names as $name) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -2,7 +2,7 @@
$conn_w = id(new PhabricatorRepository())->establishConnection('w'); $conn_w = id(new PhabricatorRepository())->establishConnection('w');
echo "Adding transaction log event groups...\n"; echo pht('Adding transaction log event groups...')."\n";
$logs = queryfx_all( $logs = queryfx_all(
$conn_w, $conn_w,
@ -10,7 +10,7 @@ $logs = queryfx_all(
'repository_pushlog'); 'repository_pushlog');
foreach ($logs as $log) { foreach ($logs as $log) {
$id = $log['id']; $id = $log['id'];
echo "Migrating log {$id}...\n"; echo pht('Migrating log %d...', $id)."\n";
if ($log['pushEventPHID']) { if ($log['pushEventPHID']) {
continue; continue;
} }
@ -40,4 +40,4 @@ foreach ($logs as $log) {
$log['transactionKey']); $log['transactionKey']);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,12 +1,10 @@
<?php <?php
echo "Updating users...\n"; echo pht('Updating users...')."\n";
foreach (new LiskMigrationIterator(new PhabricatorUser()) as $user) { foreach (new LiskMigrationIterator(new PhabricatorUser()) as $user) {
$id = $user->getID(); $id = $user->getID();
echo "Updating {$id}...\n"; echo pht('Updating %d...', $id)."\n";
if (strlen($user->getAccountSecret())) { if (strlen($user->getAccountSecret())) {
continue; continue;
@ -20,4 +18,4 @@ foreach (new LiskMigrationIterator(new PhabricatorUser()) as $user) {
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -4,11 +4,11 @@ $pull_table = new ReleephRequest();
$table_name = $pull_table->getTableName(); $table_name = $pull_table->getTableName();
$conn_w = $pull_table->establishConnection('w'); $conn_w = $pull_table->establishConnection('w');
echo "Setting object PHIDs for requests...\n"; echo pht('Setting object PHIDs for requests...')."\n";
foreach (new LiskMigrationIterator($pull_table) as $pull) { foreach (new LiskMigrationIterator($pull_table) as $pull) {
$id = $pull->getID(); $id = $pull->getID();
echo "Migrating pull request {$id}...\n"; echo pht('Migrating pull request %d...', $id)."\n";
if ($pull->getRequestedObjectPHID()) { if ($pull->getRequestedObjectPHID()) {
// We already have a valid PHID, so skip this request. // We already have a valid PHID, so skip this request.
continue; continue;
@ -42,4 +42,4 @@ foreach (new LiskMigrationIterator($pull_table) as $pull) {
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -6,16 +6,16 @@ $conn_w = $project_table->establishConnection('w');
$slug_table_name = id(new PhabricatorProjectSlug())->getTableName(); $slug_table_name = id(new PhabricatorProjectSlug())->getTableName();
$time = time(); $time = time();
echo "Migrating project phriction slugs...\n"; echo pht('Migrating project phriction slugs...')."\n";
foreach (new LiskMigrationIterator($project_table) as $project) { foreach (new LiskMigrationIterator($project_table) as $project) {
$id = $project->getID(); $id = $project->getID();
echo "Migrating project {$id}...\n"; echo pht('Migrating project %d...', $id)."\n";
$phriction_slug = rtrim($project->getPhrictionSlug(), '/'); $phriction_slug = rtrim($project->getPhrictionSlug(), '/');
$slug = id(new PhabricatorProjectSlug()) $slug = id(new PhabricatorProjectSlug())
->loadOneWhere('slug = %s', $phriction_slug); ->loadOneWhere('slug = %s', $phriction_slug);
if ($slug) { if ($slug) {
echo "Already migrated {$id}... Continuing.\n"; echo pht('Already migrated %d... Continuing.', $id)."\n";
continue; continue;
} }
queryfx( queryfx(
@ -27,7 +27,7 @@ foreach (new LiskMigrationIterator($project_table) as $project) {
$phriction_slug, $phriction_slug,
$time, $time,
$time); $time);
echo "Migrated {$id}.\n"; echo pht('Migrated %d.', $id)."\n";
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,11 +1,11 @@
<?php <?php
echo "Updating project datasource tokens...\n"; echo pht('Updating project datasource tokens...')."\n";
foreach (new LiskMigrationIterator(new PhabricatorProject()) as $project) { foreach (new LiskMigrationIterator(new PhabricatorProject()) as $project) {
$name = $project->getName(); $name = $project->getName();
echo "Updating project '{$name}'...\n"; echo pht("Updating project '%d'...", $name)."\n";
$project->updateDatasourceTokens(); $project->updateDatasourceTokens();
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -74,7 +74,7 @@ foreach ($applications as $application) {
/* -( User preferences )--------------------------------------------------- */ /* -( User preferences )--------------------------------------------------- */
echo "Migrating user preferences...\n"; echo pht('Migrating user preferences...')."\n";
$table = new PhabricatorUserPreferences(); $table = new PhabricatorUserPreferences();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
$pref_pinned = PhabricatorUserPreferences::PREFERENCE_APP_PINNED; $pref_pinned = PhabricatorUserPreferences::PREFERENCE_APP_PINNED;
@ -107,7 +107,7 @@ foreach (new LiskMigrationIterator(new PhabricatorUser()) as $user) {
/* -( Dashboard installs )------------------------------------------------- */ /* -( Dashboard installs )------------------------------------------------- */
echo "Migrating dashboard installs...\n"; echo pht('Migrating dashboard installs...')."\n";
$table = new PhabricatorDashboardInstall(); $table = new PhabricatorDashboardInstall();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
@ -126,7 +126,7 @@ foreach (new LiskMigrationIterator($table) as $dashboard_install) {
/* -( Phabricator configuration )------------------------------------------ */ /* -( Phabricator configuration )------------------------------------------ */
$config_key = 'phabricator.uninstalled-applications'; $config_key = 'phabricator.uninstalled-applications';
echo "Migrating `{$config_key}` config...\n"; echo pht('Migrating `%s` config...', $config_key)."\n";
$config = PhabricatorConfigEntry::loadConfigEntry($config_key); $config = PhabricatorConfigEntry::loadConfigEntry($config_key);
$old_config = $config->getValue(); $old_config = $config->getValue();
@ -147,7 +147,7 @@ if ($old_config) {
/* -( phabricator.application-settings )----------------------------------- */ /* -( phabricator.application-settings )----------------------------------- */
$config_key = 'phabricator.application-settings'; $config_key = 'phabricator.application-settings';
echo "Migrating `{$config_key}` config...\n"; echo pht('Migrating `%s` config...', $config_key)."\n";
$config = PhabricatorConfigEntry::loadConfigEntry($config_key); $config = PhabricatorConfigEntry::loadConfigEntry($config_key);
$old_config = $config->getValue(); $old_config = $config->getValue();

View file

@ -7,7 +7,7 @@ $conn_w->openTransaction();
$src_table = 'audit_inlinecomment'; $src_table = 'audit_inlinecomment';
$dst_table = 'audit_transaction_comment'; $dst_table = 'audit_transaction_comment';
echo "Migrating Audit inline comments to new format...\n"; echo pht('Migrating Audit inline comments to new format...')."\n";
$content_source = PhabricatorContentSource::newForSource( $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
@ -17,7 +17,7 @@ $rows = new LiskRawMigrationIterator($conn_w, $src_table);
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating inline #{$id}...\n"; echo pht('Migrating inline #%d...', $id);
if ($row['auditCommentID']) { if ($row['auditCommentID']) {
$xaction_phid = PhabricatorPHID::generateNewPHID( $xaction_phid = PhabricatorPHID::generateNewPHID(
@ -74,4 +74,4 @@ foreach ($rows as $row) {
} }
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,12 +7,12 @@ $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
array())->serialize(); array())->serialize();
echo "Migrating Audit comment text to modern storage...\n"; echo pht('Migrating Audit comment text to modern storage...')."\n";
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating Audit comment {$id}...\n"; echo pht('Migrating Audit comment %d...', $id)."\n";
if (!strlen($row['content'])) { if (!strlen($row['content'])) {
echo "Comment has no text, continuing.\n"; echo pht('Comment has no text, continuing.')."\n";
continue; continue;
} }
@ -58,4 +58,4 @@ foreach ($rows as $row) {
$row['id']); $row['id']);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -18,7 +18,7 @@ $map = array(
'PhabricatorAuthProviderOAuthWordPress' => 'PhabricatorWordPressAuthProvider', 'PhabricatorAuthProviderOAuthWordPress' => 'PhabricatorWordPressAuthProvider',
); );
echo "Migrating auth providers...\n"; echo pht('Migrating auth providers...')."\n";
$table = new PhabricatorAuthProviderConfig(); $table = new PhabricatorAuthProviderConfig();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');

View file

@ -7,10 +7,10 @@ $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
array())->serialize(); array())->serialize();
echo "Migrating Audit comments to modern storage...\n"; echo pht('Migrating Audit comments to modern storage...')."\n";
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating comment {$id}...\n"; echo pht('Migrating comment %d...', $id)."\n";
$comments = queryfx_all( $comments = queryfx_all(
$conn_w, $conn_w,
@ -147,4 +147,4 @@ foreach ($rows as $row) {
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,11 +3,11 @@
$table = new PhabricatorRepositoryAuditRequest(); $table = new PhabricatorRepositoryAuditRequest();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Migrating Audit subscribers to subscriptions...\n"; echo pht('Migrating Audit subscribers to subscriptions...')."\n";
foreach (new LiskMigrationIterator($table) as $request) { foreach (new LiskMigrationIterator($table) as $request) {
$id = $request->getID(); $id = $request->getID();
echo "Migrating auditor {$id}...\n"; echo pht("Migrating audit %d...\n", $id);
if ($request->getAuditStatus() != 'cc') { if ($request->getAuditStatus() != 'cc') {
// This isn't a "subscriber", so skip it. // This isn't a "subscriber", so skip it.
@ -27,4 +27,4 @@ foreach (new LiskMigrationIterator($table) as $request) {
$request->delete(); $request->delete();
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -4,7 +4,7 @@ $table = new PhabricatorFile();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $file) { foreach (new LiskMigrationIterator($table) as $file) {
$id = $file->getID(); $id = $file->getID();
echo "Updating flags for file {$id}...\n"; echo pht('Updating flags for file %d...', $id)."\n";
$meta = $file->getMetadata(); $meta = $file->getMetadata();
if (!idx($meta, 'canCDN')) { if (!idx($meta, 'canCDN')) {

View file

@ -19,12 +19,12 @@ foreach ($rows as $row) {
$sql = array(); $sql = array();
foreach ($cols as $col_phid => $obj_phids) { foreach ($cols as $col_phid => $obj_phids) {
echo "Migrating column '{$col_phid}'...\n"; echo pht("Migrating column '%s'...", $col_phid)."\n";
$column = id(new PhabricatorProjectColumn())->loadOneWhere( $column = id(new PhabricatorProjectColumn())->loadOneWhere(
'phid = %s', 'phid = %s',
$col_phid); $col_phid);
if (!$column) { if (!$column) {
echo "Column '{$col_phid}' does not exist.\n"; echo pht("Column '%s' does not exist.", $col_phid)."\n";
continue; continue;
} }
@ -40,7 +40,7 @@ foreach ($cols as $col_phid => $obj_phids) {
} }
} }
echo "Inserting rows...\n"; echo pht('Inserting rows...')."\n";
foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) { foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) {
queryfx( queryfx(
$conn_w, $conn_w,
@ -50,4 +50,4 @@ foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) {
$chunk); $chunk);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -6,7 +6,7 @@ $conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $column) { foreach (new LiskMigrationIterator($table) as $column) {
$id = $column->getID(); $id = $column->getID();
echo "Adjusting column {$id}...\n"; echo pht('Adjusting column %d...', $id)."\n";
if ($column->getSequence() == 0) { if ($column->getSequence() == 0) {
$properties = $column->getProperties(); $properties = $column->getProperties();
@ -21,4 +21,4 @@ foreach (new LiskMigrationIterator($table) as $column) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,7 +7,10 @@ $table = new PhabricatorFile();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $file) { foreach (new LiskMigrationIterator($table) as $file) {
$id = $file->getID(); $id = $file->getID();
echo "Updating capitalization of canCDN property for file {$id}...\n"; echo pht(
"Updating capitalization of %s property for file %d...\n",
'canCDN',
$id);
$meta = $file->getMetadata(); $meta = $file->getMetadata();
if (isset($meta['cancdn'])) { if (isset($meta['cancdn'])) {

View file

@ -4,7 +4,7 @@ $table = new PhabricatorFileImageMacro();
foreach (new LiskMigrationIterator($table) as $macro) { foreach (new LiskMigrationIterator($table) as $macro) {
$name = $macro->getName(); $name = $macro->getName();
echo "Linking macro '{$name}'...\n"; echo pht("Linking macro '%s'...", $name)."\n";
$editor = new PhabricatorEdgeEditor(); $editor = new PhabricatorEdgeEditor();
@ -16,11 +16,11 @@ foreach (new LiskMigrationIterator($table) as $macro) {
foreach ($phids as $phid) { foreach ($phids as $phid) {
$editor->addEdge( $editor->addEdge(
$macro->getPHID(), $macro->getPHID(),
PhabricatorObjectHasFileEdgeType::EDGECONST , PhabricatorObjectHasFileEdgeType::EDGECONST,
$phid); $phid);
} }
$editor->save(); $editor->save();
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,16 +3,16 @@
$old_key = 'phabricator.show-beta-applications'; $old_key = 'phabricator.show-beta-applications';
$new_key = 'phabricator.show-prototypes'; $new_key = 'phabricator.show-prototypes';
echo "Migrating '{$old_key}' to '{$new_key}'...\n"; echo pht("Migrating '%s' to '%s'...", $old_key, $new_key)."\n";
if (PhabricatorEnv::getEnvConfig($new_key)) { if (PhabricatorEnv::getEnvConfig($new_key)) {
echo "Skipping migration, new data is already set.\n"; echo pht('Skipping migration, new data is already set.')."\n";
return; return;
} }
$old = PhabricatorEnv::getEnvConfigIfExists($old_key); $old = PhabricatorEnv::getEnvConfigIfExists($old_key);
if (!$old) { if (!$old) {
echo "Skipping migration, old data does not exist.\n"; echo pht('Skipping migration, old data does not exist.')."\n";
return; return;
} }
@ -21,4 +21,4 @@ PhabricatorConfigEntry::loadConfigEntry($new_key)
->setValue($old) ->setValue($old)
->save(); ->save();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,7 +3,7 @@
$table = new PhrictionDocument(); $table = new PhrictionDocument();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Populating Phriction policies.\n"; echo pht('Populating Phriction policies.')."\n";
$default_view_policy = PhabricatorPolicies::POLICY_USER; $default_view_policy = PhabricatorPolicies::POLICY_USER;
$default_edit_policy = PhabricatorPolicies::POLICY_USER; $default_edit_policy = PhabricatorPolicies::POLICY_USER;
@ -12,7 +12,7 @@ foreach (new LiskMigrationIterator($table) as $doc) {
$id = $doc->getID(); $id = $doc->getID();
if ($doc->getViewPolicy() && $doc->getEditPolicy()) { if ($doc->getViewPolicy() && $doc->getEditPolicy()) {
echo "Skipping doc $id; already has policy set.\n"; echo pht('Skipping document %d; already has policy set.', $id)."\n";
continue; continue;
} }
@ -38,7 +38,10 @@ foreach (new LiskMigrationIterator($table) as $doc) {
$edit_policy = nonempty($project->getEditPolicy(), $default_edit_policy); $edit_policy = nonempty($project->getEditPolicy(), $default_edit_policy);
$project_name = $project->getName(); $project_name = $project->getName();
echo "Migrating doc $id to project policy $project_name...\n"; echo pht(
"Migrating document %d to project policy %s...\n",
$id,
$project_name);
$doc->setViewPolicy($view_policy); $doc->setViewPolicy($view_policy);
$doc->setEditPolicy($edit_policy); $doc->setEditPolicy($edit_policy);
$doc->save(); $doc->save();
@ -46,10 +49,10 @@ foreach (new LiskMigrationIterator($table) as $doc) {
} }
} }
echo "Migrating doc $id to default install policy...\n"; echo pht('Migrating document %d to default install policy...', $id)."\n";
$doc->setViewPolicy($default_view_policy); $doc->setViewPolicy($default_view_policy);
$doc->setEditPolicy($default_edit_policy); $doc->setEditPolicy($default_edit_policy);
$doc->save(); $doc->save();
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,7 +3,7 @@
$table = new PhrictionDocument(); $table = new PhrictionDocument();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Populating Phriction mailkeys.\n"; echo pht('Populating Phriction mailkeys.')."\n";
foreach (new LiskMigrationIterator($table) as $doc) { foreach (new LiskMigrationIterator($table) as $doc) {
$id = $doc->getID(); $id = $doc->getID();
@ -12,10 +12,10 @@ foreach (new LiskMigrationIterator($table) as $doc) {
if ((strlen($key) == 20) && (strpos($key, "\0") === false)) { if ((strlen($key) == 20) && (strpos($key, "\0") === false)) {
// To be valid, keys must have length 20 and not contain any null bytes. // To be valid, keys must have length 20 and not contain any null bytes.
// See T6487. // See T6487.
echo "Document has valid mailkey.\n"; echo pht('Document has valid mailkey.')."\n";
continue; continue;
} else { } else {
echo "Populating mailkey for document {$id}...\n"; echo pht('Populating mailkey for document %d...', $id)."\n";
$mail_key = Filesystem::readRandomCharacters(20); $mail_key = Filesystem::readRandomCharacters(20);
queryfx( queryfx(
$conn_w, $conn_w,
@ -26,4 +26,4 @@ foreach (new LiskMigrationIterator($table) as $doc) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,18 +3,18 @@
$table = new PhabricatorAuthSSHKey(); $table = new PhabricatorAuthSSHKey();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Updating SSH public key indexes...\n"; echo pht('Updating SSH public key indexes...')."\n";
$keys = new LiskMigrationIterator($table); $keys = new LiskMigrationIterator($table);
foreach ($keys as $key) { foreach ($keys as $key) {
$id = $key->getID(); $id = $key->getID();
echo "Updating key {$id}...\n"; echo pht('Updating key %d...', $id)."\n";
try { try {
$hash = $key->toPublicKey()->getHash(); $hash = $key->toPublicKey()->getHash();
} catch (Exception $ex) { } catch (Exception $ex) {
echo "Key has bad format! Removing key.\n"; echo pht('Key has bad format! Removing key.')."\n";
queryfx( queryfx(
$conn_w, $conn_w,
'DELETE FROM %T WHERE id = %d', 'DELETE FROM %T WHERE id = %d',
@ -30,7 +30,7 @@ foreach ($keys as $key) {
$hash, $hash,
$key->getID()); $key->getID());
if ($collision) { if ($collision) {
echo "Key is a duplicate! Removing key.\n"; echo pht('Key is a duplicate! Removing key.')."\n";
queryfx( queryfx(
$conn_w, $conn_w,
'DELETE FROM %T WHERE id = %d', 'DELETE FROM %T WHERE id = %d',
@ -47,4 +47,4 @@ foreach ($keys as $key) {
$key->getID()); $key->getID());
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,7 +3,7 @@
$table = new PhabricatorRepositoryAuditRequest(); $table = new PhabricatorRepositoryAuditRequest();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Removing duplicate Audit requests...\n"; echo pht('Removing duplicate Audit requests...')."\n";
$seen_audit_map = array(); $seen_audit_map = array();
foreach (new LiskMigrationIterator($table) as $request) { foreach (new LiskMigrationIterator($table) as $request) {
$commit_phid = $request->getCommitPHID(); $commit_phid = $request->getCommitPHID();
@ -19,4 +19,4 @@ foreach (new LiskMigrationIterator($table) as $request) {
$seen_audit_map[$commit_phid][$auditor_phid] = 1; $seen_audit_map[$commit_phid][$auditor_phid] = 1;
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,8 +3,9 @@
$table = new ManiphestTransaction(); $table = new ManiphestTransaction();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Converting Maniphest CC transactions to modern SUBSCRIBER ". echo pht(
"transactions...\n"; "Converting Maniphest CC transactions to modern ".
"subscriber transactions...\n");
foreach (new LiskMigrationIterator($table) as $txn) { foreach (new LiskMigrationIterator($table) as $txn) {
// ManiphestTransaction::TYPE_CCS // ManiphestTransaction::TYPE_CCS
if ($txn->getTransactionType() == 'ccs') { if ($txn->getTransactionType() == 'ccs') {
@ -17,4 +18,4 @@ foreach (new LiskMigrationIterator($table) as $txn) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,8 +3,8 @@
$table = new ManiphestTransaction(); $table = new ManiphestTransaction();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Converting Maniphest project transactions to modern EDGE ". echo pht(
"transactions...\n"; "Converting Maniphest project transactions to modern edge transactions...\n");
$metadata = array( $metadata = array(
'edge:type' => PhabricatorProjectObjectHasProjectEdgeType::EDGECONST, 'edge:type' => PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
); );
@ -31,7 +31,7 @@ foreach (new LiskMigrationIterator($table) as $txn) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";
function mig20141222_build_edge_data(array $project_phids, $task_phid) { function mig20141222_build_edge_data(array $project_phids, $task_phid) {
$edge_data = array(); $edge_data = array();

View file

@ -15,7 +15,7 @@ foreach ($policies as $policy) {
$map[$old_name] = $new_name; $map[$old_name] = $new_name;
} }
echo "Migrating policies...\n"; echo pht('Migrating policies...')."\n";
$table = new PhabricatorPolicy(); $table = new PhabricatorPolicy();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');

View file

@ -1,7 +1,7 @@
<?php <?php
$key = 'metamta.maniphest.public-create-email'; $key = 'metamta.maniphest.public-create-email';
echo "Migrating `$key` to new application email infrastructure...\n"; echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
$value = PhabricatorEnv::getEnvConfigIfExists($key); $value = PhabricatorEnv::getEnvConfigIfExists($key);
$maniphest = new PhabricatorManiphestApplication(); $maniphest = new PhabricatorManiphestApplication();
@ -13,8 +13,8 @@ if ($value) {
->setApplicationPHID($maniphest->getPHID()) ->setApplicationPHID($maniphest->getPHID())
->save(); ->save();
} catch (AphrontDuplicateKeyQueryException $ex) { } catch (AphrontDuplicateKeyQueryException $ex) {
// already migrated? // Already migrated?
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,7 +1,7 @@
<?php <?php
$key = 'metamta.maniphest.default-public-author'; $key = 'metamta.maniphest.default-public-author';
echo "Migrating `$key` to new application email infrastructure...\n"; echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
$value = PhabricatorEnv::getEnvConfigIfExists($key); $value = PhabricatorEnv::getEnvConfigIfExists($key);
$maniphest = new PhabricatorManiphestApplication(); $maniphest = new PhabricatorManiphestApplication();
$config_key = $config_key =
@ -19,4 +19,4 @@ if ($value) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -2,8 +2,10 @@
$key_files = 'metamta.files.public-create-email'; $key_files = 'metamta.files.public-create-email';
$key_paste = 'metamta.paste.public-create-email'; $key_paste = 'metamta.paste.public-create-email';
echo "Migrating `$key_files` and `$key_paste` to new application email ". echo pht(
"infrastructure...\n"; "Migrating `%s` and `%s` to new application email infrastructure...\n",
$key_files,
$key_paste);
$value_files = PhabricatorEnv::getEnvConfigIfExists($key_files); $value_files = PhabricatorEnv::getEnvConfigIfExists($key_files);
$files_app = new PhabricatorFilesApplication(); $files_app = new PhabricatorFilesApplication();
@ -16,7 +18,7 @@ if ($value_files) {
->setApplicationPHID($files_app->getPHID()) ->setApplicationPHID($files_app->getPHID())
->save(); ->save();
} catch (AphrontDuplicateKeyQueryException $ex) { } catch (AphrontDuplicateKeyQueryException $ex) {
// already migrated? // Already migrated?
} }
} }
@ -31,8 +33,8 @@ if ($value_paste) {
->setApplicationPHID($paste_app->getPHID()) ->setApplicationPHID($paste_app->getPHID())
->save(); ->save();
} catch (AphrontDuplicateKeyQueryException $ex) { } catch (AphrontDuplicateKeyQueryException $ex) {
// already migrated? // Already migrated?
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Adding mailkeys to events.\n"; echo pht('Adding %s to events.', 'mailkeys')."\n";
$table = new PhabricatorCalendarEvent(); $table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
@ -8,7 +8,7 @@ $iterator = new LiskMigrationIterator($table);
foreach ($iterator as $event) { foreach ($iterator as $event) {
$id = $event->getID(); $id = $event->getID();
echo "Populating event {$id}...\n"; echo pht('Populating event %d...', $id)."\n";
queryfx( queryfx(
$conn_w, $conn_w,
@ -18,4 +18,4 @@ foreach ($iterator as $event) {
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Retro-naming unnamed events.\n"; echo pht('Retro-naming unnamed events.')."\n";
$table = new PhabricatorCalendarEvent(); $table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
@ -9,7 +9,7 @@ foreach ($iterator as $event) {
$id = $event->getID(); $id = $event->getID();
if (strlen($event->getName()) == 0) { if (strlen($event->getName()) == 0) {
echo "Renaming event {$id}...\n"; echo pht('Renaming event %d...', $id)."\n";
$viewer = PhabricatorUser::getOmnipotentUser(); $viewer = PhabricatorUser::getOmnipotentUser();
// NOTE: This uses PeopleQuery directly, instead of HandleQuery, to avoid // NOTE: This uses PeopleQuery directly, instead of HandleQuery, to avoid
@ -35,4 +35,4 @@ foreach ($iterator as $event) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -15,17 +15,18 @@ if (!$tables) {
return; return;
} }
echo "There are ".count($tables)." tables using the MyISAM engine. These will ". echo pht(
"now be converted to InnoDB. This process may take a few minutes, please ". "There are %d tables using the MyISAM engine. These will now be converted ".
"be patient.\n"; "to InnoDB. This process may take a few minutes, please be patient.\n",
count($tables));
foreach ($tables as $table) { foreach ($tables as $table) {
$name = $table['db'].'.'.$table['tbl']; $name = $table['db'].'.'.$table['tbl'];
echo "Converting {$name}...\n"; echo pht('Converting %s...', $name)."\n";
queryfx( queryfx(
$conn, $conn,
'ALTER TABLE %T.%T ENGINE=InnoDB', 'ALTER TABLE %T.%T ENGINE=InnoDB',
$table['db'], $table['db'],
$table['tbl']); $table['tbl']);
} }
echo "Done!\n"; echo pht('Done!')."\n";

View file

@ -1,13 +1,13 @@
<?php <?php
echo "Indexing username tokens for typeaheads...\n"; echo pht('Indexing username tokens for typeaheads...')."\n";
$table = new PhabricatorUser(); $table = new PhabricatorUser();
$table->openTransaction(); $table->openTransaction();
$table->beginReadLocking(); $table->beginReadLocking();
$users = $table->loadAll(); $users = $table->loadAll();
echo count($users).' users to index'; echo pht('%d users to index', count($users));
foreach ($users as $user) { foreach ($users as $user) {
$user->updateNameTokens(); $user->updateNameTokens();
echo '.'; echo '.';
@ -15,4 +15,4 @@ foreach ($users as $user) {
$table->endReadLocking(); $table->endReadLocking();
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,12 +1,12 @@
<?php <?php
echo "Generating file keys...\n"; echo pht('Generating file keys...')."\n";
$table = new PhabricatorFile(); $table = new PhabricatorFile();
$table->openTransaction(); $table->openTransaction();
$table->beginReadLocking(); $table->beginReadLocking();
$files = $table->loadAllWhere('secretKey IS NULL'); $files = $table->loadAllWhere('secretKey IS NULL');
echo count($files).' files to generate keys for'; echo pht('%d files to generate keys for', count($files));
foreach ($files as $file) { foreach ($files as $file) {
queryfx( queryfx(
$file->establishConnection('w'), $file->establishConnection('w'),
@ -19,4 +19,4 @@ foreach ($files as $file) {
$table->endReadLocking(); $table->endReadLocking();
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Ensuring project names are unique enough...\n"; echo pht('Ensuring project names are unique enough...')."\n";
$table = new PhabricatorProject(); $table = new PhabricatorProject();
$table->openTransaction(); $table->openTransaction();
$table->beginReadLocking(); $table->beginReadLocking();
@ -14,8 +14,8 @@ foreach ($projects as $project) {
$slug = $project->getPhrictionSlug(); $slug = $project->getPhrictionSlug();
if ($slug == '/') { if ($slug == '/') {
$project_id = $project->getID(); $project_id = $project->getID();
echo "Project #{$project_id} doesn't have a meaningful name...\n"; echo pht("Project #%d doesn't have a meaningful name...", $project_id)."\n";
$project->setName(trim('Unnamed Project '.$project->getName())); $project->setName(trim(pht('Unnamed Project %s', $project->getName())));
} }
$slug_map[$slug][] = $project->getID(); $slug_map[$slug][] = $project->getID();
} }
@ -25,15 +25,18 @@ foreach ($slug_map as $slug => $similar) {
if (count($similar) <= 1) { if (count($similar) <= 1) {
continue; continue;
} }
echo "Too many projects are similar to '{$slug}'...\n"; echo pht("Too many projects are similar to '%s'...", $slug)."\n";
foreach (array_slice($similar, 1, null, true) as $key => $project_id) { foreach (array_slice($similar, 1, null, true) as $key => $project_id) {
$project = $projects[$project_id]; $project = $projects[$project_id];
$old_name = $project->getName(); $old_name = $project->getName();
$new_name = rename_project($project, $projects); $new_name = rename_project($project, $projects);
echo "Renaming project #{$project_id} ". echo pht(
"from '{$old_name}' to '{$new_name}'.\n"; "Renaming project #%d from '%s' to '%s'.\n",
$project_id,
$old_name,
$new_name);
$project->setName($new_name); $project->setName($new_name);
} }
} }
@ -47,7 +50,7 @@ while ($update) {
$project->setPhrictionSlug($name); $project->setPhrictionSlug($name);
$slug = $project->getPhrictionSlug(); $slug = $project->getPhrictionSlug();
echo "Updating project #{$id} '{$name}' ({$slug})..."; echo pht("Updating project #%d '%s' (%s)... ", $id, $name, $slug);
try { try {
queryfx( queryfx(
$project->establishConnection('w'), $project->establishConnection('w'),
@ -57,22 +60,23 @@ while ($update) {
$slug, $slug,
$project->getID()); $project->getID());
unset($update[$key]); unset($update[$key]);
echo "okay.\n"; echo pht('OKAY')."\n";
} catch (AphrontDuplicateKeyQueryException $ex) { } catch (AphrontDuplicateKeyQueryException $ex) {
echo "failed, will retry.\n"; echo pht('Failed, will retry.')."\n";
} }
} }
if (count($update) == $size) { if (count($update) == $size) {
throw new Exception( throw new Exception(
pht(
'Failed to make any progress while updating projects. Schema upgrade '. 'Failed to make any progress while updating projects. Schema upgrade '.
'has failed. Go manually fix your project names to be unique (they are '. 'has failed. Go manually fix your project names to be unique '.
'probably ridiculous?) and then try again.'); '(they are probably ridiculous?) and then try again.'));
} }
} }
$table->endReadLocking(); $table->endReadLocking();
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";
/** /**

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Stripping remotes from repository default branches...\n"; echo pht('Stripping remotes from repository default branches...')."\n";
$table = new PhabricatorRepository(); $table = new PhabricatorRepository();
$table->openTransaction(); $table->openTransaction();
@ -30,8 +30,13 @@ foreach ($repos as $repo) {
$id = $repo['id']; $id = $repo['id'];
$name = $repo['name']; $name = $repo['name'];
echo "Updating default branch for repository #{$id} '{$name}' from ". echo pht(
"'{$old}' to '{$new}' to remove the explicit remote.\n"; "Updating default branch for repository #%d '%s' from ".
"'%s' to '%s' to remove the explicit remote.\n",
$id,
$name,
$old,
$new);
queryfx( queryfx(
$conn_w, $conn_w,
'UPDATE %T SET details = %s WHERE id = %d', 'UPDATE %T SET details = %s WHERE id = %d',
@ -41,4 +46,4 @@ foreach ($repos as $repo) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Checking for rules that can be converted to 'personal'. "; echo pht("Checking for rules that can be converted to 'personal'.")."\n";
$table = new HeraldRule(); $table = new HeraldRule();
$table->openTransaction(); $table->openTransaction();
$table->beginReadLocking(); $table->beginReadLocking();
@ -41,11 +41,11 @@ foreach ($rules as $rule) {
$rule->getRuleType(), $rule->getRuleType(),
$rule->getID()); $rule->getID());
echo "Setting rule '".$rule->getName()."' to personal. "; echo pht("Setting rule '%s' to personal.", $rule->getName())."\n";
} }
} }
} }
$table->endReadLocking(); $table->endReadLocking();
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Cleaning up old Herald rule applied rows...\n"; echo pht('Cleaning up old Herald rule applied rows...')."\n";
$table = new HeraldRule(); $table = new HeraldRule();
$table->openTransaction(); $table->openTransaction();
$table->beginReadLocking(); $table->beginReadLocking();
@ -24,7 +24,7 @@ if ($rules) {
mpull($rules, 'getID')); mpull($rules, 'getID'));
} }
echo 'This may take a moment'; echo pht('This may take a moment')."\n";
do { do {
queryfx( queryfx(
$conn_w, $conn_w,
@ -36,4 +36,4 @@ do {
$table->endReadLocking(); $table->endReadLocking();
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Updating old commit authors...\n"; echo pht('Updating old commit authors...')."\n";
$table = new PhabricatorRepositoryCommit(); $table = new PhabricatorRepositoryCommit();
$table->openTransaction(); $table->openTransaction();
@ -31,10 +31,10 @@ foreach ($commits as $commit) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";
echo "Updating old commit mailKeys...\n"; echo pht('Updating old commit %s...', 'mailKeys')."\n";
$table->openTransaction(); $table->openTransaction();
$commits = queryfx_all( $commits = queryfx_all(
@ -55,4 +55,4 @@ foreach ($commits as $commit) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -5,7 +5,7 @@ $table->openTransaction();
$table->beginReadLocking(); $table->beginReadLocking();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo 'Migrating revisions'; echo pht('Migrating revisions')."\n";
do { do {
$revisions = $table->loadAllWhere('branchName IS NULL LIMIT 1000'); $revisions = $table->loadAllWhere('branchName IS NULL LIMIT 1000');
@ -32,4 +32,4 @@ do {
$table->endReadLocking(); $table->endReadLocking();
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo 'Giving image macros PHIDs'; echo pht('Giving image macros PHIDs');
$table = new PhabricatorFileImageMacro(); $table = new PhabricatorFileImageMacro();
$table->openTransaction(); $table->openTransaction();
@ -20,4 +20,4 @@ foreach (new LiskMigrationIterator($table) as $macro) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Migrating Differential unsubscribed users to edges...\n"; echo pht('Migrating Differential unsubscribed users to edges...')."\n";
$table = new DifferentialRevision(); $table = new DifferentialRevision();
$table->openTransaction(); $table->openTransaction();
@ -29,4 +29,4 @@ foreach ($revs as $rev) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Updating channel IDs of previous chatlog events...\n"; echo pht('Updating channel IDs of previous chatlog events...')."\n";
$event_table = new PhabricatorChatLogEvent(); $event_table = new PhabricatorChatLogEvent();
$channel_table = new PhabricatorChatLogChannel(); $channel_table = new PhabricatorChatLogChannel();
@ -61,4 +61,4 @@ $channel_table->endReadLocking();
$event_table->saveTransaction(); $event_table->saveTransaction();
$channel_table->saveTransaction(); $channel_table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,12 +1,12 @@
<?php <?php
echo "Backfilling commit summaries...\n"; echo pht('Backfilling commit summaries...')."\n";
$table = new PhabricatorRepositoryCommit(); $table = new PhabricatorRepositoryCommit();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
$commits = new LiskMigrationIterator($table); $commits = new LiskMigrationIterator($table);
foreach ($commits as $commit) { foreach ($commits as $commit) {
echo 'Filling Commit #'.$commit->getID()."\n"; echo pht('Filling Commit #%d', $commit->getID())."\n";
if (strlen($commit->getSummary())) { if (strlen($commit->getSummary())) {
continue; continue;
@ -28,4 +28,4 @@ foreach ($commits as $commit) {
$commit->getID()); $commit->getID());
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,7 @@
<?php <?php
echo "Migrating data from conpherence transactions to conpherence 'cache'...\n"; echo pht(
"Migrating data from conpherence transactions to conpherence 'cache'...\n");
$table = new ConpherenceThread(); $table = new ConpherenceThread();
$table->openTransaction(); $table->openTransaction();
@ -10,7 +11,7 @@ $participant_table = new ConpherenceParticipant();
$conpherences = new LiskMigrationIterator($table); $conpherences = new LiskMigrationIterator($table);
foreach ($conpherences as $conpherence) { foreach ($conpherences as $conpherence) {
echo 'Migrating conpherence #'.$conpherence->getID()."\n"; echo pht('Migrating conpherence #%d', $conpherence->getID())."\n";
$participants = id(new ConpherenceParticipant()) $participants = id(new ConpherenceParticipant())
->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID()); ->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID());
@ -61,4 +62,4 @@ foreach ($conpherences as $conpherence) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Migrating differential.revisionPHID to edges...\n"; echo pht('Migrating %s to edges...', 'differential.revisionPHID')."\n";
$commit_table = new PhabricatorRepositoryCommit(); $commit_table = new PhabricatorRepositoryCommit();
$data_table = new PhabricatorRepositoryCommitData(); $data_table = new PhabricatorRepositoryCommitData();
$editor = new PhabricatorEdgeEditor(); $editor = new PhabricatorEdgeEditor();
@ -30,4 +30,4 @@ foreach (new LiskMigrationIterator($commit_table) as $commit) {
echo '.'; echo '.';
$editor->save(); $editor->save();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo 'Giving countdowns PHIDs'; echo pht('Giving countdowns PHIDs');
$table = new PhabricatorCountdown(); $table = new PhabricatorCountdown();
$table->openTransaction(); $table->openTransaction();
@ -20,4 +20,4 @@ foreach (new LiskMigrationIterator($table) as $countdown) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Populating Releeph requests with mail keys...\n"; echo pht('Populating Releeph requests with mail keys...')."\n";
$table = new ReleephRequest(); $table = new ReleephRequest();
$table->openTransaction(); $table->openTransaction();
@ -17,11 +17,11 @@ foreach (new LiskMigrationIterator($table) as $rq) {
$rq->getTableName(), $rq->getTableName(),
Filesystem::readRandomCharacters(20), Filesystem::readRandomCharacters(20),
$id); $id);
echo "Generated Key\n"; echo pht('Generated Key')."\n";
} else { } else {
echo "-\n"; echo "-\n";
} }
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,8 +1,8 @@
<?php <?php
echo "Migrating macro authors...\n"; echo pht('Migrating macro authors...')."\n";
foreach (new LiskMigrationIterator(new PhabricatorFileImageMacro()) as $macro) { foreach (new LiskMigrationIterator(new PhabricatorFileImageMacro()) as $macro) {
echo "Macro #".$macro->getID()."\n"; echo pht('Macro #%d', $macro->getID())."\n";
if ($macro->getAuthorPHID()) { if ($macro->getAuthorPHID()) {
// Already have an author; skip it. // Already have an author; skip it.
@ -36,4 +36,4 @@ foreach (new LiskMigrationIterator(new PhabricatorFileImageMacro()) as $macro) {
$macro->getID()); $macro->getID());
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -9,7 +9,7 @@ $conn_w = $table->establishConnection('w');
$xaccount = new PhabricatorExternalAccount(); $xaccount = new PhabricatorExternalAccount();
echo "Migrating OAuth to ExternalAccount...\n"; echo pht('Migrating OAuth to %s...', 'ExternalAccount')."\n";
$domain_map = array( $domain_map = array(
'disqus' => 'disqus.com', 'disqus' => 'disqus.com',
@ -31,18 +31,18 @@ $rows = queryfx_all(
$conn_w, $conn_w,
'SELECT * FROM user_oauthinfo'); 'SELECT * FROM user_oauthinfo');
foreach ($rows as $row) { foreach ($rows as $row) {
echo "Migrating row ID #".$row['id'].".\n"; echo pht('Migrating row ID #%d.', $row['id'])."\n";
$user = id(new PhabricatorUser())->loadOneWhere( $user = id(new PhabricatorUser())->loadOneWhere(
'id = %d', 'id = %d',
$row['userID']); $row['userID']);
if (!$user) { if (!$user) {
echo "Bad user ID!\n"; echo pht('Bad user ID!')."\n";
continue; continue;
} }
$domain = idx($domain_map, $row['oauthProvider']); $domain = idx($domain_map, $row['oauthProvider']);
if (empty($domain)) { if (empty($domain)) {
echo "Unknown OAuth provider!\n"; echo pht('Unknown OAuth provider!')."\n";
continue; continue;
} }
@ -63,4 +63,4 @@ foreach ($rows as $row) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -9,16 +9,16 @@ $conn_w = $table->establishConnection('w');
$xaccount = new PhabricatorExternalAccount(); $xaccount = new PhabricatorExternalAccount();
echo "Migrating LDAP to ExternalAccount...\n"; echo pht('Migrating LDAP to %s...', 'ExternalAccount')."\n";
$rows = queryfx_all($conn_w, 'SELECT * FROM %T', $table_name); $rows = queryfx_all($conn_w, 'SELECT * FROM %T', $table_name);
foreach ($rows as $row) { foreach ($rows as $row) {
echo "Migrating row ID #".$row['id'].".\n"; echo pht('Migrating row ID #%d.', $row['id'])."\n";
$user = id(new PhabricatorUser())->loadOneWhere( $user = id(new PhabricatorUser())->loadOneWhere(
'id = %d', 'id = %d',
$row['userID']); $row['userID']);
if (!$user) { if (!$user) {
echo "Bad user ID!\n"; echo pht('Bad user ID!')."\n";
continue; continue;
} }
@ -38,4 +38,4 @@ foreach ($rows as $row) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -60,11 +60,11 @@ foreach ($config_map as $provider_class => $spec) {
$enabled_default); $enabled_default);
if (!$enabled) { if (!$enabled) {
echo pht("Skipping %s (not enabled).\n", $provider_class); echo pht('Skipping %s (not enabled).', $provider_class)."\n";
// This provider was not previously enabled, so we can skip migrating it. // This provider was not previously enabled, so we can skip migrating it.
continue; continue;
} else { } else {
echo pht("Migrating %s...\n", $provider_class); echo pht('Migrating %s...', $provider_class)."\n";
} }
$registration_key = idx($spec, 'registration'); $registration_key = idx($spec, 'registration');
@ -161,4 +161,4 @@ foreach ($config_map as $provider_class => $spec) {
$config->save(); $config->save();
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,7 +1,9 @@
<?php <?php
echo 'Populating Legalpad Documents with ', echo pht(
"titles, recentContributorPHIDs, and contributorCounts...\n"; "Populating Legalpad Documents with titles, %s, and %s...\n",
'recentContributorPHIDs',
'contributorCounts');
$table = new LegalpadDocument(); $table = new LegalpadDocument();
$table->openTransaction(); $table->openTransaction();
@ -9,14 +11,14 @@ foreach (new LiskMigrationIterator($table) as $document) {
$updated = false; $updated = false;
$id = $document->getID(); $id = $document->getID();
echo "Document {$id}: "; echo pht('Document %d: ', $id);
if (!$document->getTitle()) { if (!$document->getTitle()) {
$document_body = id(new LegalpadDocumentBody()) $document_body = id(new LegalpadDocumentBody())
->loadOneWhere('phid = %s', $document->getDocumentBodyPHID()); ->loadOneWhere('phid = %s', $document->getDocumentBodyPHID());
$title = $document_body->getTitle(); $title = $document_body->getTitle();
$document->setTitle($title); $document->setTitle($title);
$updated = true; $updated = true;
echo "Added title: $title\n"; echo pht('Added title: %s', $title)."\n";
} else { } else {
echo "-\n"; echo "-\n";
} }
@ -29,9 +31,9 @@ foreach (new LiskMigrationIterator($table) as $document) {
$document->getPHID(), $document->getPHID(),
$type); $type);
$document->setRecentContributorPHIDs(array_slice($contributors, 0, 3)); $document->setRecentContributorPHIDs(array_slice($contributors, 0, 3));
echo "Added recent contributor phids.\n"; echo pht('Added recent contributor PHIDs.')."\n";
$document->setContributorCount(count($contributors)); $document->setContributorCount(count($contributors));
echo "Added contributor count.\n"; echo pht('Added contributor count.')."\n";
} }
if (!$updated) { if (!$updated) {
@ -43,4 +45,4 @@ foreach (new LiskMigrationIterator($table) as $document) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo 'Giving pholio images PHIDs'; echo pht('Giving Pholio images PHIDs');
$table = new PholioImage(); $table = new PholioImage();
$table->openTransaction(); $table->openTransaction();
@ -20,4 +20,4 @@ foreach (new LiskMigrationIterator($table) as $image) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -3,18 +3,18 @@
$table = new PhabricatorUser(); $table = new PhabricatorUser();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Trimming trailing whitespace from user real names...\n"; echo pht('Trimming trailing whitespace from user real names...')."\n";
foreach (new LiskMigrationIterator($table) as $user) { foreach (new LiskMigrationIterator($table) as $user) {
$id = $user->getID(); $id = $user->getID();
$real = $user->getRealName(); $real = $user->getRealName();
$trim = rtrim($real); $trim = rtrim($real);
if ($trim == $real) { if ($trim == $real) {
echo "User {$id} is already trim.\n"; echo pht('User %d is already trim.', $id)."\n";
continue; continue;
} }
echo "Trimming user {$id} from '{$real}' to '{$trim}'.\n"; echo pht("Trimming user %d from '%s' to '%s'.", $id, $real, $trim)."\n";
qsprintf( qsprintf(
$conn_w, $conn_w,
'UPDATE %T SET realName = %s WHERE id = %d', 'UPDATE %T SET realName = %s WHERE id = %d',
@ -23,4 +23,4 @@ foreach (new LiskMigrationIterator($table) as $user) {
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Moving Slowvote comments to transactions...\n"; echo pht('Moving Slowvote comments to transactions...')."\n";
$viewer = PhabricatorUser::getOmnipotentUser(); $viewer = PhabricatorUser::getOmnipotentUser();
@ -20,14 +20,14 @@ foreach ($comments as $comment) {
$date_created = $comment['dateCreated']; $date_created = $comment['dateCreated'];
$date_modified = $comment['dateModified']; $date_modified = $comment['dateModified'];
echo "Migrating comment {$id}.\n"; echo pht('Migrating comment %d.', $id)."\n";
$poll = id(new PhabricatorSlowvoteQuery()) $poll = id(new PhabricatorSlowvoteQuery())
->setViewer($viewer) ->setViewer($viewer)
->withIDs(array($poll_id)) ->withIDs(array($poll_id))
->executeOne(); ->executeOne();
if (!$poll) { if (!$poll) {
echo "No poll.\n"; echo pht('No poll.')."\n";
continue; continue;
} }
@ -36,7 +36,7 @@ foreach ($comments as $comment) {
->withPHIDs(array($author_phid)) ->withPHIDs(array($author_phid))
->executeOne(); ->executeOne();
if (!$user) { if (!$user) {
echo "No user.\n"; echo pht('No user.')."\n";
continue; continue;
} }
@ -98,4 +98,4 @@ foreach ($comments as $comment) {
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,18 +1,17 @@
<?php <?php
echo "Archiving projects with no members...\n"; echo pht('Archiving projects with no members...')."\n";
$table = new PhabricatorProject(); $table = new PhabricatorProject();
$table->openTransaction(); $table->openTransaction();
foreach (new LiskMigrationIterator($table) as $project) { foreach (new LiskMigrationIterator($table) as $project) {
$members = PhabricatorEdgeQuery::loadDestinationPHIDs( $members = PhabricatorEdgeQuery::loadDestinationPHIDs(
$project->getPHID(), $project->getPHID(),
PhabricatorProjectProjectHasMemberEdgeType::EDGECONST); PhabricatorProjectProjectHasMemberEdgeType::EDGECONST);
if (count($members)) { if (count($members)) {
echo sprintf( echo pht(
'Project "%s" has %d members; skipping.', 'Project "%s" has %d members; skipping.',
$project->getName(), $project->getName(),
count($members)), "\n"; count($members)), "\n";
@ -20,13 +19,13 @@ foreach (new LiskMigrationIterator($table) as $project) {
} }
if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ARCHIVED) { if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ARCHIVED) {
echo sprintf( echo pht(
'Project "%s" already archived; skipping.', 'Project "%s" already archived; skipping.',
$project->getName()), "\n"; $project->getName()), "\n";
continue; continue;
} }
echo sprintf('Archiving project "%s"...', $project->getName()), "\n"; echo pht('Archiving project "%s"...', $project->getName())."\n";
queryfx( queryfx(
$table->establishConnection('w'), $table->establishConnection('w'),
'UPDATE %T SET status = %s WHERE id = %d', 'UPDATE %T SET status = %s WHERE id = %d',
@ -36,4 +35,4 @@ foreach (new LiskMigrationIterator($table) as $project) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "\nDone.\n"; echo "\n".pht('Done.')."\n";

View file

@ -2,7 +2,7 @@
$map = array(); $map = array();
echo "Merging duplicate answers by authors...\n"; echo pht('Merging duplicate answers by authors...')."\n";
$atable = new PonderAnswer(); $atable = new PonderAnswer();
$conn_w = $atable->establishConnection('w'); $conn_w = $atable->establishConnection('w');
@ -14,14 +14,14 @@ foreach ($answers as $answer) {
$qid = $answer->getQuestionID(); $qid = $answer->getQuestionID();
$author_phid = $answer->getAuthorPHID(); $author_phid = $answer->getAuthorPHID();
echo "Processing answer ID #{$aid}...\n"; echo pht('Processing answer ID #%d...', $aid)."\n";
if (empty($map[$qid][$author_phid])) { if (empty($map[$qid][$author_phid])) {
echo "Answer is unique.\n"; echo pht('Answer is unique.')."\n";
$map[$qid][$author_phid] = $answer; $map[$qid][$author_phid] = $answer;
continue; continue;
} else { } else {
echo "Merging answer.\n"; echo pht('Merging answer.')."\n";
$target = $map[$qid][$author_phid]; $target = $map[$qid][$author_phid];
queryfx( queryfx(
$conn_w, $conn_w,
@ -55,4 +55,4 @@ foreach ($answers as $answer) {
} }
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -6,13 +6,13 @@ $atable = new PonderAnswerTransaction();
$conn_w = $qtable->establishConnection('w'); $conn_w = $qtable->establishConnection('w');
$conn_w->openTransaction(); $conn_w->openTransaction();
echo "Migrating Ponder comments to ApplicationTransactions...\n"; echo pht('Migrating Ponder comments to %s...', 'ApplicationTransactions')."\n";
$rows = new LiskRawMigrationIterator($conn_w, 'ponder_comment'); $rows = new LiskRawMigrationIterator($conn_w, 'ponder_comment');
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Migrating {$id}...\n"; echo pht('Migrating %d...', $id)."\n";
$type = phid_get_type($row['targetPHID']); $type = phid_get_type($row['targetPHID']);
switch ($type) { switch ($type) {
@ -83,4 +83,4 @@ foreach ($rows as $row) {
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -6,13 +6,13 @@ $x_table = new PhabricatorPasteTransaction();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
$conn_w->openTransaction(); $conn_w->openTransaction();
echo "Adding transactions for existing paste objects...\n"; echo pht('Adding transactions for existing paste objects...')."\n";
$rows = new LiskRawMigrationIterator($conn_w, 'pastebin_paste'); $rows = new LiskRawMigrationIterator($conn_w, 'pastebin_paste');
foreach ($rows as $row) { foreach ($rows as $row) {
$id = $row['id']; $id = $row['id'];
echo "Adding transactions for paste id {$id}...\n"; echo pht('Adding transactions for paste id %d...', $id)."\n";
$xaction_phid = PhabricatorPHID::generateNewPHID( $xaction_phid = PhabricatorPHID::generateNewPHID(
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST); PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST);
@ -45,4 +45,4 @@ foreach ($rows as $row) {
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,11 +3,11 @@
$table = new HeraldRule(); $table = new HeraldRule();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Assigning PHIDs to Herald Rules...\n"; echo pht('Assigning PHIDs to Herald Rules...')."\n";
foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) { foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
$id = $rule->getID(); $id = $rule->getID();
echo "Rule {$id}.\n"; echo pht('Rule %d.', $id)."\n";
if ($rule->getPHID()) { if ($rule->getPHID()) {
continue; continue;
@ -21,4 +21,4 @@ foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
$rule->getID()); $rule->getID());
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Populating pastes with mail keys...\n"; echo pht('Populating pastes with mail keys...')."\n";
$table = new PhabricatorPaste(); $table = new PhabricatorPaste();
$table->openTransaction(); $table->openTransaction();
@ -17,11 +17,11 @@ foreach (new LiskMigrationIterator($table) as $paste) {
$paste->getTableName(), $paste->getTableName(),
Filesystem::readRandomCharacters(20), Filesystem::readRandomCharacters(20),
$id); $id);
echo "Generated Key\n"; echo pht('Generated Key')."\n";
} else { } else {
echo "-\n"; echo "-\n";
} }
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Populating Phabricator files with mail keys xactions...\n"; echo pht('Populating Phabricator files with mail keys xactions...')."\n";
$table = new PhabricatorFile(); $table = new PhabricatorFile();
$table_name = $table->getTableName(); $table_name = $table->getTableName();
@ -35,4 +35,4 @@ if ($sql) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -5,12 +5,12 @@ $table_name = id(new ManiphestCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'maniphest_taskauxiliarystorage'); $rows = new LiskRawMigrationIterator($conn_w, 'maniphest_taskauxiliarystorage');
echo "Migrating custom storage for Maniphest fields...\n"; echo pht('Migrating custom storage for Maniphest fields...')."\n";
foreach ($rows as $row) { foreach ($rows as $row) {
$phid = $row['taskPHID']; $phid = $row['taskPHID'];
$name = $row['name']; $name = $row['name'];
echo "Migrating {$phid} / {$name}...\n"; echo pht('Migrating %s / %s...', $phid, $name)."\n";
queryfx( queryfx(
$conn_w, $conn_w,
@ -22,4 +22,4 @@ foreach ($rows as $row) {
$row['value']); $row['value']);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,18 +1,18 @@
<?php <?php
echo "Migrating Maniphest custom field configuration...\n"; echo pht('Migrating Maniphest custom field configuration...')."\n";
$old_key = 'maniphest.custom-fields'; $old_key = 'maniphest.custom-fields';
$new_key = 'maniphest.custom-field-definitions'; $new_key = 'maniphest.custom-field-definitions';
if (PhabricatorEnv::getEnvConfig($new_key)) { if (PhabricatorEnv::getEnvConfig($new_key)) {
echo "Skipping migration, new data is already set.\n"; echo pht('Skipping migration, new data is already set.')."\n";
return; return;
} }
$old = PhabricatorEnv::getEnvConfigIfExists($old_key); $old = PhabricatorEnv::getEnvConfigIfExists($old_key);
if (!$old) { if (!$old) {
echo "Skipping migration, old data does not exist.\n"; echo pht('Skipping migration, old data does not exist.')."\n";
return; return;
} }
@ -63,4 +63,4 @@ PhabricatorConfigEntry::loadConfigEntry($new_key)
->setValue($new) ->setValue($new)
->save(); ->save();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -14,7 +14,7 @@ foreach ($rows as $row) {
$row_id = $row['id']; $row_id = $row['id'];
$task_id = $row['taskID']; $task_id = $row['taskID'];
echo "Migrating row {$row_id} (T{$task_id})...\n"; echo pht('Migrating row %d (%s)...', $row_id, "T{$task_id}")."\n";
$task_row = queryfx_one( $task_row = queryfx_one(
$conn_w, $conn_w,
@ -22,7 +22,7 @@ foreach ($rows as $row) {
$task_table->getTableName(), $task_table->getTableName(),
$task_id); $task_id);
if (!$task_row) { if (!$task_row) {
echo "Skipping, no such task.\n"; echo pht('Skipping, no such task.')."\n";
continue; continue;
} }
@ -145,4 +145,4 @@ foreach ($rows as $row) {
} }
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,7 +7,7 @@ $conn_w->openTransaction();
$src_table = 'differential_inlinecomment'; $src_table = 'differential_inlinecomment';
$dst_table = 'differential_transaction_comment'; $dst_table = 'differential_transaction_comment';
echo "Migrating Differential inline comments to new format...\n"; echo pht('Migrating Differential inline comments to new format...')."\n";
$content_source = PhabricatorContentSource::newForSource( $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
@ -19,7 +19,7 @@ foreach ($rows as $row) {
$revision_id = $row['revisionID']; $revision_id = $row['revisionID'];
echo "Migrating inline #{$id} (D{$revision_id})...\n"; echo pht('Migrating inline #%d (%s)...', $id, "D{$revision_id}")."\n";
$revision_row = queryfx_one( $revision_row = queryfx_one(
$conn_w, $conn_w,
@ -87,4 +87,4 @@ foreach ($rows as $row) {
} }
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -10,7 +10,7 @@ foreach (new LiskMigrationIterator($table) as $revision) {
$revision_id = $revision->getID(); $revision_id = $revision->getID();
$revision_phid = $revision->getPHID(); $revision_phid = $revision->getPHID();
echo "Migrating reviewers for D{$revision_id}...\n"; echo pht('Migrating reviewers for %s...', "D{$revision_id}")."\n";
$reviewer_phids = queryfx_all( $reviewer_phids = queryfx_all(
$conn_w, $conn_w,
@ -48,4 +48,4 @@ foreach (new LiskMigrationIterator($table) as $revision) {
$editor->save(); $editor->save();
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,7 +7,7 @@ $conn_w->openTransaction();
$src_table = 'project_legacytransaction'; $src_table = 'project_legacytransaction';
$dst_table = 'project_transaction'; $dst_table = 'project_transaction';
echo "Migrating Project transactions to new format...\n"; echo pht('Migrating Project transactions to new format...')."\n";
$content_source = PhabricatorContentSource::newForSource( $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_LEGACY, PhabricatorContentSource::SOURCE_LEGACY,
@ -19,7 +19,7 @@ foreach ($rows as $row) {
$project_id = $row['projectID']; $project_id = $row['projectID'];
echo "Migrating transaction #{$id} (Project {$project_id})...\n"; echo pht('Migrating transaction #%d (Project %d)...', $id, $project_id)."\n";
$project_row = queryfx_one( $project_row = queryfx_one(
$conn_w, $conn_w,
@ -89,4 +89,4 @@ foreach ($rows as $row) {
} }
$conn_w->saveTransaction(); $conn_w->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -13,7 +13,7 @@ foreach ($chunk_iter as $chunk) {
foreach ($chunk as $diff) { foreach ($chunk as $diff) {
$id = $diff->getID(); $id = $diff->getID();
echo "Migrating diff ID {$id}...\n"; echo pht('Migrating diff ID %d...', $id)."\n";
$phid = $diff->getPHID(); $phid = $diff->getPHID();
if (strlen($phid)) { if (strlen($phid)) {
@ -44,4 +44,4 @@ foreach ($chunk_iter as $chunk) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -5,7 +5,7 @@ $conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $user) { foreach (new LiskMigrationIterator($table) as $user) {
$username = $user->getUsername(); $username = $user->getUsername();
echo "Migrating {$username}...\n"; echo pht('Migrating %s...', $username)."\n";
if ($user->getIsEmailVerified()) { if ($user->getIsEmailVerified()) {
// Email already verified. // Email already verified.
continue; continue;
@ -30,4 +30,4 @@ foreach (new LiskMigrationIterator($table) as $user) {
$user->getID()); $user->getID());
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -9,7 +9,7 @@ $user_conn = $user_table->establishConnection('r');
foreach (new LiskMigrationIterator($table) as $task) { foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID(); $id = $task->getID();
echo "Checking task T{$id}...\n"; echo pht('Checking task %s...', "T{$id}")."\n";
$owner_phid = $task->getOwnerPHID(); $owner_phid = $task->getOwnerPHID();
if (!$owner_phid && !$task->getOwnerOrdering()) { if (!$owner_phid && !$task->getOwnerOrdering()) {
@ -39,4 +39,4 @@ foreach (new LiskMigrationIterator($table) as $task) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,16 +7,16 @@ $viewer = PhabricatorUser::getOmnipotentUser();
$map = array(); $map = array();
foreach (new LiskMigrationIterator($table) as $repository) { foreach (new LiskMigrationIterator($table) as $repository) {
$callsign = $repository->getCallsign(); $callsign = $repository->getCallsign();
echo "Examining repository {$callsign}...\n"; echo pht('Examining repository %s...', $callsign)."\n";
if ($repository->getCredentialPHID()) { if ($repository->getCredentialPHID()) {
echo "...already has a Credential.\n"; echo pht('...already has a Credential.')."\n";
continue; continue;
} }
$raw_uri = $repository->getRemoteURI(); $raw_uri = $repository->getRemoteURI();
if (!$raw_uri) { if (!$raw_uri) {
echo "...no remote URI.\n"; echo pht('...no remote URI.')."\n";
continue; continue;
} }
@ -50,12 +50,12 @@ foreach (new LiskMigrationIterator($table) as $repository) {
} }
if (!$username || !$secret) { if (!$username || !$secret) {
echo "...no credentials set.\n"; echo pht('...no credentials set.')."\n";
continue; continue;
} }
$map[$type][$username][$secret][] = $repository; $map[$type][$username][$secret][] = $repository;
echo "...will migrate.\n"; echo pht('...will migrate.')."\n";
} }
$passphrase = new PassphraseSecret(); $passphrase = new PassphraseSecret();
@ -76,7 +76,7 @@ foreach ($map as $credential_type => $credential_usernames) {
->setMaximumGlyphs(128) ->setMaximumGlyphs(128)
->truncateString($signs)); ->truncateString($signs));
echo "Creating: {$name}...\n"; echo pht('Creating: %s...', $name)."\n";
$secret = id(new PassphraseSecret()) $secret = id(new PassphraseSecret())
->setSecretData($secret_plaintext) ->setSecretData($secret_plaintext)
@ -136,4 +136,4 @@ foreach ($map as $credential_type => $credential_usernames) {
$table->saveTransaction(); $table->saveTransaction();
$passphrase->saveTransaction(); $passphrase->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -9,7 +9,7 @@ $viewer = PhabricatorUser::getOmnipotentUser();
foreach (new LiskMigrationIterator($table) as $plan) { foreach (new LiskMigrationIterator($table) as $plan) {
$planname = $plan->getName(); $planname = $plan->getName();
echo "Migrating steps in {$planname}...\n"; echo pht('Migrating steps in %s...', $planname)."\n";
$rows = queryfx_all( $rows = queryfx_all(
$conn_w, $conn_w,
@ -23,10 +23,10 @@ foreach (new LiskMigrationIterator($table) as $plan) {
$id = $row['id']; $id = $row['id'];
$existing = $row['sequence']; $existing = $row['sequence'];
if ($existing != 0) { if ($existing != 0) {
echo " - {$id} (already migrated)...\n"; echo " - ".pht('%d (already migrated)...', $id)."\n";
continue; continue;
} }
echo " - {$id} to position {$sequence}...\n"; echo " - ".pht('%d to position %s...', $id, $sequence)."\n";
queryfx( queryfx(
$conn_w, $conn_w,
'UPDATE harbormaster_buildstep '. 'UPDATE harbormaster_buildstep '.
@ -38,4 +38,4 @@ foreach (new LiskMigrationIterator($table) as $plan) {
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -3,12 +3,12 @@
$table = new PhabricatorRepositoryPushLog(); $table = new PhabricatorRepositoryPushLog();
$conn_w = $table->establishConnection('w'); $conn_w = $table->establishConnection('w');
echo "Assigning PHIDs to push logs...\n"; echo pht('Assigning PHIDs to push logs...')."\n";
$logs = new LiskMigrationIterator($table); $logs = new LiskMigrationIterator($table);
foreach ($logs as $log) { foreach ($logs as $log) {
$id = $log->getID(); $id = $log->getID();
echo "Updating {$id}...\n"; echo pht('Updating %s...', $id)."\n";
queryfx( queryfx(
$conn_w, $conn_w,
'UPDATE %T SET phid = %s WHERE id = %d', 'UPDATE %T SET phid = %s WHERE id = %d',
@ -17,4 +17,4 @@ foreach ($logs as $log) {
$id); $id);
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
echo "Migrating user emails...\n"; echo pht('Migrating user emails...')."\n";
$table = new PhabricatorUser(); $table = new PhabricatorUser();
$table->openTransaction(); $table->openTransaction();
@ -19,7 +19,7 @@ foreach ($emails as $phid => $email) {
// NOTE: Grandfather all existing email in as primary / verified. We generate // NOTE: Grandfather all existing email in as primary / verified. We generate
// verification codes because they are used for password resets, etc. // verification codes because they are used for password resets, etc.
echo "Migrating '{$phid}'...\n"; echo pht("Migrating '%s'...", $phid)."\n";
queryfx( queryfx(
$conn, $conn,
'INSERT INTO %T (userPHID, address, verificationCode, isVerified, isPrimary) 'INSERT INTO %T (userPHID, address, verificationCode, isVerified, isPrimary)
@ -31,4 +31,4 @@ foreach ($emails as $phid => $email) {
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,13 +1,13 @@
<?php <?php
echo "Populating Legalpad Documents with mail keys...\n"; echo pht('Populating Legalpad Documents with mail keys...')."\n";
$table = new LegalpadDocument(); $table = new LegalpadDocument();
$table->openTransaction(); $table->openTransaction();
foreach (new LiskMigrationIterator($table) as $document) { foreach (new LiskMigrationIterator($table) as $document) {
$id = $document->getID(); $id = $document->getID();
echo "Document {$id}: "; echo pht('Document %s: ', $id);
if (!$document->getMailKey()) { if (!$document->getMailKey()) {
queryfx( queryfx(
$document->establishConnection('w'), $document->establishConnection('w'),
@ -15,11 +15,11 @@ foreach (new LiskMigrationIterator($table) as $document) {
$document->getTableName(), $document->getTableName(),
Filesystem::readRandomCharacters(20), Filesystem::readRandomCharacters(20),
$id); $id);
echo "Generated Key\n"; echo pht('Generated Key')."\n";
} else { } else {
echo "-\n"; echo "-\n";
} }
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,6 +1,6 @@
<?php <?php
// Switch PhabricatorWorkerActiveTask from autoincrement IDs to counter IDs. // Switch PhabricatorWorkerActiveTask from auto-increment IDs to counter IDs.
// Set the initial counter ID to be larger than any known task ID. // Set the initial counter ID to be larger than any known task ID.
$active_table = new PhabricatorWorkerActiveTask(); $active_table = new PhabricatorWorkerActiveTask();

View file

@ -1,12 +1,12 @@
<?php <?php
echo "Migrating differential dependencies to edges...\n"; echo pht('Migrating differential dependencies to edges...')."\n";
$table = new DifferentialRevision(); $table = new DifferentialRevision();
$table->openTransaction(); $table->openTransaction();
foreach (new LiskMigrationIterator($table) as $rev) { foreach (new LiskMigrationIterator($table) as $rev) {
$id = $rev->getID(); $id = $rev->getID();
echo "Revision {$id}: "; echo pht('Revision %d: ', $id);
$deps = $rev->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST); $deps = $rev->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST);
if (!$deps) { if (!$deps) {
@ -22,8 +22,8 @@ foreach (new LiskMigrationIterator($table) as $rev) {
$dep); $dep);
} }
$editor->save(); $editor->save();
echo "OKAY\n"; echo pht('OKAY')."\n";
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,12 +1,12 @@
<?php <?php
echo "Migrating task dependencies to edges...\n"; echo pht('Migrating task dependencies to edges...')."\n";
$table = new ManiphestTask(); $table = new ManiphestTask();
$table->openTransaction(); $table->openTransaction();
foreach (new LiskMigrationIterator($table) as $task) { foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID(); $id = $task->getID();
echo "Task {$id}: "; echo pht('Task %d: ', $id);
$deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST); $deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
if (!$deps) { if (!$deps) {
@ -22,8 +22,8 @@ foreach (new LiskMigrationIterator($table) as $task) {
$dep); $dep);
} }
$editor->save(); $editor->save();
echo "OKAY\n"; echo pht('OKAY')."\n";
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,12 +1,12 @@
<?php <?php
echo "Migrating task revisions to edges...\n"; echo pht('Migrating task revisions to edges...')."\n";
$table = new ManiphestTask(); $table = new ManiphestTask();
$table->establishConnection('w'); $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $task) { foreach (new LiskMigrationIterator($table) as $task) {
$id = $task->getID(); $id = $task->getID();
echo "Task {$id}: "; echo pht('Task %d: ', $id);
$revs = $task->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST); $revs = $task->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST);
if (!$revs) { if (!$revs) {
@ -22,7 +22,7 @@ foreach (new LiskMigrationIterator($table) as $task) {
$rev); $rev);
} }
$editor->save(); $editor->save();
echo "OKAY\n"; echo pht('OKAY')."\n";
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,12 +1,12 @@
<?php <?php
echo "Migrating project members to edges...\n"; echo pht('Migrating project members to edges...')."\n";
$table = new PhabricatorProject(); $table = new PhabricatorProject();
$table->establishConnection('w'); $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $proj) { foreach (new LiskMigrationIterator($table) as $proj) {
$id = $proj->getID(); $id = $proj->getID();
echo "Project {$id}: "; echo pht('Project %d: ', $id);
$members = queryfx_all( $members = queryfx_all(
$proj->establishConnection('w'), $proj->establishConnection('w'),
@ -29,7 +29,7 @@ foreach (new LiskMigrationIterator($table) as $proj) {
$user_phid); $user_phid);
} }
$editor->save(); $editor->save();
echo "OKAY\n"; echo pht('OKAY')."\n";
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -1,13 +1,13 @@
<?php <?php
echo "Populating Questions with mail keys...\n"; echo pht('Populating Questions with mail keys...')."\n";
$table = new PonderQuestion(); $table = new PonderQuestion();
$table->openTransaction(); $table->openTransaction();
foreach (new LiskMigrationIterator($table) as $question) { foreach (new LiskMigrationIterator($table) as $question) {
$id = $question->getID(); $id = $question->getID();
echo "Question {$id}: "; echo pht('Question %d: ', $id);
if (!$question->getMailKey()) { if (!$question->getMailKey()) {
queryfx( queryfx(
$question->establishConnection('w'), $question->establishConnection('w'),
@ -15,11 +15,11 @@ foreach (new LiskMigrationIterator($table) as $question) {
$question->getTableName(), $question->getTableName(),
Filesystem::readRandomCharacters(20), Filesystem::readRandomCharacters(20),
$id); $id);
echo "Generated Key\n"; echo pht('Generated Key')."\n";
} else { } else {
echo "-\n"; echo "-\n";
} }
} }
$table->saveTransaction(); $table->saveTransaction();
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -5,7 +5,7 @@ $root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/__init_script__.php'; require_once $root.'/scripts/__init_script__.php';
$args = new PhutilArgumentParser($argv); $args = new PhutilArgumentParser($argv);
$args->setTagline('manage host directory'); $args->setTagline(pht('manage host directory'));
$args->setSynopsis(<<<EOSYNOPSIS $args->setSynopsis(<<<EOSYNOPSIS
**almanac** __commmand__ [__options__] **almanac** __commmand__ [__options__]
Manage Almanac stuff. NEW AND EXPERIMENTAL. Manage Almanac stuff. NEW AND EXPERIMENTAL.

View file

@ -5,8 +5,10 @@ $root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/__init_script__.php'; require_once $root.'/scripts/__init_script__.php';
if ($argc !== 2 || $argv[1] === '--help') { if ($argc !== 2 || $argv[1] === '--help') {
echo "Usage: aphrontpath.php <url>\n"; echo pht('Usage: %s', 'aphrontpath.php <url>')."\n";
echo "Purpose: Print controller which will process passed <url>.\n"; echo pht(
"Purpose: Print controller which will process passed %s.\n",
'<url>');
exit(1); exit(1);
} }

View file

@ -5,7 +5,7 @@ $root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/__init_script__.php'; require_once $root.'/scripts/__init_script__.php';
$args = new PhutilArgumentParser($argv); $args = new PhutilArgumentParser($argv);
$args->setTagline('manage cache'); $args->setTagline(pht('manage cache'));
$args->setSynopsis(<<<EOSYNOPSIS $args->setSynopsis(<<<EOSYNOPSIS
**cache** __command__ [__options__] **cache** __command__ [__options__]
Manage Phabricator caches. Manage Phabricator caches.

View file

@ -4,7 +4,7 @@
require_once dirname(dirname(__FILE__)).'/__init_script__.php'; require_once dirname(dirname(__FILE__)).'/__init_script__.php';
$args = new PhutilArgumentParser($argv); $args = new PhutilArgumentParser($argv);
$args->setTagline('regenerate CSS sprite sheets'); $args->setTagline(pht('regenerate CSS sprite sheets'));
$args->setSynopsis(<<<EOHELP $args->setSynopsis(<<<EOHELP
**sprites** **sprites**
Rebuild CSS sprite sheets. Rebuild CSS sprite sheets.
@ -16,7 +16,7 @@ $args->parse(
array( array(
array( array(
'name' => 'force', 'name' => 'force',
'help' => 'Force regeneration even if sources have not changed.', 'help' => pht('Force regeneration even if sources have not changed.'),
), ),
)); ));
@ -39,8 +39,10 @@ list($err) = exec_manual('optipng');
if ($err) { if ($err) {
$have_optipng = false; $have_optipng = false;
echo phutil_console_format( echo phutil_console_format(
"<bg:red> WARNING </bg> `optipng` not found in PATH.\n". "<bg:red> %s </bg> %s\n%s\n",
"Sprites will not be optimized! Install `optipng`!\n"); pht('WARNING'),
pht('`%s` not found in PATH.', 'optipng'),
pht('Sprites will not be optimized! Install `%s`!', 'optipng'));
} else { } else {
$have_optipng = true; $have_optipng = true;
} }
@ -75,10 +77,10 @@ foreach ($sheets as $name => $sheet) {
$sheet->generateImage($full_path, $scale); $sheet->generateImage($full_path, $scale);
if ($have_optipng) { if ($have_optipng) {
echo "Optimizing...\n"; echo pht('Optimizing...')."\n";
phutil_passthru('optipng -o7 -clobber %s', $full_path); phutil_passthru('optipng -o7 -clobber %s', $full_path);
} }
} }
} }
echo "Done.\n"; echo pht('Done.')."\n";

View file

@ -7,7 +7,7 @@ require_once $root.'/scripts/__init_script__.php';
PhabricatorDaemonManagementWorkflow::requireExtensions(); PhabricatorDaemonManagementWorkflow::requireExtensions();
$args = new PhutilArgumentParser($argv); $args = new PhutilArgumentParser($argv);
$args->setTagline('manage daemons'); $args->setTagline(pht('manage daemons'));
$args->setSynopsis(<<<EOSYNOPSIS $args->setSynopsis(<<<EOSYNOPSIS
**phd** __command__ [__options__] **phd** __command__ [__options__]
Manage Phabricator daemons. Manage Phabricator daemons.

Some files were not shown because too many files have changed in this diff Show more