- /**
- * Bulk-check the pagelinks and page arrays for existence info.
- * @param Title $fromtitle
- * @deprecated
- */
- function preFill( &$fromtitle ) {
- global $wgAntiLockFlags;
- $fname = 'LinkCache::preFill';
- wfProfileIn( $fname );
-
- $this->suspend();
- $id = $fromtitle->getArticleID();
- $this->resume();
-
- if( $id == 0 ) {
- wfDebug( "$fname - got id 0 for title '" . $fromtitle->getPrefixedDBkey() . "'\n" );
- wfProfileOut( $fname );
- return;
- }
-
- if ( $this->mForUpdate ) {
- $db =& wfGetDB( DB_MASTER );
- if ( !( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) ) {
- $options = 'FOR UPDATE';
- } else {
- $options = '';
- }
- } else {
- $db =& wfGetDB( DB_SLAVE );
- $options = '';
- }
-
- $page = $db->tableName( 'page' );
- $pagelinks = $db->tableName( 'pagelinks' );
-
- $sql = "SELECT page_id,pl_namespace,pl_title
- FROM $pagelinks
- LEFT JOIN $page
- ON pl_namespace=page_namespace AND pl_title=page_title
- WHERE pl_from=$id $options";
- $res = $db->query( $sql, $fname );
- while( $s = $db->fetchObject( $res ) ) {
- $title = Title::makeTitle( $s->pl_namespace, $s->pl_title );
- if( $s->page_id ) {
- $this->addGoodLinkObj( $s->page_id, $title );
- } else {
- $this->addBadLinkObj( $title );
- }
- }
- $this->mPreFilled = true;
-
- wfProfileOut( $fname );
- }
-