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
这个提交包含在:
Joshua Spence 2015-05-22 17:27:56 +10:00
父节点 d3268aecc2
当前提交 36e2d02d6e
共有 928 个文件被更改,包括 5267 次插入4239 次删除

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -3,7 +3,8 @@
$table = new HeraldCondition();
$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) {
if ($condition->getFieldName() != HeraldAdapter::FIELD_RULE) {
continue;
@ -14,7 +15,7 @@ foreach (new LiskMigrationIterator($table) as $condition) {
continue;
}
$id = $condition->getID();
echo "Updating condition {$id}...\n";
echo pht('Updating condition %s...', $id)."\n";
$rule = id(new HeraldRuleQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
@ -28,4 +29,4 @@ foreach (new LiskMigrationIterator($table) as $condition) {
json_encode($rule->getPHID()),
$id);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -5,10 +5,9 @@ $table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName();
$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) {
$phid = $row['projectPHID'];
echo "Migrating {$phid}...\n";
$desc = $row['blurb'];
if (strlen($desc)) {
@ -23,4 +22,4 @@ foreach ($rows as $row) {
}
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

@ -3,13 +3,13 @@
$table = new PhabricatorRepositoryVCSPassword();
$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();
foreach (new LiskMigrationIterator($table) as $password) {
$id = $password->getID();
echo "Migrating VCS password {$id}...\n";
echo pht('Migrating VCS password %d...', $id)."\n";
$input_hash = $password->getPasswordHash();
$input_envelope = new PhutilOpaqueEnvelope($input_hash);
@ -24,4 +24,4 @@ foreach (new LiskMigrationIterator($table) as $password) {
$id);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -3,12 +3,12 @@
$conn_w = id(new DifferentialRevision())->establishConnection('w');
$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();
foreach ($rows as $row) {
$id = $row['id'];
echo "Migrating row {$id}...\n";
echo pht('Migrating row %d...', $id)."\n";
queryfx(
$conn_w,
'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue)
@ -19,4 +19,4 @@ foreach ($rows as $row) {
$row['value']);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -11,10 +11,10 @@ $status_map = array(
$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) {
$id = $task->getID();
echo "Migrating T{$id}...\n";
echo pht('Migrating %s...', "T{$id}")."\n";
$status = $task->getStatus();
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) {
$id = $xaction->getID();
echo "Migrating {$id}...\n";
echo pht('Migrating %d...', $id)."\n";
if ($xaction->getTransactionType() == ManiphestTransaction::TYPE_STATUS) {
$old = $xaction->getOldValue();
@ -55,14 +55,14 @@ foreach (new LiskMigrationIterator(new ManiphestTransaction()) as $xaction) {
$id);
}
}
echo "Done.\n";
echo pht('Done.')."\n";
$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) {
$id = $query->getID();
echo "Migrating {$id}...\n";
echo pht('Migrating %d...', $id)."\n";
if ($query->getEngineClassName() !== 'ManiphestTaskSearchEngine') {
continue;
@ -91,4 +91,4 @@ foreach (new LiskMigrationIterator(new PhabricatorSavedQuery()) as $query) {
}
}
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

@ -2,7 +2,7 @@
$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(
$conn_w,
@ -10,7 +10,7 @@ $logs = queryfx_all(
'repository_pushlog');
foreach ($logs as $log) {
$id = $log['id'];
echo "Migrating log {$id}...\n";
echo pht('Migrating log %d...', $id)."\n";
if ($log['pushEventPHID']) {
continue;
}
@ -40,4 +40,4 @@ foreach ($logs as $log) {
$log['transactionKey']);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

@ -4,11 +4,11 @@ $pull_table = new ReleephRequest();
$table_name = $pull_table->getTableName();
$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) {
$id = $pull->getID();
echo "Migrating pull request {$id}...\n";
echo pht('Migrating pull request %d...', $id)."\n";
if ($pull->getRequestedObjectPHID()) {
// We already have a valid PHID, so skip this request.
continue;
@ -42,4 +42,4 @@ foreach (new LiskMigrationIterator($pull_table) as $pull) {
$id);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -7,7 +7,7 @@ $conn_w->openTransaction();
$src_table = 'audit_inlinecomment';
$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(
PhabricatorContentSource::SOURCE_LEGACY,
@ -17,7 +17,7 @@ $rows = new LiskRawMigrationIterator($conn_w, $src_table);
foreach ($rows as $row) {
$id = $row['id'];
echo "Migrating inline #{$id}...\n";
echo pht('Migrating inline #%d...', $id);
if ($row['auditCommentID']) {
$xaction_phid = PhabricatorPHID::generateNewPHID(
@ -74,4 +74,4 @@ foreach ($rows as $row) {
}
$conn_w->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -19,12 +19,12 @@ foreach ($rows as $row) {
$sql = array();
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(
'phid = %s',
$col_phid);
if (!$column) {
echo "Column '{$col_phid}' does not exist.\n";
echo pht("Column '%s' does not exist.", $col_phid)."\n";
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) {
queryfx(
$conn_w,
@ -50,4 +50,4 @@ foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) {
$chunk);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

@ -7,7 +7,10 @@ $table = new PhabricatorFile();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $file) {
$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();
if (isset($meta['cancdn'])) {

查看文件

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

查看文件

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

查看文件

@ -3,7 +3,7 @@
$table = new PhrictionDocument();
$conn_w = $table->establishConnection('w');
echo "Populating Phriction policies.\n";
echo pht('Populating Phriction policies.')."\n";
$default_view_policy = PhabricatorPolicies::POLICY_USER;
$default_edit_policy = PhabricatorPolicies::POLICY_USER;
@ -12,7 +12,7 @@ foreach (new LiskMigrationIterator($table) as $doc) {
$id = $doc->getID();
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;
}
@ -38,7 +38,10 @@ foreach (new LiskMigrationIterator($table) as $doc) {
$edit_policy = nonempty($project->getEditPolicy(), $default_edit_policy);
$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->setEditPolicy($edit_policy);
$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->setEditPolicy($default_edit_policy);
$doc->save();
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -3,8 +3,8 @@
$table = new ManiphestTransaction();
$conn_w = $table->establishConnection('w');
echo "Converting Maniphest project transactions to modern EDGE ".
"transactions...\n";
echo pht(
"Converting Maniphest project transactions to modern edge transactions...\n");
$metadata = array(
'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) {
$edge_data = array();

查看文件

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

查看文件

@ -1,7 +1,7 @@
<?php
$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);
$maniphest = new PhabricatorManiphestApplication();
@ -13,8 +13,8 @@ if ($value) {
->setApplicationPHID($maniphest->getPHID())
->save();
} catch (AphrontDuplicateKeyQueryException $ex) {
// already migrated?
// Already migrated?
}
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -1,7 +1,7 @@
<?php
$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);
$maniphest = new PhabricatorManiphestApplication();
$config_key =
@ -19,4 +19,4 @@ if ($value) {
}
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

@ -1,6 +1,6 @@
<?php
echo "Retro-naming unnamed events.\n";
echo pht('Retro-naming unnamed events.')."\n";
$table = new PhabricatorCalendarEvent();
$conn_w = $table->establishConnection('w');
@ -9,7 +9,7 @@ foreach ($iterator as $event) {
$id = $event->getID();
if (strlen($event->getName()) == 0) {
echo "Renaming event {$id}...\n";
echo pht('Renaming event %d...', $id)."\n";
$viewer = PhabricatorUser::getOmnipotentUser();
// 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";

查看文件

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

查看文件

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

查看文件

@ -1,12 +1,12 @@
<?php
echo "Generating file keys...\n";
echo pht('Generating file keys...')."\n";
$table = new PhabricatorFile();
$table->openTransaction();
$table->beginReadLocking();
$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) {
queryfx(
$file->establishConnection('w'),
@ -19,4 +19,4 @@ foreach ($files as $file) {
$table->endReadLocking();
$table->saveTransaction();
echo "\nDone.\n";
echo "\n".pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

@ -1,6 +1,6 @@
<?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->openTransaction();
$table->beginReadLocking();
@ -41,11 +41,11 @@ foreach ($rules as $rule) {
$rule->getRuleType(),
$rule->getID());
echo "Setting rule '".$rule->getName()."' to personal. ";
echo pht("Setting rule '%s' to personal.", $rule->getName())."\n";
}
}
}
$table->endReadLocking();
$table->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -9,16 +9,16 @@ $conn_w = $table->establishConnection('w');
$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);
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(
'id = %d',
$row['userID']);
if (!$user) {
echo "Bad user ID!\n";
echo pht('Bad user ID!')."\n";
continue;
}
@ -38,4 +38,4 @@ foreach ($rows as $row) {
}
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -60,11 +60,11 @@ foreach ($config_map as $provider_class => $spec) {
$enabled_default);
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.
continue;
} else {
echo pht("Migrating %s...\n", $provider_class);
echo pht('Migrating %s...', $provider_class)."\n";
}
$registration_key = idx($spec, 'registration');
@ -161,4 +161,4 @@ foreach ($config_map as $provider_class => $spec) {
$config->save();
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -6,13 +6,13 @@ $atable = new PonderAnswerTransaction();
$conn_w = $qtable->establishConnection('w');
$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');
foreach ($rows as $row) {
$id = $row['id'];
echo "Migrating {$id}...\n";
echo pht('Migrating %d...', $id)."\n";
$type = phid_get_type($row['targetPHID']);
switch ($type) {
@ -83,4 +83,4 @@ foreach ($rows as $row) {
$conn_w->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -6,13 +6,13 @@ $x_table = new PhabricatorPasteTransaction();
$conn_w = $table->establishConnection('w');
$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');
foreach ($rows as $row) {
$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(
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST);
@ -45,4 +45,4 @@ foreach ($rows as $row) {
$conn_w->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -3,11 +3,11 @@
$table = new HeraldRule();
$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) {
$id = $rule->getID();
echo "Rule {$id}.\n";
echo pht('Rule %d.', $id)."\n";
if ($rule->getPHID()) {
continue;
@ -21,4 +21,4 @@ foreach (new LiskMigrationIterator(new HeraldRule()) as $rule) {
$rule->getID());
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

@ -5,12 +5,12 @@ $table_name = id(new ManiphestCustomFieldStorage())->getTableName();
$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) {
$phid = $row['taskPHID'];
$name = $row['name'];
echo "Migrating {$phid} / {$name}...\n";
echo pht('Migrating %s / %s...', $phid, $name)."\n";
queryfx(
$conn_w,
@ -22,4 +22,4 @@ foreach ($rows as $row) {
$row['value']);
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

@ -14,7 +14,7 @@ foreach ($rows as $row) {
$row_id = $row['id'];
$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(
$conn_w,
@ -22,7 +22,7 @@ foreach ($rows as $row) {
$task_table->getTableName(),
$task_id);
if (!$task_row) {
echo "Skipping, no such task.\n";
echo pht('Skipping, no such task.')."\n";
continue;
}
@ -145,4 +145,4 @@ foreach ($rows as $row) {
}
$conn_w->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -7,7 +7,7 @@ $conn_w->openTransaction();
$src_table = 'differential_inlinecomment';
$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(
PhabricatorContentSource::SOURCE_LEGACY,
@ -19,7 +19,7 @@ foreach ($rows as $row) {
$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(
$conn_w,
@ -87,4 +87,4 @@ foreach ($rows as $row) {
}
$conn_w->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -10,7 +10,7 @@ foreach (new LiskMigrationIterator($table) as $revision) {
$revision_id = $revision->getID();
$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(
$conn_w,
@ -48,4 +48,4 @@ foreach (new LiskMigrationIterator($table) as $revision) {
$editor->save();
}
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

@ -7,7 +7,7 @@ $conn_w->openTransaction();
$src_table = 'project_legacytransaction';
$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(
PhabricatorContentSource::SOURCE_LEGACY,
@ -19,7 +19,7 @@ foreach ($rows as $row) {
$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(
$conn_w,
@ -89,4 +89,4 @@ foreach ($rows as $row) {
}
$conn_w->saveTransaction();
echo "Done.\n";
echo pht('Done.')."\n";

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -1,6 +1,6 @@
<?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.
$active_table = new PhabricatorWorkerActiveTask();

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

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

查看文件

@ -11,7 +11,7 @@ function init_phabricator_script() {
@include_once 'libphutil/scripts/__init_script__.php';
if (!@constant('__LIBPHUTIL__')) {
echo "ERROR: Unable to load libphutil. Update your PHP 'include_path' to ".
"include the parent directory of libphutil/.\n";
"include the parent directory of libphutil/.\n";
exit(1);
}

查看文件

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

查看文件

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

查看文件

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

查看文件

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

某些文件未显示,因为此 diff 中更改的文件太多 显示更多