* Either a short hexidecimal string if a transaction is active or ""
*
* @var string
- * @see DatabaseBase::mTrxLevel
+ * @see Database::mTrxLevel
*/
protected $mTrxShortId = '';
/**
* point (possibly more up-to-date since the first SELECT defines the snapshot).
*
* @var float|null
- * @see DatabaseBase::mTrxLevel
+ * @see Database::mTrxLevel
*/
private $mTrxTimestamp = null;
/** @var float Lag estimate at the time of BEGIN */
* Used to provide additional context for error reporting.
*
* @var string
- * @see DatabaseBase::mTrxLevel
+ * @see Database::mTrxLevel
*/
private $mTrxFname = null;
/**
* Record if possible write queries were done in the last transaction started
*
* @var bool
- * @see DatabaseBase::mTrxLevel
+ * @see Database::mTrxLevel
*/
private $mTrxDoneWrites = false;
/**
* Record if the current transaction was started implicitly due to DBO_TRX being set.
*
* @var bool
- * @see DatabaseBase::mTrxLevel
+ * @see Database::mTrxLevel
*/
private $mTrxAutomatic = false;
/**
*/
private $mTrxAtomicLevels = [];
/**
- * Record if the current transaction was started implicitly by DatabaseBase::startAtomic
+ * Record if the current transaction was started implicitly by Database::startAtomic
*
* @var bool
*/
/** @var IDatabase|null Lazy handle to the master DB this server replicates from */
private $lazyMasterHandle;
- /**
- * @since 1.22
- * @var string[] Process cache of VIEWs names in the database
- */
- protected $allViews = null;
-
/** @var float UNIX timestamp */
protected $lastPing = 0.0;
* @see setLazyMasterHandle()
* @since 1.27
*/
- public function getLazyMasterHandle() {
+ protected function getLazyMasterHandle() {
return $this->lazyMasterHandle;
}
* @param array $options Associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return array
- * @see DatabaseBase::select()
+ * @see Database::select()
*/
protected function makeSelectOptions( $options ) {
$preLimitTail = $postLimitTail = '';
*
* @param array $options Associative array of options
* @return string
- * @see DatabaseBase::select()
+ * @see Database::select()
* @since 1.21
*/
protected function makeGroupByWithHaving( $options ) {
*
* @param array $options Associative array of options
* @return string
- * @see DatabaseBase::select()
+ * @see Database::select()
* @since 1.21
*/
protected function makeOrderBy( $options ) {
}
/**
- * Helper for DatabaseBase::insert().
+ * Helper for Database::insert().
*
* @param array $options
* @return string
}
/**
- * Make UPDATE options array for DatabaseBase::makeUpdateOptions
+ * Make UPDATE options array for Database::makeUpdateOptions
*
* @param array $options
* @return array
}
/**
- * Make UPDATE options for the DatabaseBase::update function
+ * Make UPDATE options for the Database::update function
*
- * @param array $options The options passed to DatabaseBase::update
+ * @param array $options The options passed to Database::update
* @return string
*/
protected function makeUpdateOptions( $options ) {
return 0;
}
- public function getSlavePos() {
+ public function getReplicaPos() {
# Stub
return false;
}
/**
* Issues the BEGIN command to the database server.
*
- * @see DatabaseBase::begin()
+ * @see Database::begin()
* @param string $fname
*/
protected function doBegin( $fname ) {
/**
* Issues the COMMIT command to the database server.
*
- * @see DatabaseBase::commit()
+ * @see Database::commit()
* @param string $fname
*/
protected function doCommit( $fname ) {
/**
* Issues the ROLLBACK command to the database server.
*
- * @see DatabaseBase::rollback()
+ * @see Database::rollback()
* @param string $fname
*/
protected function doRollback( $fname ) {
throw new RuntimeException( __METHOD__ . ' is not implemented in descendant class' );
}
- /**
- * Reset the views process cache set by listViews()
- * @since 1.22
- */
- final public function clearViewsCache() {
- $this->allViews = null;
- }
-
public function listViews( $prefix = null, $fname = __METHOD__ ) {
throw new RuntimeException( __METHOD__ . ' is not implemented in descendant class' );
}
- /**
- * Differentiates between a TABLE and a VIEW
- *
- * @param string $name Name of the database-structure to test.
- * @throws RuntimeException
- * @return bool
- * @since 1.22
- */
- public function isView( $name ) {
- throw new RuntimeException( __METHOD__ . ' is not implemented in descendant class' );
- }
-
public function timestamp( $ts = 0 ) {
$t = new ConvertibleTimestamp( $ts );
// Let errors bubble up to avoid putting garbage in the DB
* necessary. Boolean values are passed through as is, to indicate success
* of write queries or failure.
*
- * Once upon a time, DatabaseBase::query() returned a bare MySQL result
+ * Once upon a time, Database::query() returned a bare MySQL result
* resource, and it was necessary to call this function to convert it to
* a wrapper. Nowadays, raw database objects are never exposed to external
* callers, so this is unnecessary in external code.
public function sourceFile(
$filename,
- $lineCallback = false,
- $resultCallback = false,
+ callable $lineCallback = null,
+ callable $resultCallback = null,
$fname = false,
- $inputCallback = false
+ callable $inputCallback = null
) {
MediaWiki\suppressWarnings();
$fp = fopen( $filename, 'r' );
public function sourceStream(
$fp,
- $lineCallback = false,
- $resultCallback = false,
+ callable $lineCallback = null,
+ callable $resultCallback = null,
$fname = __METHOD__,
- $inputCallback = false
+ callable $inputCallback = null
) {
$cmd = '';
}
}
}
+
+class_alias( 'Database', 'DatabaseBase' );