/**
* Open a connection to the database. Usually aborts on failure
*
- * @param string $server database server host
- * @param string $user database user name
- * @param string $password database user password
- * @param string $dbName database name
+ * @param string $server Database server host
+ * @param string $user Database user name
+ * @param string $password Database user password
+ * @param string $dbName Database name
* @return bool
* @throws DBConnectionError
*/
}
/**
- * @return string command delimiter used by this database engine
+ * @return string Command delimiter used by this database engine
*/
public function getDelimiter() {
return $this->delimiter;
* - false to disable debugging
* - omitted or null to do nothing
*
- * @return bool|null previous value of the flag
+ * @return bool|null Previous value of the flag
*/
public function debug( $debug = null ) {
return wfSetBit( $this->mFlags, DBO_DEBUG, $debug );
* parameters, the member with the given name is set to the given value.
*
* @param string $name
- * @param $value
+ * @param array $value
*/
public function setLBInfo( $name, $value = null ) {
if ( is_null( $value ) ) {
}
/**
- * @param $errno
+ * @param int $errno
* @param string $errstr
*/
public function connectionErrorHandler( $errno, $errstr ) {
/**
* Execute a prepared query with the various arguments
- * @param string $prepared the prepared sql
+ * @param string $prepared The prepared sql
* @param mixed $args Either an array here, or put scalars as varargs
*
* @return ResultWrapper
* For faking prepared SQL statements on DBs that don't support it directly.
*
* @param string $preparedQuery A 'preparable' SQL statement
- * @param array $args of Arguments to fill it with
+ * @param array $args Array of Arguments to fill it with
* @return string Executable SQL
*/
public function fillPrepared( $preparedQuery, $args ) {
* array(baseKeyVal => array(subKeyVal => [ignored], ...), ...)
* @param string $baseKey Field name to match the base-level keys to (eg 'pl_namespace')
* @param string $subKey Field name to match the sub-level keys to (eg 'pl_title')
- * @return Mixed: string SQL fragment, or false if no items in array.
+ * @return string|bool string SQL fragment, or false if no items in array.
*/
public function makeWhereFrom2d( $data, $baseKey, $subKey ) {
$conds = array();
/**
* Return aggregated value alias
*
- * @param $valuedata
+ * @param array $valuedata
* @param string $valuename
*
* @return string
*
* @todo Explain what exactly will fail if this is not overridden.
*
- * @param $db
+ * @param string $db
*
* @return bool Success or failure
*/
/**
* Get the current DB name
+ * @return string
*/
public function getDBname() {
return $this->mDBname;
/**
* Get the server hostname or IP address
+ * @return string
*/
public function getServer() {
return $this->mServer;
/**
* Returns true if current database backend supports ORDER BY or LIMIT for separate subqueries
* within the UNION construct.
- * @return Boolean
+ * @return bool
*/
public function unionSupportsOrderAndLimit() {
return true; // True for almost every DB supported
}
/**
- * @return boolean
+ * @return bool
*/
function isLoggable() {
// Don't send to the exception log, already in dberror log
* @param string $field Field name
* @param string|array $conds Conditions
* @param string|array $join_conds Join conditions
- * @return String SQL text
+ * @return string SQL text
* @since 1.23
*/
public function buildGroupConcatField( $delim, $table, $field, $conds = '',
/**
* @param ResultWrapper|resource $res
- * @param $n int
+ * @param int $n
* @return string
*/
function fieldName( $res, $n ) {
* Get the name of the specified field in a result
*
* @param ResultWrapper|resource $res
- * @param $n int
+ * @param int $n
* @return string
*/
abstract protected function mysqlFieldName( $res, $n );
/**
* mysql_field_type() wrapper
* @param ResultWrapper|resource $res
- * @param $n int
+ * @param int $n
* @return string
*/
public function fieldType( $res, $n ) {
/**
* DELETE where the condition is a join. MySql uses multi-table deletes.
- * @param $delTable string
- * @param $joinTable string
- * @param $delVar string
- * @param $joinVar string
- * @param $conds array|string
- * @param bool|string $fname bool
+ * @param string $delTable
+ * @param string $joinTable
+ * @param string $delVar
+ * @param string $joinVar
+ * @param array|string $conds
+ * @param bool|string $fname
* @throws DBUnexpectedError
* @return bool|ResultWrapper
*/
}
/**
- * @param $tableName
- * @param $fName string
+ * @param string $tableName
+ * @param string $fName
* @return bool|ResultWrapper
*/
public function dropTable( $tableName, $fName = __METHOD__ ) {
/**
* @param string $table
- * @param $row
+ * @param array $row
* @param string $fname
* @return bool
* @throws DBUnexpectedError
/**
* Return aggregated value function call
*
- * @param $valuedata
+ * @param array $valuedata
* @param string $valuename
* @return mixed
*/
/**
* @param DatabaseBase $dbw
- * @param $id
+ * @param int $id
*/
public function __construct( $dbw, $id ) {
$this->dbw = $dbw;
* Values may contain magic keywords like "$user"
* @since 1.19
*
- * @param $search_path array list of schemas to be searched by default
+ * @param array $search_path List of schemas to be searched by default
*/
function setSearchPath( $search_path ) {
$this->query( "SET search_path = " . implode( ", ", $search_path ) );
/**
* @see DatabaseBase::isWriteQuery()
*
- * @param $sql string
+ * @param string $sql
* @return bool
*/
function isWriteQuery( $sql ) {
/**
* @param ResultWrapper $res
- * @param $n
+ * @param int $n
* @return bool
*/
function fieldName( $res, $n ) {
}
/**
- * @param $b
+ * @param string $b
* @return Blob
*/
function encodeBlob( $b ) {
}
/**
- * @param $b Blob|string
+ * @param Blob|string $b
* @return string
*/
function decodeBlob( $b ) {
* @deprecated since 1.22
*
* @param array|null $fields
- * @param boolean $override
- * @param boolean $skipLoaded
+ * @param bool $override
+ * @param bool $skipLoaded
*
* @return bool Success indicator
*/
*
* @since 1.20
*
- * @return integer|null
+ * @return int|null
*/
public function getId();
*
* @since 1.20
*
- * @param integer|null $id
+ * @param int|null $id
*/
public function setId( $id );
*
* @param string $name
*
- * @return boolean
+ * @return bool
*/
public function hasField( $name );
*
* @since 1.20
*
- * @return boolean
+ * @return bool
*/
public function hasIdField();
* @since 1.20
*
* @param array $fields The fields to set
- * @param boolean $override Override already set fields with the provided values?
+ * @param bool $override Override already set fields with the provided values?
*/
public function setFields( array $fields, $override = true );
* @since 1.20
*
* @param null|array $fields
- * @param boolean $incNullId
+ * @param bool $incNullId
*
* @return array
*/
* @since 1.20
* @deprecated since 1.22
*
- * @param boolean $override
+ * @param bool $override
*/
public function loadDefaults( $override = true );
* @param string|null $functionName
* @deprecated since 1.22
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function save( $functionName = null );
* @since 1.20
* @deprecated since 1.22
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function remove();
* @deprecated since 1.22
*
* @param string $field
- * @param integer $amount
+ * @param int $amount
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function addToField( $field, $amount );
* @since 1.20
* @deprecated since 1.22
*
- * @param boolean $update
+ * @param bool $update
*/
public function setUpdateSummaries( $update );
* @since 1.20
* @deprecated since 1.22
*
- * @param boolean $summaryMode
+ * @param bool $summaryMode
*/
public function setSummaryMode( $summaryMode );
* @param array|string|null $fields
* @param array $conditions
* @param array $options
- * @param boolean $collapse Set to false to always return each result row as associative array.
+ * @param bool $collapse Set to false to always return each result row as associative array.
* @param string|null $functionName
*
* @return array of array
* @param array|string|null $fields
* @param array $conditions
* @param array $options
- * @param boolean $collapse Set to false to always return each result row as associative array.
+ * @param bool $collapse Set to false to always return each result row as associative array.
* @param string|null $functionName
*
* @return mixed|array|bool False on failure
*
* @param array $conditions
*
- * @return boolean
+ * @return bool
*/
public function has( array $conditions = array() );
*
* @since 1.21
*
- * @return boolean
+ * @return bool
*/
public function exists();
* @param array $conditions
* @param array $options
*
- * @return integer
+ * @return int
*/
public function count( array $conditions = array(), array $options = array() );
* @param array $conditions
* @param string|null $functionName
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function delete( array $conditions, $functionName = null );
*
* @since 1.20
*
- * @param boolean $requireParams
- * @param boolean $setDefaults
+ * @param bool $requireParams
+ * @param bool $setDefaults
*
* @return array
*/
*
* @since 1.20
*
- * @return integer DB_ enum
+ * @return int DB_ enum
*/
public function getReadDb();
/**
* Set the database type to use for read operations.
*
- * @param integer $db
+ * @param int $db
*
* @since 1.20
*/
*
* @since 1.20
*
- * @return String|bool The target wiki, in a form that LBFactory
+ * @return string|bool The target wiki, in a form that LBFactory
* understands (or false if the local wiki is used)
*/
public function getTargetWiki();
*
* @see LoadBalancer::reuseConnection
*
- * @param DatabaseBase $db the database
+ * @param DatabaseBase $db The database
*
* @since 1.20
*/
* @param array $values
* @param array $conditions
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function update( array $values, array $conditions = array() );
* @since 1.20
*
* @param array $data
- * @param boolean $loadDefaults
+ * @param bool $loadDefaults
*
* @return IORMRow
*/
*
* @param string $name
*
- * @return boolean
+ * @return bool
*/
public function canHaveField( $name );
}
* Private helper for forEachLBCallMethod
* @param LoadBalancer $loadBalancer
* @param string $methodName
- * @param $args
+ * @param array $args
*/
function callMethod( $loadBalancer, $methodName, $args ) {
call_user_func_array( array( $loadBalancer, $methodName ), $args );
}
/**
- * @param string $cluster external storage cluster, or false for core
+ * @param string $cluster External storage cluster, or false for core
* @param bool|string $wiki Wiki ID, or false for the current wiki
* @return LoadBalancerSingle
*/
protected $db;
/**
- * @param $params array
+ * @param array $params
*/
function __construct( $params ) {
$this->db = $params['connection'];
/**
* Get or set arbitrary data used by the parent object, usually an LBFactory
- * @param $x
+ * @param mixed $x
* @return mixed
*/
function parentInfo( $x = null ) {
/**
* Wait for a given slave to catch up to the master pos stored in $this
- * @param $index
- * @param $open bool
+ * @param int $index
+ * @param bool $open
* @return bool
*/
protected function doWait( $index, $open = false ) {
* Get a connection by index
* This is the main entry point for this class.
*
- * @param $i Integer: server index
- * @param array $groups query groups
+ * @param int $i Server index
+ * @param array $groups Query groups
* @param bool|string $wiki Wiki ID
*
* @throws MWException
*
* @see LoadBalancer::getConnection() for parameter information
*
- * @param integer $db
+ * @param int $db
* @param mixed $groups
* @param bool|string $wiki
* @return DBConnRef
*
* @see LoadBalancer::getConnection() for parameter information
*
- * @param integer $db
+ * @param int $db
* @param mixed $groups
* @param bool|string $wiki
* @return DBConnRef
* On error, returns false, and the connection which caused the
* error will be available via $this->mErrorConnection.
*
- * @param $i Integer server index
- * @param bool|string $wiki wiki ID to open
+ * @param int $i Server index
+ * @param bool|string $wiki Wiki ID to open
* @return DatabaseBase
*
* @access private
* On error, returns false, and the connection which caused the
* error will be available via $this->mErrorConnection.
*
- * @param $i Integer: server index
- * @param string $wiki wiki ID to open
+ * @param int $i Server index
+ * @param string $wiki Wiki ID to open
* @return DatabaseBase
*/
function openForeignConnection( $i, $wiki ) {
/**
* Test if the specified index represents an open connection
*
- * @param $index Integer: server index
+ * @param int $index Server index
* @access private
* @return bool
*/
* Returns a Database object whether or not the connection was successful.
* @access private
*
- * @param $server
- * @param $dbNameOverride bool
+ * @param array $server
+ * @param bool $dbNameOverride
* @throws MWException
* @return DatabaseBase
*/
/**
* Return the server info structure for a given index, or false if the index is invalid.
- * @param $i
- * @return bool
+ * @param int $i
+ * @return array|bool
*/
function getServerInfo( $i ) {
if ( isset( $this->mServers[$i] ) ) {
/**
* Sets the server info structure for the given index. Entry at index $i
* is created if it doesn't exist
- * @param $i
- * @param $serverInfo
+ * @param int $i
+ * @param array $serverInfo
*/
function setServerInfo( $i, $serverInfo ) {
$this->mServers[$i] = $serverInfo;
}
/**
- * @param $value null
- * @return Mixed
+ * @param mixed $value
+ * @return mixed
*/
function waitTimeout( $value = null ) {
return wfSetVar( $this->mWaitTimeout, $value );
protected $res;
/**
- * @var integer
+ * @var int
*/
protected $key;
}
/**
- * @param $row
+ * @param bool|object $row
*/
protected function setCurrent( $row ) {
if ( $row === false ) {
}
/**
- * @return integer
+ * @return int
*/
public function count() {
return $this->res->numRows();
}
/**
- * @return boolean
+ * @return bool
*/
public function isEmpty() {
return $this->res->numRows() === 0;
}
/**
- * @return integer
+ * @return int
*/
public function key() {
return $this->key;
}
/**
- * @return boolean
+ * @return bool
*/
public function valid() {
return $this->current !== false;
*
* @param IORMTable|null $table Deprecated since 1.22
* @param array|null $fields
- * @param boolean $loadDefaults Deprecated since 1.22
+ * @param bool $loadDefaults Deprecated since 1.22
*/
public function __construct( IORMTable $table = null, $fields = null, $loadDefaults = false ) {
$this->table = $table;
* @deprecated since 1.22
*
* @param array|null $fields
- * @param boolean $override
- * @param boolean $skipLoaded
+ * @param bool $override
+ * @param bool $skipLoaded
*
* @return bool Success indicator
*/
* @since 1.20
*
* @param string $name Field name
- * @param $default mixed: Default value to return when none is found
+ * @param mixed $default Default value to return when none is found
* (default: null)
*
* @throws MWException
* @since 1.20
* @deprecated since 1.22
*
- * @param $name string
+ * @param string $name
*
* @return mixed
*/
*
* @since 1.20
*
- * @return integer|null
+ * @return int|null
*/
public function getId() {
return $this->getField( 'id' );
*
* @since 1.20
*
- * @param integer|null $id
+ * @param int|null $id
*/
public function setId( $id ) {
$this->setField( 'id', $id );
*
* @param string $name
*
- * @return boolean
+ * @return bool
*/
public function hasField( $name ) {
return array_key_exists( $name, $this->fields );
*
* @since 1.20
*
- * @return boolean
+ * @return bool
*/
public function hasIdField() {
return $this->hasField( 'id' ) && !is_null( $this->getField( 'id' ) );
* @since 1.20
*
* @param array $fields The fields to set
- * @param boolean $override Override already set fields with the provided values?
+ * @param bool $override Override already set fields with the provided values?
*/
public function setFields( array $fields, $override = true ) {
foreach ( $fields as $name => $value ) {
* @since 1.20
*
* @param null|array $fields
- * @param boolean $incNullId
+ * @param bool $incNullId
*
* @return array
*/
* @since 1.20
* @deprecated since 1.22
*
- * @param boolean $override
+ * @param bool $override
*/
public function loadDefaults( $override = true ) {
$this->setFields( $this->table->getDefaults(), $override );
*
* @param string|null $functionName
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function save( $functionName = null ) {
if ( $this->hasIdField() ) {
*
* @param string|null $functionName
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
protected function saveExisting( $functionName = null ) {
$dbw = $this->table->getWriteDbConnection();
* @param string|null $functionName
* @param array|null $options
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
protected function insert( $functionName = null, array $options = null ) {
$dbw = $this->table->getWriteDbConnection();
* @since 1.20
* @deprecated since 1.22, use IORMTable->removeRow
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function remove() {
$this->beforeRemove();
* @deprecated since 1.22, use IORMTable->addToField
*
* @param string $field
- * @param integer $amount
+ * @param int $amount
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function addToField( $field, $amount ) {
return $this->table->addToField( $this->getUpdateConditions(), $field, $amount );
* @since 1.20
* @deprecated since 1.22
*
- * @param boolean $update
+ * @param bool $update
*/
public function setUpdateSummaries( $update ) {
$this->updateSummaries = $update;
* @since 1.20
* @deprecated since 1.22
*
- * @param boolean $summaryMode
+ * @param bool $summaryMode
*/
public function setSummaryMode( $summaryMode ) {
$this->inSummaryMode = $summaryMode;
*
* @since 1.20
*
- * @var integer DB_ enum
+ * @var int DB_ enum
*/
protected $readDb = DB_SLAVE;
* @param array|string|null $fields
* @param array $conditions
* @param array $options
- * @param boolean $collapse Set to false to always return each result row as associative array.
+ * @param bool $collapse Set to false to always return each result row as associative array.
* @param string|null $functionName
*
* @return array of array
* @param array|string|null $fields
* @param array $conditions
* @param array $options
- * @param boolean $collapse Set to false to always return each result row as associative array.
+ * @param bool $collapse Set to false to always return each result row as associative array.
* @param string|null $functionName
*
* @return mixed|array|bool False on failure
*
* @param array $conditions
*
- * @return boolean
+ * @return bool
*/
public function has( array $conditions = array() ) {
return $this->selectRow( array( 'id' ), $conditions ) !== false;
*
* @since 1.21
*
- * @return boolean
+ * @return bool
*/
public function exists() {
$dbr = $this->getReadDbConnection();
* @param array $conditions
* @param array $options
*
- * @return integer
+ * @return int
*/
public function count( array $conditions = array(), array $options = array() ) {
$res = $this->rawSelectRow(
* @param array $conditions
* @param string|null $functionName
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function delete( array $conditions, $functionName = null ) {
$dbw = $this->getWriteDbConnection();
*
* @since 1.20
*
- * @param boolean $requireParams
- * @param boolean $setDefaults
+ * @param bool $requireParams
+ * @param bool $setDefaults
*
* @return array
*/
*
* @since 1.20
*
- * @return integer DB_ enum
+ * @return int DB_ enum
*/
public function getReadDb() {
return $this->readDb;
* Set the database ID to use for read operations, use DB_XXX constants or
* an index to the load balancer setup.
*
- * @param integer $db
+ * @param int $db
*
* @since 1.20
*/
*
* @since 1.20
*
- * @return String|bool The target wiki, in a form that LBFactory understands
+ * @return string|bool The target wiki, in a form that LBFactory understands
* (or false if the local wiki is used)
*/
public function getTargetWiki() {
* @param array $values
* @param array $conditions
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function update( array $values, array $conditions = array() ) {
$dbw = $this->getWriteDbConnection();
* @since 1.20
*
* @param array $data
- * @param boolean $loadDefaults
+ * @param bool $loadDefaults
*
* @return IORMRow
*/
* @since 1.20
*
* @param array $fields
- * @param boolean $loadDefaults
+ * @param bool $loadDefaults
*
* @return IORMRow
*/
*
* @param string $name
*
- * @return boolean
+ * @return bool
*/
public function canHaveField( $name ) {
return array_key_exists( $name, $this->getFields() );
* @param IORMRow $row The row to save
* @param string|null $functionName
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function updateRow( IORMRow $row, $functionName = null ) {
$dbw = $this->getWriteDbConnection();
* @param string|null $functionName
* @param array|null $options
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function insertRow( IORMRow $row, $functionName = null, array $options = null ) {
$dbw = $this->getWriteDbConnection();
* @param IORMRow $row
* @param string|null $functionName
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function removeRow( IORMRow $row, $functionName = null ) {
$success = $this->delete(
*
* @param array $conditions
* @param string $field
- * @param integer $amount
+ * @param int $amount
*
- * @return boolean Success indicator
+ * @return bool Success indicator
* @throws MWException
*/
public function addToField( array $conditions, $field, $amount ) {
/**
* Constructor.
*
- * @param $siteName
- * @param $admin
- * @param $option Array
+ * @param string $siteName
+ * @param string $admin
+ * @param array $option
*/
function __construct( $siteName, $admin = null, array $option = array() ) {
global $wgContLang;
}
/**
- * @param $params array
+ * @param array $params
*
* @return string
*/
/**
* Get the DBMS-specific options for LocalSettings.php generation.
*
- * @return String
+ * @return string
*/
abstract public function getLocalSettings();
/**
* Perform database upgrades
*
- * @return Boolean
+ * @return bool
*/
public function doUpgrade() {
$this->setupSchemaVars();
/**
* Construct and initialise parent.
* This is typically only called from Installer::getDBInstaller()
- * @param $parent
+ * @param WebInstaller $parent
*/
public function __construct( $parent ) {
$this->parent = $parent;
* Convenience function.
* Check if a named extension is present.
*
- * @param $name
+ * @param string $name
* @return bool
*/
protected static function checkExtension( $name ) {
/**
* Get the internationalised name for this DBMS.
- * @return String
+ * @return string
*/
public function getReadableName() {
// Messages: config-type-mysql, config-type-postgres, config-type-sqlite,
/**
* Get a variable, taking local defaults into account.
- * @param $var string
- * @param $default null
+ * @param string $var
+ * @param mixed|null $default
* @return mixed
*/
public function getVar( $var, $default = null ) {
/**
* Convenience alias for $this->parent->setVar()
- * @param $name string
- * @param $value mixed
+ * @param string $name
+ * @param mixed $value
*/
public function setVar( $name, $value ) {
$this->parent->setVar( $name, $value );
/**
* Get a labelled text box to configure a local variable.
*
- * @param $var string
- * @param $label string
- * @param $attribs array
- * @param $helpData string
+ * @param string $var
+ * @param string $label
+ * @param array $attribs
+ * @param string $helpData
* @return string
*/
public function getTextBox( $var, $label, $attribs = array(), $helpData = "" ) {
* Get a labelled password box to configure a local variable.
* Implements password hiding.
*
- * @param $var string
- * @param $label string
- * @param $attribs array
- * @param $helpData string
+ * @param string $var
+ * @param string $label
+ * @param array $attribs
+ * @param string $helpData
* @return string
*/
public function getPasswordBox( $var, $label, $attribs = array(), $helpData = "" ) {
/**
* Get a set of labelled radio buttons.
*
- * @param $params Array:
- * Parameters are:
+ * @param array $params Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
* itemLabelPrefix: The message name prefix for the item labels (required)
* Convenience function to set variables based on form data.
* Assumes that variables containing "password" in the name are (potentially
* fake) passwords.
- * @param $varNames Array
+ * @param array $varNames
* @return array
*/
public function setVarsFromRequest( $varNames ) {
* Traditionally, this is done by testing for the existence of either
* the revision table or the cur table.
*
- * @return Boolean
+ * @return bool
*/
public function needsUpgrade() {
$status = $this->getConnection();
/**
* Get a standard install-user fieldset.
*
- * @return String
+ * @return string
*/
public function getInstallUserBox() {
return Html::openElement( 'fieldset' ) .
* @param string|bool $noCreateMsg Message to display instead of the creation checkbox.
* Set this to false to show a creation checkbox (default).
*
- * @return String
+ * @return string
*/
public function getWebUserBox( $noCreateMsg = false ) {
$wrapperStyle = $this->getVar( '_SameAccount' ) ? 'display: none' : '';
/**
* @since 1.19
*
- * @param $tableName string
- * @param $indexName string
- * @param $sqlPath string
+ * @param string $tableName
+ * @param string $indexName
+ * @param string $sqlPath
*/
public function addExtensionIndex( $tableName, $indexName, $sqlPath ) {
$this->extensionUpdates[] = array( 'addIndex', $tableName, $indexName, $sqlPath, true );
*
* @since 1.19
*
- * @param $tableName string
- * @param $columnName string
- * @param $sqlPath string
+ * @param string $tableName
+ * @param string $columnName
+ * @param string $sqlPath
*/
public function addExtensionField( $tableName, $columnName, $sqlPath ) {
$this->extensionUpdates[] = array( 'addField', $tableName, $columnName, $sqlPath, true );
*
* @since 1.20
*
- * @param $tableName string
- * @param $columnName string
- * @param $sqlPath string
+ * @param string $tableName
+ * @param string $columnName
+ * @param string $sqlPath
*/
public function dropExtensionField( $tableName, $columnName, $sqlPath ) {
$this->extensionUpdates[] = array( 'dropField', $tableName, $columnName, $sqlPath, true );
*
* @since 1.20
*
- * @param $tableName string
- * @param $sqlPath string
+ * @param string $tableName
+ * @param string $sqlPath
*/
public function dropExtensionTable( $tableName, $sqlPath ) {
$this->extensionUpdates[] = array( 'dropTable', $tableName, $sqlPath, true );
* @param string $tableName The table name
* @param string $oldIndexName The old index name
* @param string $newIndexName The new index name
- * @param $skipBothIndexExistWarning Boolean: Whether to warn if both the old
+ * @param bool $skipBothIndexExistWarning Whether to warn if both the old
* and the new indexes exist. [facultative; by default, false]
* @param string $sqlPath The path to the SQL change path
*/
*
* @since 1.20
*
- * @param $tableName string
+ * @param string $tableName
* @return bool
*/
public function tableExists( $tableName ) {
/**
* Get the list of extension-defined updates
*
- * @return Array
+ * @return array
*/
protected function getExtensionUpdates() {
return $this->extensionUpdates;
* @since 1.21
*
* Writes the schema updates desired to a file for the DB Admin to run.
+ * @param array $schemaUpdate
*/
private function writeSchemaUpdateFile( $schemaUpdate = array() ) {
$updates = $this->updatesSkipped;
/**
* Helper function for doUpdates()
*
- * @param array $updates of updates to run
- * @param bool $passSelf Whether to pass this object we calling external
- * functions
+ * @param array $updates Array of updates to run
+ * @param bool $passSelf Whether to pass this object we calling external functions
*/
private function runUpdates( array $updates, $passSelf ) {
$updatesDone = array();
* class does). Pre-1.17 wikis won't have this column, and really old wikis
* might not even have updatelog at all
*
- * @return boolean
+ * @return bool
*/
protected function canUseNewUpdatelog() {
return $this->db->tableExists( 'updatelog', __METHOD__ ) &&
* Applies a SQL patch
*
* @param string $path Path to the patch file
- * @param $isFullPath Boolean Whether to treat $path as a relative or not
+ * @param bool $isFullPath Whether to treat $path as a relative or not
* @param string $msg Description of the patch
* @return bool False if patch is skipped.
*/
* @param string $table Name of the table to modify
* @param string $oldIndex Old name of the index
* @param string $newIndex New name of the index
- * @param $skipBothIndexExistWarning Boolean: Whether to warn if both the
+ * @param bool $skipBothIndexExistWarning Whether to warn if both the
* old and the new indexes exist.
* @param string $patch Path to the patch file
* @param bool $fullpath Whether to treat $patch path as a relative or not
/**
* Minimum memory size in MB.
*
- * @var integer
+ * @var int
*/
protected $minMemorySize = 50;
* The parameters are like parameters to wfMessage().
* The messages will be in wikitext format, which will be converted to an
* output format such as HTML or text before being sent to the user.
- * @param $msg
+ * @param string $msg
*/
abstract public function showMessage( $msg /*, ... */ );
/**
* Same as showMessage(), but for displaying errors
- * @param $msg
+ * @param string $msg
*/
abstract public function showError( $msg /*, ... */ );
/**
* Show a message to the installing user by using a Status object
- * @param $status Status
+ * @param Status $status
*/
abstract public function showStatusMessage( Status $status );
/**
* Set a MW configuration variable, or internal installer configuration variable.
*
- * @param $name String
- * @param $value Mixed
+ * @param string $name
+ * @param mixed $value
*/
public function setVar( $name, $value ) {
$this->settings[$name] = $value;
* The defaults come from $GLOBALS (ultimately DefaultSettings.php).
* Installer variables are typically prefixed by an underscore.
*
- * @param $name String
- * @param $default Mixed
+ * @param string $name
+ * @param mixed $default
*
* @return mixed
*/
/**
* Get an instance of DatabaseInstaller for the specified DB type.
*
- * @param $type Mixed: DB installer for which is needed, false to use default.
+ * @param mixed $type DB installer for which is needed, false to use default.
*
* @return DatabaseInstaller
*/
/**
* Determine if LocalSettings.php exists. If it does, return its variables.
*
- * @return Array
+ * @return array
*/
public static function getExistingLocalSettings() {
global $IP;
* This is a security mechanism to avoid compromise of the password in the
* event of session ID compromise.
*
- * @param $realPassword String
+ * @param string $realPassword
*
* @return string
*/
* Set a variable which stores a password, except if the new value is a
* fake password in which case leave it as it is.
*
- * @param $name String
- * @param $value Mixed
+ * @param string $name
+ * @param mixed $value
*/
public function setPassword( $name, $value ) {
if ( !preg_match( '/^\*+$/', $value ) ) {
* whatever, this function is guarded to catch the attempted DB access and to present
* some fallback text.
*
- * @param $text String
- * @param $lineStart Boolean
- * @return String
+ * @param string $text
+ * @param bool $lineStart
+ * @return string
*/
public function parse( $text, $lineStart = false ) {
global $wgParser;
* Install step which adds a row to the site_stats table with appropriate
* initial values.
*
- * @param $installer DatabaseInstaller
+ * @param DatabaseInstaller $installer
*
* @return Status
*/
/**
* Helper function to be called from envCheckServer()
- * @return String
+ * @return string
*/
abstract protected function envGetDefaultServer();
/**
* Convert a hex string representing a Unicode code point to that code point.
- * @param $c String
+ * @param string $c
* @return string
*/
protected function unicodeChar( $c ) {
* of known Unix-like defaults, as well as the PATH environment variable
* (which should maybe make it work for Windows?)
*
- * @return Array
+ * @return array
*/
protected static function getPossibleBinPaths() {
return array_merge(
*
* @param string $path path to search
* @param array $names of executable names
- * @param $versionInfo Boolean false or array with two members:
- * 0 => Command to run for version check, with $1 for the full executable name
- * 1 => String to compare the output with
+ * @param array|bool $versionInfo False or array with two members:
+ * 0 => Command to run for version check, with $1 for the full executable name
+ * 1 => String to compare the output with
*
* If $versionInfo is not false, only executables with a version
* matching $versionInfo[1] will be returned.
* @see locateExecutable()
* @param array $names Array of possible names.
* @param array|bool $versionInfo Default: false or array with two members:
- * 0 => Command to run for version check, with $1 for the full executable name
- * 1 => String to compare the output with
+ * 0 => Command to run for version check, with $1 for the full executable name
+ * 1 => String to compare the output with
*
* If $versionInfo is not false, only executables with a version
* matching $versionInfo[1] will be returned.
* Checks if scripts located in the given directory can be executed via the given URL.
*
* Used only by environment checks.
- * @param $dir string
- * @param $url string
+ * @param string $dir
+ * @param string $url
* @return bool|int|string
*/
public function dirIsExecutable( $dir, $url ) {
/**
* ParserOptions are constructed before we determined the language, so fix it
*
- * @param $lang Language
+ * @param Language $lang
*/
public function setParserLanguage( $lang ) {
$this->parserOptions->setTargetLanguage( $lang );
/**
* Overridden by WebInstaller to provide lastPage parameters.
- * @param $page string
+ * @param string $page
* @return string
*/
protected function getDocUrl( $page ) {
* There must be a config-install-$name message defined per step, which will
* be shown on install.
*
- * @param $installer DatabaseInstaller so we can make callbacks
+ * @param DatabaseInstaller $installer DatabaseInstaller so we can make callbacks
* @return array
*/
protected function getInstallSteps( DatabaseInstaller $installer ) {
* @param array $startCB A callback array for the beginning of each step
* @param array $endCB A callback array for the end of each step
*
- * @return Array of Status objects
+ * @return array Array of Status objects
*/
public function performInstallation( $startCB, $endCB ) {
$installResults = array();
* Generate a secret value for variables using our CryptRand generator.
* Produce a warning if the random source was insecure.
*
- * @param $keys Array
+ * @param array $keys
* @return Status
*/
protected function doGenerateKeys( $keys ) {
}
/**
- * @param $s Status
+ * @param Status $s
*/
private function subscribeToMediaWikiAnnounce( Status $s ) {
$params = array(
/**
* Insert Main Page with default content.
*
- * @param $installer DatabaseInstaller
+ * @param DatabaseInstaller $installer
* @return Status
*/
protected function createMainpage( DatabaseInstaller $installer ) {
*
* @param array $callback A valid installation callback array, in this form:
* array( 'name' => 'some-unique-name', 'callback' => array( $obj, 'function' ) );
- * @param string $findStep the step to find. Omit to put the step at the beginning
+ * @param string $findStep The step to find. Omit to put the step at the beginning
*/
public function addInstallStep( $callback, $findStep = 'BEGINNING' ) {
$this->extraInstallSteps[$findStep][] = $callback;
/**
* Constructor.
*
- * @param $installer Installer subclass
+ * @param Installer $installer
*/
public function __construct( Installer $installer ) {
$this->installer = $installer;
/**
* Returns the escaped version of a string of php code.
*
- * @param $string String
+ * @param string $string
*
- * @return String
+ * @return string
*/
public static function escapePhpString( $string ) {
if ( is_array( $string ) || is_object( $string ) ) {
* Return the full text of the generated LocalSettings.php file,
* including the extensions
*
- * @return String
+ * @return string
*/
public function getText() {
$localSettings = $this->getDefaultText();
}
/**
- * @return String
+ * @return string
*/
protected function buildMemcachedServerList() {
$servers = $this->values['_MemCachedServers'];
}
/**
- * @return String
+ * @return string
*/
protected function getDefaultText() {
if ( !$this->values['wgImageMagickConvertCommand'] ) {
}
/**
- * @return Bool
+ * @return bool
*/
public function isCompiled() {
return self::checkExtension( 'sqlsrv' );
/**
* Try to see if the login exists
* @param string $user Username to check
- * @return boolean
+ * @return bool
*/
private function loginExists( $user ) {
$res = $this->db->selectField( 'sys.sql_logins', 1, array( 'name' => $user ) );
* Try to see if the user account exists
* We assume we already have the appropriate database selected
* @param string $user Username to check
- * @return boolean
+ * @return bool
*/
private function userExists( $user ) {
$res = $this->db->selectField( 'sys.sysusers', 1, array( 'name' => $user ) );
/**
* Try to see if a given database exists
* @param string $dbName Database name to check
- * @return boolean
+ * @return bool
*/
private function databaseExists( $dbName ) {
$res = $this->db->selectField( 'sys.databases', 1, array( 'name' => $dbName ) );
* Try to see if a given schema exists
* We assume we already have the appropriate database selected
* @param string $schemaName Schema name to check
- * @return boolean
+ * @return bool
*/
private function schemaExists( $schemaName ) {
$res = $this->db->selectField( 'sys.schemas', 1, array( 'name' => $schemaName ) );
* Try to see if a given fulltext catalog exists
* We assume we already have the appropriate database selected
* @param string $schemaName Catalog name to check
- * @return boolean
+ * @return bool
*/
private function catalogExists( $catalogName ) {
$res = $this->db->selectField( 'sys.fulltext_catalogs', 1, array( 'name' => $catalogName ) );
}
/**
- * @return Bool
+ * @return bool
*/
public function isCompiled() {
return self::checkExtension( 'mysql' ) || self::checkExtension( 'mysqli' );
* Return a formal 'User'@'Host' username for use in queries
* @param string $name Username, quotes will be added
* @param string $host Hostname, quotes will be added
- * @return String
+ * @return string
*/
private function buildFullUserName( $name, $host ) {
return $this->db->addQuotes( $name ) . '@' . $this->db->addQuotes( $host );
* access to mysql.user, so false means "no" or "maybe"
* @param string $host Hostname to check
* @param string $user Username to check
- * @return boolean
+ * @return bool
*/
private function userDefinitelyExists( $host, $user ) {
try {
* Return any table options to be applied to all tables that don't
* override them.
*
- * @return String
+ * @return string
*/
protected function getTableOptions() {
$options = array();
/**
* Overload: after this action field info table has to be rebuilt
*
- * @param $what array
+ * @param array $what
*/
public function doUpdates( $what = array( 'core', 'extensions', 'purge', 'stats' ) ) {
parent::doUpdates( $what );
* - create-tables: A connection with a role suitable for creating tables.
*
* @throws MWException
- * @return Status object. On success, a connection object will be in the
- * value member.
+ * @return Status On success, a connection object will be in the value member.
*/
protected function openPgConnection( $type ) {
switch ( $type ) {
/**
* Recursive helper for canCreateObjectsForWebUser().
- * @param $conn DatabaseBase object
+ * @param DatabaseBase $conn
* @param int $targetMember Role ID of the member to look for
* @param int $group Role ID of the group to look for
* @param int $maxDepth Maximum recursive search depth
/**
*
- * @return Status:
+ * @return Status
*/
public function checkPrerequisites() {
$result = Status::newGood();
/**
* Safe wrapper for PHP's realpath() that fails gracefully if it's unable to canonicalize the path.
*
- * @param $path string
+ * @param string $path
*
* @return string
*/
}
/**
- * @param $dir
- * @param $create bool
+ * @param string $dir
+ * @param bool $create
* @return Status
*/
private static function dataDirOKmaybeCreate( $dir, $create = false ) {
}
/**
- * @param $status Status
+ * @param Status $status
* @return Status
*/
public function setupSearchIndex( &$status ) {
/**
* Show an error message in a box. Parameters are like wfMessage().
- * @param $msg
+ * @param string $msg
*/
public function showError( $msg /*...*/ ) {
$args = func_get_args();
* Get small text indented help for a preceding form field.
* Parameters like wfMessage().
*
- * @param $msg
+ * @param string $msg
* @return string
*/
public function getHelpBox( $msg /*, ... */ ) {
* Label a control by wrapping a config-input div around it and putting a
* label before it.
*
- * @param $msg
- * @param $forId
- * @param $contents
+ * @param string $msg
+ * @param string $forId
+ * @param string $contents
* @param string $helpData
* @return string
*/
}
/**
- * @return String
+ * @return string
*/
protected function envGetDefaultServer() {
return WebRequest::detectServer();
/**
* Buffered contents that haven't been output yet
- * @var String
+ * @var string
*/
private $contents = '';
*
* @param string $dir 'ltr' or 'rtl'
*
- * @return String
+ * @return string
*/
public function getCSS( $dir ) {
// All CSS files these modules reference will be concatenated in sequence
/**
* "<link>" to index.php?css=foobar for the "<head>"
*
- * @return String
+ * @return string
*/
private function getCssUrl() {
return Html::linkedStyle( $_SERVER['PHP_SELF'] . '?css=' . $this->getDir() );