本文整理汇总了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) {