本文整理匯總了PHP中PhabricatorProject::endReadLocking方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorProject::endReadLocking方法的具體用法?PHP PhabricatorProject::endReadLocking怎麽用?PHP PhabricatorProject::endReadLocking使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorProject
的用法示例。
在下文中一共展示了PhabricatorProject::endReadLocking方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pht
$project->setPhrictionSlug($name);
$slug = $project->getPhrictionSlug();
echo pht("Updating project #%d '%s' (%s)... ", $id, $name, $slug);
try {
queryfx($project->establishConnection('w'), 'UPDATE %T SET name = %s, phrictionSlug = %s WHERE id = %d', $project->getTableName(), $name, $slug, $project->getID());
unset($update[$key]);
echo pht('OKAY') . "\n";
} catch (AphrontDuplicateKeyQueryException $ex) {
echo pht('Failed, will retry.') . "\n";
}
}
if (count($update) == $size) {
throw new Exception(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 pht('Done.') . "\n";
/**
* Rename the project so that it has a unique slug, by appending (2), (3), etc.
* to its name.
*/
function rename_project($project, $projects)
{
$suffix = 2;
while (true) {
$new_name = $project->getName() . ' (' . $suffix . ')';
$project->setPhrictionSlug($new_name);
$new_slug = $project->getPhrictionSlug();
$okay = true;
foreach ($projects as $other) {