$this->host = isset( $params['hostname'] )
? $params['hostname']
: ( gethostname() ?: 'unknown' );
- $this->cliMode = isset( $params['cliMode'] ) ? $params['cliMode'] : PHP_SAPI === 'cli';
+ $this->cliMode = isset( $params['cliMode'] )
+ ? $params['cliMode']
+ : ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' );
$this->agent = isset( $params['agent'] ) ? $params['agent'] : '';
if ( isset( $params['chronologyProtector'] ) ) {
}
}
+ /**
+ * Get the local (and default) database domain ID of connection handles
+ *
+ * @see DatabaseDomain
+ * @return string Database domain ID; this specifies DB name, schema, and table prefix
+ * @since 1.31
+ */
+ public function getLocalDomainID() {
+ return $this->localDomain->getId();
+ }
+
/**
* Get a LoadMonitor instance
*
* @return bool
*/
private function isOpen( $index ) {
- if ( !is_integer( $index ) ) {
+ if ( !is_int( $index ) ) {
return false;
}
return isset( $this->mServers[$i]['type'] ) ? $this->mServers[$i]['type'] : 'unknown';
}
- /**
- * @deprecated Since 1.30, no alternative
- */
- public function getServerInfo( $i ) {
- wfDeprecated( __METHOD__, '1.30' );
- if ( isset( $this->mServers[$i] ) ) {
- return $this->mServers[$i];
- } else {
- return false;
- }
- }
-
- /**
- * @deprecated Since 1.30, construct new object
- */
- public function setServerInfo( $i, array $serverInfo ) {
- wfDeprecated( __METHOD__, '1.30' );
- $this->mServers[$i] = $serverInfo;
- }
-
public function getMasterPos() {
# If this entire request was served from a replica DB without opening a connection to the
# master (however unlikely that may be), then we can fetch the position from the replica DB.