system/database/drivers/oci8/oci8_driver.php line 80 db_connect() function did not support set the charset and session mode while connecting to oracle db.
function db_connect()
{
return @ocilogon($this->username, $this->password, $this->hostname);
}
function db_pconnect()
{
return @ocilogon($this->username, $this->password, $this->hostname);
}
here is the prototype of oci_connect( ocilogon improved version )
resource oci_connect ( string $username , string $password [, string $db [, string $charset [, int $session_mode ]]] )
codeigniter最新的2.0.1太蛋疼鸟。system/database/drivers/oci8/oci8_driver.php里面的db_connect()和db_pconnect()函数尽然不支持连接的时候设定字符集,因为函数的原形ocilogon(被oci_connect代替)支持设定charset和session_mode。还有codeigniter为啥要使用@ocilogon而非oci_connect呢?php官方说5.0.0以前的版本才使用ocilogon,codeigniter为了使用ocilogon不报warning还前面加上了”@”符号。但是codeigniter声称是支持php 5.1.6以及以后版本的php框架。有点搞不懂codeigniter的想法了。
没有版本,这个问题,只有通过hard coding修改oci8_driver.php文件的db_connect()和db_pconnect()函数为:
function db_connect()
{
return @ociplogon($this->username, $this->password, $this->hostname, $this->char_set);
}
function db_pconnect()
{
return @ociplogon($this->username, $this->password, $this->hostname, $this->char_set);
}
已经将这个问题提交到
bitbucket。