driver option付きでZend DBを接続した事がないので私も興味深い質問です。
ソースを追ってみると例えばPDO MYSQLで接続している場合
Zend_Db_Adapter_Pdo_Mysqlの protected function _connect()に
php
1$this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_INIT_COMMAND
その親のZend_Db_Adapter_Pdo_Abstractのprotected function _connect()
php
1 // add the persistence flag if we find it in our config array
2 if (isset($this->_config['persistent']) && ($this->_config['persistent'] == true)) {
3 $this->_config['driver_options'][PDO::ATTR_PERSISTENT] = true;
4 }
のような記載がありどちらもPDOで定義済みの定数
class PDO に
const MYSQL_ATTR_LOCAL_INFILE = 1001;
と定義がありますので
application.iniで
ini
1db.adapter = Pdo_Mysql
2db.params.host = localhost
3db.params.username = XXXX
4db.params.password = YYYY
5db.params.dbname = ZZZZ
6db.params.charset = utf8
7db.params.driver_options.1001 = true
8
としてDBアダプターをvar_dumoしてみると
["driver_options"]=>
array(2) {
[1001]=>
string(1) "1"
[1002]=>
string(16) "SET NAMES 'utf8'"
}
となります、これで--local-infileオプション効かないでしょうか?stringになっているところが少しきになりますが、、、、
私もdriver_optionsの指定知りたいので結果教えてください。
ちなみに
db.adapter = Mysqli
にしていたら
db.params.driver_options.MYSQLI_OPT_LOCAL_INFILE=1
が同様の処理になると思います。