本文整理汇总了PHP中LinksUpdate::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP LinksUpdate::getTitle方法的具体用法?PHP LinksUpdate::getTitle怎么用?PHP LinksUpdate::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinksUpdate
的用法示例。
在下文中一共展示了LinksUpdate::getTitle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onLinksUpdateComplete
/**
* Invalidates the cache for a campaign when any of its dependents are edited. The 'dependents'
* are tracked by entries in the templatelinks table, which are inserted by using the
* PageContentSaveComplete hook.
*
* This is usually run via the Job Queue mechanism.
*/
public static function onLinksUpdateComplete(LinksUpdate &$linksupdate)
{
if (!$linksupdate->getTitle()->inNamespace(NS_CAMPAIGN)) {
return true;
}
$campaign = new UploadWizardCampaign($linksupdate->getTitle());
$campaign->invalidateCache();
return true;
}
示例2: onLinksUpdateComplete
/**
* @param LinksUpdate $linksUpdate
* @return bool return true to continue hooks flow
*/
public static function onLinksUpdateComplete($linksUpdate)
{
wfProfileIn(__METHOD__);
$images = $linksUpdate->getImages();
$articleId = $linksUpdate->getTitle()->getArticleID();
if (count($images) === 1) {
$images = array_keys($images);
self::buildIndex($articleId, $images);
wfProfileOut(__METHOD__);
return true;
}
$article = new Article($linksUpdate->getTitle());
self::buildAndGetIndex($article);
wfProfileOut(__METHOD__);
return true;
}
示例3: onLinksUpdateComplete
/**
* Insert assessment records after page is saved
* @param LinksUpdate $linksUpdate
*/
public static function onLinksUpdateComplete(&$linksUpdate)
{
$pOut = $linksUpdate->getParserOutput();
if ($pOut->getExtensionData('ext-pageassessment-assessmentdata') !== null) {
$assessmentData = $pOut->getExtensionData('ext-pageassessment-assessmentdata');
} else {
// Even if there is no assessment data, we still need to run doUpdates
// in case any assessment data was deleted from the page.
$assessmentData = [];
}
$title = $linksUpdate->getTitle();
// In most cases $title will be a talk page, but we want to associate the
// assessment data with the subject page.
$subjectTitle = $title->getSubjectPage();
PageAssessmentsBody::doUpdates($subjectTitle, $assessmentData);
}
示例4: onLinksUpdate
/**
* LinksUpdate hook handler - saves a count of h2 elements that occur in the WikiPage
* @see https://www.mediawiki.org/wiki/Manual:Hooks/LinksUpdate
*
* @param LinksUpdate $lu
* @return bool
*/
public static function onLinksUpdate(LinksUpdate $lu)
{
if ($lu->getTitle()->isTalkPage()) {
$parserOutput = $lu->getParserOutput();
$sections = $parserOutput->getSections();
$numTopics = 0;
foreach ($sections as $section) {
if ($section['toclevel'] == 1) {
$numTopics += 1;
}
}
if ($numTopics) {
$lu->mProperties['page_top_level_section_count'] = $numTopics;
}
}
return true;
}
示例5: onLinksUpdateConstructed
/**
* After article was edited and parsed, in case of layer page, save layers to database
*
* @since 3.0
*
* @param LinksUpdate &$linksUpdate
*
* @return true
*/
public static function onLinksUpdateConstructed(LinksUpdate &$linksUpdate)
{
$title = $linksUpdate->getTitle();
self::processLayersStoreCandidate($linksUpdate->mParserOutput, $title);
return true;
}
示例6: onLinksUpdate
/**
* Modifies ParserOutput
* @param \LinksUpdate $linksUpdate
* @return bool
*/
public static function onLinksUpdate(\LinksUpdate $linksUpdate)
{
$linksUpdate->mParserOutput = (new \FlagsController())->modifyParserOutputWithFlags($linksUpdate->getParserOutput(), $linksUpdate->getTitle()->getArticleID());
return true;
}
示例7: preventCategorization
public static function preventCategorization(LinksUpdate $updater)
{
$handle = new MessageHandle($updater->getTitle());
if ($handle->isMessageNamespace() && !$handle->isDoc()) {
$updater->mCategories = array();
}
return true;
}