示例#1
0
文件: Hooks.php 项目: k-hasan-19/wiki
function wrMovePage(&$oldTitle)
{
    // remove watchers from old title
    StructuredData::removeAllWatchers($oldTitle);
    if ($oldTitle->getNamespace() == NS_PLACE) {
        StructuredData::requestIndex($oldTitle);
        // moves are indexed separately, but force place to be re-indexed before indexing wlh
        $dbw =& wfGetDB(DB_MASTER);
        $ts = wfTimestampNow();
        $sql = 'insert ignore into index_request (ir_page_id, ir_timestamp) ' . '(select pl_from,' . $dbw->addQuotes($ts) . ' from pagelinks where' . ' pl_namespace=' . $dbw->addQuotes($oldTitle->getNamespace()) . ' and pl_title=' . $dbw->addQuotes($oldTitle->getDBkey()) . ')';
        $dbw->query($sql);
    }
    return true;
}