$charset = \Config::get('db.'.\Fuel::$env.'.charset', null);
Harro Verton wrote on Tuesday 8th of November 2011:If DBUtil::create_table() is called without explicitly defining the charset, the charset will be loaded from the database config, like so:
$charset = \Config::get('db.'.\Fuel::$env.'.charset', null);
This means your environment must be defined correctly for it to pick up the correct charset. If your tables are created using the databases default characterset, that indicates that the configured charset could not be determined.
Harro Verton wrote on Tuesday 8th of November 2011:See http://fuelphp.com/dev-docs/general/environments.html The official docs are in sync with the current released version, which is 1.0.1, where it worked a bit differently.
FUEL_ENVfor virtual host I'm developing on, so the framework assumes that I'm in
Fuel::DEVELOPMENT, which is OK, and I have set an extra key/value pair
'charset' => 'utf8'in
fuel/app/config/development/db.phpunder "default" key. So, oil now creates tables with default charset=utf8 and this is exactly what I wanted. All this is needed for me because I'm trying to rewrite using FuelPHP a rather big legacy application so I would, for the sake of simplicity, need to have old tables beside new ones (created by oil) in the same DB working in parallel until all portions of application get reworked on. Thanks again!
return array( 'default' => array( 'connection' => array( 'dsn' => 'mysql:host=localhost;dbname=fuel', 'username' => 'fuel', 'password' => 'fuel', ), ), );Keys are merged with ones in config/db.php and lives in db.default not in db.development.
It looks like you're new here. If you want to get involved, click one of these buttons!