*
* @return Bool operation success. true if already closed.
*/
- abstract function close();
+ function close() {
+ # Stub, should probably be overridden
+ return true;
+ }
/**
* @param $error String: fallback error message, used if none is given by MySQL
* Free a result object
* @param $res Mixed: A SQL result
*/
- abstract function freeResult( $res );
+ function freeResult( $res ) {
+ # Stub. Might not really need to be overridden, since results should
+ # be freed by PHP when the variable goes out of scope anyway.
+ }
/**
* Fetch the next row from the given result object, in object form.
/**
* Change the current database
+ *
+ * @return bool Success or failure
*/
- abstract function selectDB( $db );
+ function selectDB( $db ) {
+ # Stub. Shouldn't cause serious problems if it's not overridden, but
+ # if your database engine supports a concept similar to MySQL's
+ # databases you may as well. TODO: explain what exactly will fail if
+ # this is not overridden.
+ return true;
+ }
/**
* Get the current DB name
/**
* Ping the server and try to reconnect if it there is no connection
+ *
+ * @return bool Success or failure
*/
- abstract function ping();
+ function ping() {
+ # Stub. Not essential to override.
+ return true;
+ }
/**
* Get slave lag.
return "[http://www.ibm.com/software/data/db2/express/?s_cmp=ECDDWW01&s_tact=MediaWiki IBM DB2]";
}
- /**
- * Does nothing
- * @param object $db
- * @return bool true
- */
- public function selectDB( $db ) {
- return true;
- }
-
/**
* Returns an SQL expression for a simple conditional.
* Uses CASE on DB2
*/
public function setTimeout($timeout) { return; }
- function ping() {
- wfDebug("Function ping() not written for MSSQL yet");
- return true;
- }
-
/**
* How lagged is this slave?
*/
return $s;
}
- /* For now, does nothing */
- function selectDB( $db ) {
- return true;
- }
-
function selectRow( $table, $vars, $conds, $fname = 'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) {
if (is_array($table))
foreach ($table as $tab)
// @todo fixme no-op
}
- function ping() {
- wfDebug( "Function ping() not written for DatabaseOracle.php yet");
- return true;
- }
-
/**
* How lagged is this slave?
*
return '"' . preg_replace( '/"/', '""', $s) . '"';
}
- /* For now, does nothing */
- function selectDB( $db ) {
- return true;
- }
-
/**
* Postgres specific version of replaceVars.
* Calls the parent version in Database.php
// @todo fixme no-op
}
- function ping() {
- wfDebug( "Function ping() not written for DatabasePostgres.php yet");
- return true;
- }
-
/**
* How lagged is this slave?
*
function quote_ident($s) { return $s; }
- /**
- * Not possible in SQLite
- * We have ATTACH_DATABASE but that requires database selectors before the
- * table names and in any case is really a different concept to MySQL's USE
- */
- function selectDB($db) {
- if ( $db != $this->mName ) {
- throw new MWException( 'selectDB is not implemented in SQLite' );
- }
- }
-
/**
* not done
*/
public function setTimeout($timeout) { return; }
- /**
- * No-op for a non-networked database
- */
- function ping() {
- return true;
- }
-
/**
* How lagged is this slave?
*/