Skip to content

Commit

Permalink
Make client charset configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vandemaele committed Dec 2, 2021
1 parent f77b0fe commit 9184c7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/Skeleton/Database/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,12 @@ class Config {
* @var boolean $auto_null
*/
public static $auto_null = false;

/**
* Define the client character set.
*
* @access public
* @var string $charset
*/
public static $charset = 'utf8';
}
2 changes: 1 addition & 1 deletion lib/Skeleton/Database/Driver/Mysqli/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function connect() {
throw new \Exception('Could not connect to database: ' . $this->database->connect_error);
}

$this->database->set_charset('utf8');
$this->database->set_charset(\Skeleton\Database\Config::$charset);
$this->connected = true;
}

Expand Down

0 comments on commit 9184c7c

Please sign in to comment.