wiki.techinc.nl/includes/historyblob/HistoryBlobCurStub.php
diesel kapasule 8a31497c5f Remove unused configuration global $wgLegacySchemaConversion
I removed $wgLegacySchemaConversion from config-vars and
HistoryBlobCurStub.

Bug: T303684
Change-Id: I7f918ab61ffea377bd827721f9b41ae5d8f82226
2022-05-30 20:59:05 +02:00

69 lines
2 KiB
PHP

<?php
/**
* Efficient concatenated text storage.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
*/
/**
* To speed up conversion from 1.4 to 1.5 schema, text rows can refer to the
* leftover cur table as the backend. This avoids expensively copying hundreds
* of megabytes of data during the conversion downtime.
*/
class HistoryBlobCurStub {
/** @var int */
public $mCurId;
/**
* @param int $curid The cur_id pointed to
*/
public function __construct( $curid = 0 ) {
$this->mCurId = $curid;
}
/**
* Sets the location (cur_id) of the main object to which this object
* points
*
* @param int $id
*/
public function setLocation( $id ) {
$this->mCurId = $id;
}
/**
* @return string|false
*/
public function getText() {
$dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow( 'cur', [ 'cur_text' ], [ 'cur_id' => $this->mCurId ], __METHOD__ );
if ( !$row ) {
return false;
}
return $row->cur_text;
}
}
// Blobs generated by MediaWiki < 1.5 on PHP 4 were serialized with the
// class name coerced to lowercase. We can improve efficiency by adding
// autoload entries for the lowercase variants of these classes (T166759).
// The code below is never executed, but it is picked up by the AutoloadGenerator
// parser, which scans for class_alias() calls.
/*
class_alias( HistoryBlobCurStub::class, 'historyblobcurstub' );
*/