Я пытаюсь сохранить файл PDF непосредственно в db oracle (а не путь) функцией stored_procedure в frameworkignign framework
Я изменил функцию _execute() в файле oci8_driver.php и добавлю это
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);
but the problem is it save files twice ...i test the procedure itself and the model function all show that it executed one time, i don't know where the duplication occur
Мое изменение вызывает проблему и что я должен делать?