return$this->bail("We're updating the database, please try back in 5 minutes. If you are posting to your blog please hit the refresh button on your browser in a few minutes to post the data again. It will be posted as soon as the database is back online again.");
returnnewWP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.1.2 or higher'),$wp_version));
}
/**
* This function is called when WordPress is generating the table schema to determine wether or not the current database
* supports or needs the collation statements.
* The additional argument allows the caller to check a specific database.
* @return bool
*/
functionsupports_collation($dbh_or_table=false){
return$this->has_cap('collation',$dbh_or_table);
}
/**
* Generic function to determine if a database supports a particular feature
* The additional argument allows the caller to check a specific database.
* @param string $db_cap the feature
* @param false|string|resource $dbh_or_table the databaese (the current database, the database housing the specified table, or the database of the mysql resource)
* @return bool
*/
functionhas_cap($db_cap,$dbh_or_table=false){
$version=$this->db_version($dbh_or_table);
switch(strtolower($db_cap)):
case'collation':
case'group_concat':
case'subqueries':
returnversion_compare($version,'4.1','>=');
break;
endswitch;
returnfalse;
}
/**
* The database version number
* @param false|string|resource $dbh_or_table the databaese (the current database, the database housing the specified table, or the database of the mysql resource)
* @return false|string false on failure, version number on success
*/
functiondb_version($dbh_or_table=false){
if(!$dbh_or_table&&$this->dbh)
$dbh=&$this->dbh;
elseif(is_resource($dbh_or_table))
$dbh=&$dbh_or_table;
else
$dbh=$this->db_connect("SELECT FROM $dbh_or_table$this->users");