Ejemplo n.º 1
0
 /**
  * Hook function for PageContentSaveComplete
  * Clear local spam blacklist caches on page save.
  *
  * @param Page $wikiPage
  * @param User     $user
  * @param Content  $content
  * @param string   $summary
  * @param bool     $isMinor
  * @param bool     $isWatch
  * @param string   $section
  * @param int      $flags
  * @param int      $revision
  * @param Status   $status
  * @param int      $baseRevId
  *
  * @return bool
  */
 static function pageSaveContent(Page $wikiPage, User $user, Content $content, $summary, $isMinor, $isWatch, $section, $flags, $revision, Status $status, $baseRevId)
 {
     if (!BaseBlacklist::isLocalSource($wikiPage->getTitle())) {
         return true;
     }
     global $wgMemc, $wgDBname;
     // This sucks because every Blacklist needs to be cleared
     foreach (BaseBlacklist::getBlacklistTypes() as $type => $class) {
         $wgMemc->delete("{$wgDBname}:{$type}_blacklist_regexes");
     }
     return true;
 }
	/**
	 * Hook function for ArticleSaveComplete
	 * Clear local spam blacklist caches on page save.
	 *
	 * @param $article Article
	 * @param $user User
	 * @param $text string
	 * @param $summary string
	 * @param $isminor
	 * @param $iswatch
	 * @param $section
	 * @return bool
	 */
	static function articleSave( &$article, &$user, $text, $summary, $isminor, $iswatch, $section ) {
		if( !BaseBlacklist::isLocalSource( $article->getTitle() ) ) {
			return false;
		}
		global $wgMemc, $wgDBname;

		// This sucks because every Blacklist needs to be cleared
		foreach ( BaseBlacklist::getBlacklistTypes() as $type => $class ) {
			$wgMemc->delete( "$wgDBname:{$type}_blacklist_regexes" );
		}
	}
Ejemplo n.º 3
0
 /**
  * Hook function for PageContentSaveComplete
  * Clear local spam blacklist caches on page save.
  *
  * @param Page $wikiPage
  * @param User     $user
  * @param Content  $content
  * @param string   $summary
  * @param bool     $isMinor
  * @param bool     $isWatch
  * @param string   $section
  * @param int      $flags
  * @param int      $revision
  * @param Status   $status
  * @param int      $baseRevId
  *
  * @return bool
  */
 static function pageSaveContent(Page $wikiPage, User $user, Content $content, $summary, $isMinor, $isWatch, $section, $flags, $revision, Status $status, $baseRevId)
 {
     if (!BaseBlacklist::isLocalSource($wikiPage->getTitle())) {
         return true;
     }
     // This sucks because every Blacklist needs to be cleared
     foreach (BaseBlacklist::getBlacklistTypes() as $type => $class) {
         $blacklist = BaseBlacklist::getInstance($type);
         $blacklist->clearCache();
     }
     return true;
 }