/** * When an article is fully saved, we want to update the doclinks for that * article in our doclinks table. Only if it's in the documentation * namepsace, however. * * @param WikiPage $article * @param User $user * @param string $text * @param string $summary * @param boolean $minor * @param boolean $watch * @param $sectionanchor * @param integer $flags * @param Revision $revision * @param Status $status * @param integer $baseRevId * * @deprecated Replace with PageContentSaveComplete hook * */ public static function onArticleSaveComplete(&$article, &$user, $text, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, $baseRevId) { $title = $article->getTitle(); $realArticle = Article::newFromWikiPage($article, RequestContext::getMain()); // Update doc links PonyDocsExtension::updateOrDeleteDocLinks("update", $realArticle, $text); if (!preg_match('/^' . PONYDOCS_DOCUMENTATION_NAMESPACE_NAME . ':/i', $title->__toString(), $matches)) { return TRUE; } // Okay, article is in doc namespace // Now we need to remove any pdf books for this topic. // Since the person is editing the article, it's safe to say that the // version and manual can be fetched from the classes and not do any // manipulation on the article itself. $productName = PonyDocsProduct::GetSelectedProduct(); $product = PonyDocsProduct::GetProductByShortName($productName); $version = PonyDocsProductVersion::GetSelectedVersion($productName); $manual = PonyDocsProductManual::GetCurrentManual($productName, $title); if ($manual != null) { // Then we are in the documentation namespace, but we're not part of // manual. // Clear any PDF for this manual PonyDocsPdfBook::removeCachedFile($productName, $manual->getShortName(), $version); } // Clear all TOC cache entries for each version. // Dangerous. Only set the flag if you know that you should be skipping this processing. // Currently used for branch/inherit. if ($manual && !PonyDocsExtension::isSpeedProcessingEnabled()) { // Clear any TOC cache entries this article may be related to. $topic = new PonyDocsTopic($realArticle); $manVersionList = $topic->getProductVersions(); foreach ($manVersionList as $version) { PonyDocsTOC::clearTOCCache($manual, $version, $product); PonyDocsProductVersion::clearNAVCache($version); } } PonyDocsExtension::clearArticleCategoryCache($realArticle); // if this is product versions or manuals page, clear navigation cache if (preg_match(PONYDOCS_PRODUCTVERSION_TITLE_REGEX, $title->__toString(), $matches) || preg_match(PONYDOCS_PRODUCTMANUAL_TITLE_REGEX, $title->__toString(), $matches)) { // reload to get updated version list PonyDocsProductVersion::LoadVersionsForProduct($productName, true); $prodVersionList = PonyDocsProductVersion::GetVersions($productName); foreach ($prodVersionList as $version) { PonyDocsProductVersion::clearNAVCache($version); } } return true; }