MediaWiki master
HistoryBlobCurStub.php
Go to the documentation of this file.
1<?php
24
32 public $mCurId;
33
37 public function __construct( $curid = 0 ) {
38 $this->mCurId = $curid;
39 }
40
47 public function setLocation( $id ) {
48 $this->mCurId = $id;
49 }
50
54 public function getText() {
55 $dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
56 $row = $dbr->newSelectQueryBuilder()
57 ->select( [ 'cur_text' ] )
58 ->from( 'cur' )
59 ->where( [ 'cur_id' => $this->mCurId ] )
60 ->caller( __METHOD__ )->fetchRow();
61 return $row ? $row->cur_text : false;
62 }
63}
64
65// Blobs generated by MediaWiki < 1.5 on PHP 4 were serialized with the
66// class name coerced to lowercase. We can improve efficiency by adding
67// autoload entries for the lowercase variants of these classes (T166759).
68// The code below is never executed, but it is picked up by the AutoloadGenerator
69// parser, which scans for class_alias() calls.
70/*
71class_alias( HistoryBlobCurStub::class, 'historyblobcurstub' );
72*/
To speed up conversion from 1.4 to 1.5 schema, text rows can refer to the leftover cur table as the b...
setLocation( $id)
Sets the location (cur_id) of the main object to which this object points.
Service locator for MediaWiki core services.