當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorProject::endReadLocking方法代碼示例

本文整理匯總了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) {
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:31,代碼來源:090.forceuniqueprojectnames.php


注:本文中的PhabricatorProject::endReadLocking方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。