wfProfileIn( __METHOD__ . '-checkPageExistence' );
if( !in_array( 'known', $options ) and !in_array( 'broken', $options ) ) {
if( $target->getNamespace() == NS_SPECIAL ) {
- if( SpecialPage::exists( $target->getDbKey() ) ) {
+ if( SpecialPage::exists( $target->getDBKey() ) ) {
$options []= 'known';
} else {
$options []= 'broken';
if( $nt->getText() != wfStripIllegalFilenameChars( $nt->getText() ) ) {
$errors[] = array('imageinvalidfilename');
}
- if( !File::checkExtensionCompatibility( $file, $nt->getDbKey() ) ) {
+ if( !File::checkExtensionCompatibility( $file, $nt->getDBKey() ) ) {
$errors[] = array('imagetypemismatch');
}
}
* AND pl_title='Foo' AND pl_namespace=0
* LIMIT 11 ORDER BY pl_from
*/
- $db = $this->getDb();
+ $db = $this->getDB();
$this->addTables(array('page', $this->bl_table));
$this->addWhere("{$this->bl_from}=page_id");
if(is_null($resultPageSet))
else
$this->addFields($resultPageSet->getPageTableFields());
$this->addFields('page_is_redirect');
- $this->addWhereFld($this->bl_title, $this->rootTitle->getDbKey());
+ $this->addWhereFld($this->bl_title, $this->rootTitle->getDBKey());
if($this->hasNS)
$this->addWhereFld($this->bl_ns, $this->rootTitle->getNamespace());
$this->addWhereFld('page_namespace', $this->params['namespace']);
* AND (pl_title='Foo' AND pl_namespace=0) OR (pl_title='Bar' AND pl_namespace=1)
* LIMIT 11 ORDER BY pl_namespace, pl_title, pl_from
*/
- $db = $this->getDb();
+ $db = $this->getDB();
$this->addTables(array('page', $this->bl_table));
$this->addWhere("{$this->bl_from}=page_id");
if(is_null($resultPageSet))
$this->dieUsage("Invalid continue param. You should pass the " .
"original value returned by the previous query", "_badcontinue");
$clfrom = intval($cont[0]);
- $clto = $this->getDb()->strencode($this->titleToKey($cont[1]));
+ $clto = $this->getDB()->strencode($this->titleToKey($cont[1]));
$this->addWhere("cl_from > $clfrom OR ".
"(cl_from = $clfrom AND ".
"cl_to >= '$clto')");
foreach($categories as $c)
{
$t = $titles[$c];
- $cattitles[$c] = $t->getDbKey();
+ $cattitles[$c] = $t->getDBKey();
}
$this->addTables('category');
else
$protocol = null;
- $db = $this->getDb();
+ $db = $this->getDB();
$this->addTables(array('page','externallinks')); // must be in this order for 'USE INDEX'
$this->addOption('USE INDEX', 'el_index');
$this->addWhere('page_id=el_from');
$this->dieUsage("Invalid continue param. You should pass the " .
"original value returned by the previous query", "_badcontinue");
$ilfrom = intval($cont[0]);
- $ilto = $this->getDb()->strencode($this->titleToKey($cont[1]));
+ $ilto = $this->getDB()->strencode($this->titleToKey($cont[1]));
$this->addWhere("il_from > $ilfrom OR ".
"(il_from = $ilfrom AND ".
"il_to >= '$ilto')");
$others = array();
foreach ($missing as $title)
if ($title->getNamespace() == NS_IMAGE)
- $images[] = $title->getDbKey();
+ $images[] = $title->getDBKey();
else
$others[] = $title;
$result->setIndexedTagName($pageInfo['protection'], 'pr');
}
}
- if($fld_talkid && isset($talkids[$title->getNamespace()][$title->getDbKey()]))
- $pageInfo['talkid'] = $talkids[$title->getNamespace()][$title->getDbKey()];
- if($fld_subjectid && isset($subjectids[$title->getNamespace()][$title->getDbKey()]))
- $pageInfo['subjectid'] = $subjectids[$title->getNamespace()][$title->getDbKey()];
+ if($fld_talkid && isset($talkids[$title->getNamespace()][$title->getDBKey()]))
+ $pageInfo['talkid'] = $talkids[$title->getNamespace()][$title->getDBKey()];
+ if($fld_subjectid && isset($subjectids[$title->getNamespace()][$title->getDBKey()]))
+ $pageInfo['subjectid'] = $subjectids[$title->getNamespace()][$title->getDBKey()];
if($fld_url) {
$pageInfo['fullurl'] = $title->getFullURL();
$pageInfo['editurl'] = $title->getFullURL('action=edit');
$res['query']['pages'][$pageid]['protection'] = array();
$result->setIndexedTagName($res['query']['pages'][$pageid]['protection'], 'pr');
}
- if($fld_talkid && isset($talkids[$title->getNamespace()][$title->getDbKey()]))
- $res['query']['pages'][$pageid]['talkid'] = $talkids[$title->getNamespace()][$title->getDbKey()];
- if($fld_subjectid && isset($subjectids[$title->getNamespace()][$title->getDbKey()]))
- $res['query']['pages'][$pageid]['subjectid'] = $subjectids[$title->getNamespace()][$title->getDbKey()];
+ if($fld_talkid && isset($talkids[$title->getNamespace()][$title->getDBKey()]))
+ $res['query']['pages'][$pageid]['talkid'] = $talkids[$title->getNamespace()][$title->getDBKey()];
+ if($fld_subjectid && isset($subjectids[$title->getNamespace()][$title->getDBKey()]))
+ $res['query']['pages'][$pageid]['subjectid'] = $subjectids[$title->getNamespace()][$title->getDBKey()];
if($fld_url) {
$res['query']['pages'][$pageid]['fullurl'] = $title->getFullURL();
$res['query']['pages'][$pageid]['editurl'] = $title->getFullURL('action=edit');
$this->dieUsage("Invalid continue param. You should pass the " .
"original value returned by the previous query", "_badcontinue");
$llfrom = intval($cont[0]);
- $lllang = $this->getDb()->strencode($cont[1]);
+ $lllang = $this->getDB()->strencode($cont[1]);
$this->addWhere("ll_from > $llfrom OR ".
"(ll_from = $llfrom AND ".
"ll_lang >= '$lllang')");
"original value returned by the previous query", "_badcontinue");
$plfrom = intval($cont[0]);
$plns = intval($cont[1]);
- $pltitle = $this->getDb()->strencode($this->titleToKey($cont[2]));
+ $pltitle = $this->getDB()->strencode($this->titleToKey($cont[2]));
$this->addWhere("{$this->prefix}_from > $plfrom OR ".
"({$this->prefix}_from = $plfrom AND ".
"({$this->prefix}_namespace > $plns OR ".
// LinkBatch refuses these, but we need them anyway
if(!array_key_exists($obj->getNamespace(), $lb->data))
$lb->data[$obj->getNamespace()] = array();
- $lb->data[$obj->getNamespace()][$obj->getDbKey()] = 1;
+ $lb->data[$obj->getNamespace()][$obj->getDBKey()] = 1;
}
}
- $where = $lb->constructSet('rc', $this->getDb());
+ $where = $lb->constructSet('rc', $this->getDB());
if($where != '')
$this->addWhere($where);
}
$this->addWhereFld('rev_deleted', 0);
// We only want pages by the specified users.
if($this->prefixMode)
- $this->addWhere("rev_user_text LIKE '" . $this->getDb()->escapeLike($this->userprefix) . "%'");
+ $this->addWhere("rev_user_text LIKE '" . $this->getDB()->escapeLike($this->userprefix) . "%'");
else
$this->addWhereFld('rev_user_text', $this->usernames);
// ... and in the specified timeframe.
if(!count($goodNames))
return $retval;
- $db = $this->getDb();
+ $db = $this->getDB();
$this->addTables('user', 'u1');
$this->addFields('u1.user_name');
$this->addWhereFld('u1.user_name', $goodNames);
$this->file = $file;
$this->target = $target;
$this->oldHash = $this->file->repo->getHashPath( $this->file->getName() );
- $this->newHash = $this->file->repo->getHashPath( $this->target->getDbKey() );
+ $this->newHash = $this->file->repo->getHashPath( $this->target->getDBKey() );
$this->oldName = $this->file->getName();
$this->newName = $this->file->repo->getNameFromTitle( $this->target );
$this->oldRel = $this->oldHash . $this->oldName;
'page_id', //Field
array( //Conditions
'page_namespace' => $title->getNamespace(),
- 'page_title' => $title->getDbKey(),
+ 'page_title' => $title->getDBKey(),
),
__METHOD__ //Function name
);
array_merge( $join,
array(
'page_namespace' => $title->getNamespace(),
- 'page_title' => $title->getDbKey() ) ),
+ 'page_title' => $title->getDBKey() ) ),
__METHOD__ );
foreach( $result as $row ) {
$template = Title::makeTitle( $row->namespace, $row->title );
if( $title && $title->getText() != '' ) {
$dbr = wfGetDB( DB_SLAVE );
$image = $dbr->tableName( 'image' );
- $encFilename = $dbr->addQuotes( htmlspecialchars( $title->getDbKey() ) );
+ $encFilename = $dbr->addQuotes( htmlspecialchars( $title->getDBKey() ) );
$sql = "SELECT img_sha1 from $image where img_name = $encFilename";
$res = $dbr->query( $sql );
$row = $dbr->fetchRow( $res );
$title = Title::newFromText( $page );
if( $title ) {
$conds['ur_page_namespace'] = $title->getNamespace();
- $conds['ur_page_title'] = $title->getDbKey();
+ $conds['ur_page_title'] = $title->getDBKey();
}
return $conds;
if( $this->deleteKey=='oldimage' ) {
// Run through and pull all our data in one query
foreach( $this->ofiles as $timestamp ) {
- $where[] = $dbr->addQuotes( $timestamp.'!'.$this->page->getDbKey() );
+ $where[] = $dbr->addQuotes( $timestamp.'!'.$this->page->getDBKey() );
}
$whereClause = 'oi_archive_name IN(' . implode(',',$where) . ')';
$result = $dbr->select( 'oldimage', '*',
- array( 'oi_name' => $this->page->getDbKey(),
+ array( 'oi_name' => $this->page->getDBKey(),
$whereClause ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
}
// Check through our images
foreach( $this->ofiles as $timestamp ) {
- $archivename = $timestamp.'!'.$this->page->getDbKey();
+ $archivename = $timestamp.'!'.$this->page->getDBKey();
if( !isset($filesObjs[$archivename]) ) {
continue;
} else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) {
}
$whereClause = 'fa_id IN(' . implode(',',$where) . ')';
$result = $dbr->select( 'filearchive', '*',
- array( 'fa_name' => $this->page->getDbKey(),
+ array( 'fa_name' => $this->page->getDBKey(),
$whereClause ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
$set = array();
// Run through and pull all our data in one query
foreach( $items as $timestamp ) {
- $where[] = $this->dbw->addQuotes( $timestamp.'!'.$title->getDbKey() );
+ $where[] = $this->dbw->addQuotes( $timestamp.'!'.$title->getDBKey() );
}
$whereClause = 'oi_archive_name IN(' . implode(',',$where) . ')';
$result = $this->dbw->select( 'oldimage', '*',
- array( 'oi_name' => $title->getDbKey(),
+ array( 'oi_name' => $title->getDBKey(),
$whereClause ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {
}
// To work!
foreach( $items as $timestamp ) {
- $archivename = $timestamp.'!'.$title->getDbKey();
+ $archivename = $timestamp.'!'.$title->getDBKey();
if( !isset($filesObjs[$archivename]) ) {
$success = false;
continue; // Must exist
}
$whereClause = 'fa_id IN(' . implode(',',$where) . ')';
$result = $this->dbw->select( 'filearchive', '*',
- array( 'fa_name' => $title->getDbKey(),
+ array( 'fa_name' => $title->getDBKey(),
$whereClause ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {