3 * Efficient concatenated text storage.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
24 * To speed up conversion from 1.4 to 1.5 schema, text rows can refer to the
25 * leftover cur table as the backend. This avoids expensively copying hundreds
26 * of megabytes of data during the conversion downtime.
28 * Serialized HistoryBlobCurStub objects will be inserted into the text table
29 * on conversion if $wgLegacySchemaConversion is set to true.
31 class HistoryBlobCurStub
{
36 * @param int $curid The cur_id pointed to
38 function __construct( $curid = 0 ) {
39 $this->mCurId
= $curid;
43 * Sets the location (cur_id) of the main object to which this object
48 function setLocation( $id ) {
56 $dbr = wfGetDB( DB_REPLICA
);
57 $row = $dbr->selectRow( 'cur', [ 'cur_text' ], [ 'cur_id' => $this->mCurId
] );
61 return $row->cur_text
;
65 // phpcs:ignore Generic.CodeAnalysis.UnconditionalIfStatement.Found
67 // Blobs generated by MediaWiki < 1.5 on PHP 4 were serialized with the
68 // class name coerced to lowercase. We can improve efficiency by adding
69 // autoload entries for the lowercase variants of these classes (T166759).
70 // The code below is never executed, but it is picked up by the AutoloadGenerator
71 // parser, which scans for class_alias() calls.
72 class_alias( HistoryBlobCurStub
::class, 'historyblobcurstub' );