Revize c1bdc1c4
Přidáno uživatelem Michal Kliment před více než 9 roky(ů)
system/libraries/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
Release 1.1.0