codeigniter フレームワークの stored_procedure 関数を使用して、PDF ファイルを db oracle (パスではなく) に直接保存しようとしています。
oci8_driver.php ファイルの _execute() 関数を変更し、これを追加しました
protected function _execute($sql)
{
$this->stmt_id = FALSE;
$this->_set_stmt_id($sql);
$blob=FALSE;
$myarray=array();
$myarray = $this->binds;
if (is_array($myarray)) {
foreach ($myarray as $value) {
if ($value['type'] === 113 )
{
$this->lob = oci_new_descriptor($this->conn_id, OCI_D_LOB);
$blob=TRUE;
} }
...........
..................
.....
$exec_worked = ociexecute($this->stmt_id, $this->_commit);
if (is_array($myarray)) {
foreach ($myarray as $value) {
if ($value['type'] === 113 )
{
oci_execute($this->stmt_id, OCI_DEFAULT);
if($blob)
{
$this->lob->savefile($value['value'] );
oci_commit($this->conn_id);
}
}
}
この行を追加して、同じファイル内の _bind_param() 関数を変更します
if ($param['type'] === 113)
oci_bind_by_name($this->stmt_id , $param['name'], $this->lob, $param['length'], OCI_B_BLOB);
しかし、問題はファイルを2回保存することです...手順自体をテストし、モデル関数はすべて1回実行されたことを示しています。重複がどこで発生するかわかりません
私の変更が問題の原因ですか、どうすればよいですか?