X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=d5eff4610501e365510eb94411b2aedf9f5b63e3;hb=22bf875d152751f5590508a1f44976c9db30cb44;hp=fe989b5f556d4c992624c58ce91ccdbd917129f9;hpb=e876a53696669963e596d035fe88aefca303aafb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index fe989b5f55..d5eff46105 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -265,6 +265,7 @@ class Title { if ( is_object( $text ) ) { throw new InvalidArgumentException( '$text must be a string.' ); } elseif ( !is_string( $text ) ) { + wfDebugLog( 'T76305', wfGetAllCallers( 5 ) ); wfWarn( __METHOD__ . ': $text must be a string. This will throw an InvalidArgumentException in future.', 2 ); } @@ -3308,6 +3309,14 @@ class Title { $this->mIsBigDeletion = null; } + public static function clearCaches() { + $linkCache = LinkCache::singleton(); + $linkCache->clear(); + + $titleCache = self::getTitleCache(); + $titleCache->clear(); + } + /** * Capitalize a text string for a title if it belongs to a namespace that capitalizes * @@ -4235,10 +4244,12 @@ class Title { * If you want to know if a title can be meaningfully viewed, you should * probably call the isKnown() method instead. * + * @param int $flags An optional bit field; may be Title::GAID_FOR_UPDATE to check + * from master/for update * @return bool */ - public function exists() { - $exists = $this->getArticleID() != 0; + public function exists( $flags = 0 ) { + $exists = $this->getArticleID( $flags ) != 0; Hooks::run( 'TitleExists', array( $this, &$exists ) ); return $exists; }