Revize 2274
Přidáno uživatelem Ondřej Fibich před téměř 11 roky(ů)
Database.php | ||
---|---|---|
{
|
||
$this->config['benchmark'] = ($is_on === TRUE);
|
||
}
|
||
|
||
/**
|
||
* Gets value of database variable. If variable not present in the database
|
||
* NULL is returned.
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @param string $name Variable name
|
||
* @return string|null
|
||
*/
|
||
public function get_variable_value($name)
|
||
{
|
||
$result = $this->query("SHOW VARIABLES LIKE ?", $name);
|
||
|
||
if ($result->count() == 1)
|
||
{
|
||
$o = $result->current();
|
||
|
||
if (isset($o->Value))
|
||
{
|
||
return $o->Value;
|
||
}
|
||
}
|
||
|
||
return NULL;
|
||
}
|
||
|
||
/**
|
||
* Alterch character set amd collate of database to given values.
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @param string $db_name Database name
|
||
* @param string $set Character set name
|
||
* @param string $collate Collate name
|
||
*/
|
||
public function alter_db_character_set($db_name, $set, $collate)
|
||
{
|
||
$db_name = $this->escape_table($db_name);
|
||
|
||
$this->query("ALTER DATABASE $db_name DEFAULT CHARACTER SET ? COLLATE ?", array
|
||
(
|
||
$set, $collate
|
||
));
|
||
}
|
||
|
||
} // End Database Class
|
||
|
Také k dispozici: Unified diff
Merge 1.1 do trunku (1.1 je aktualni stabilni verze)