コード例 #1
0
 function deleteDB()
 {
     $dbw =& wfGetDB(DB_WRITE);
     //remove any MVD index items:
     MV_Index::remove_by_stream_id($this->id);
     //remove any digest
     $dbw->delete('mv_clipview_digest', array('stream_id' => $this->id));
     //remove any images
     $dbw->delete('mv_stream_images', array('stream_id' => $this->id));
     //remove pointers to any files:
     $dbw->delete('mv_stream_files', array('stream_id' => $this->id));
 }
コード例 #2
0
function mvDeleteHook(&$article, &$user, &$reason)
{
    global $mvgIP;
    //print 'mvDeleteHook'."\n";
    //only need to update the mvd index when in the mvd namespace:
    if ($article->mTitle->getNamespace() == MV_NS_MVD) {
        //remove article with that title:
        MV_Index::remove_by_wiki_title($article->mTitle->getDBkey());
    } else {
        if ($article->mTitle->getNamespace() == MV_NS_STREAM) {
            MV_Index::remove_by_stream_id($article->mvTitle->mvStream->getStreamId());
            $article->mvTitle->mvStream->deleteDB();
        }
    }
    return true;
    // always return true, in order not to stop MW's hook processing!
}