* @param int $len Text's length
* @param int $redir Whether the page is a redirect
* @param int $revision Latest revision's ID
- * @param int $model Latest revision's content model ID
+ * @param string|null $model Latest revision's content model ID
*/
public function addGoodLinkObj( $id, $title, $len = -1, $redir = null,
- $revision = 0, $model = 0
+ $revision = 0, $model = null
) {
$dbkey = $title->getPrefixedDBkey();
$this->mGoodLinks[$dbkey] = (int)$id;
'length' => (int)$len,
'redirect' => (int)$redir,
'revision' => (int)$revision,
- 'model' => (int)$model
+ 'model' => $model ? (string)$model : null,
);
}
* @return int
*/
public function addLinkObj( $nt ) {
- global $wgAntiLockFlags, $wgContentHandlerUseDB;
-
- wfProfileIn( __METHOD__ );
+ global $wgContentHandlerUseDB;
$key = $nt->getPrefixedDBkey();
if ( $this->isBadLink( $key ) || $nt->isExternal() ) {
- wfProfileOut( __METHOD__ );
return 0;
}
$id = $this->getGoodLinkID( $key );
if ( $id != 0 ) {
- wfProfileOut( __METHOD__ );
return $id;
}
if ( $key === '' ) {
- wfProfileOut( __METHOD__ );
return 0;
}
# Some fields heavily used for linking...
if ( $this->mForUpdate ) {
$db = wfGetDB( DB_MASTER );
- if ( !( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) ) {
- $options = array( 'FOR UPDATE' );
- } else {
- $options = array();
- }
} else {
$db = wfGetDB( DB_SLAVE );
- $options = array();
}
$f = array( 'page_id', 'page_len', 'page_is_redirect', 'page_latest' );
$s = $db->selectRow( 'page', $f,
array( 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey() ),
- __METHOD__, $options );
+ __METHOD__ );
# Set fields...
if ( $s !== false ) {
$this->addGoodLinkObjFromRow( $nt, $s );
$id = 0;
}
- wfProfileOut( __METHOD__ );
-
return $id;
}