/**
  * Stores the previously parsed WWSD in the database. This function is a hook for
  * 'ArticleSaveComplete.'
  *
  * This function also deletes wwsd and cache entries from the db
  * that are no longer needed.
  *
  * @param Article $article
  * @param User $user
  * @param string $text
  * @return boolean true
  */
 public static function articleSavedHook(&$article, &$user, $text)
 {
     if ($article->getTitle()->getNamespace() != SMW_NS_WEB_SERVICE) {
         return true;
     }
     //deal with case where user replaces a WWSD with a completely empty article
     if (!self::$mOldWebserviceRemembered) {
         $wwsd = WebService::newFromID($article->getID());
         self::rememberWWSD($wwsd);
     }
     global $smwgDIIP;
     require_once $smwgDIIP . "/specials/WebServices/SMW_WSTriplifier.php";
     // check if an wwsd was change and delete the old wwsd and the
     // related cache entries from the db
     if (WebServiceManager::detectModifiedWWSD(self::$mNewWebService)) {
         WebServiceCache::removeWS(self::$mOldWebservice->getArticleID());
         self::$mOldWebservice->removeFromDB();
         //deal with triplification
         if (self::$mOldWebservice) {
             $articles = WSStorage::getDatabase()->getWSArticles(self::$mOldWebservice->getArticleID(), new SMWRequestOptions());
             WSTriplifier::getInstance()->removeWS(self::$mOldWebservice->getArticleID(), $articles);
         }
     }
     //handle triplification processing
     if (self::$mNewWebService) {
         self::$mNewWebService->store();
         WSTriplifier::getInstance()->addWSAsDataSource($article->getID());
         smwf_ws_confirmWWSD(self::$mNewWebService->getArticleID());
     }
     self::$mNewWebService = null;
     self::$mOldWebservice = null;
     return true;
 }