Use OCI_NO_AUTO_COMMIT instead of OCI_DEFAULT

This constant is not recognized by PHPStan, and besides the docs say
this:

> Prior to PHP 5.3.2 (PECL OCI8 1.4) use OCI_DEFAULT which is equivalent
to OCI_NO_AUTO_COMMIT.

See https://www.php.net/manual/en/function.oci-execute.php
parent 155d028b
...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Driver\OCI8; ...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Driver\OCI8;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\AbstractOracleDriver; use Doctrine\DBAL\Driver\AbstractOracleDriver;
use const OCI_DEFAULT; use const OCI_NO_AUTO_COMMIT;
/** /**
* A Doctrine DBAL driver for the Oracle OCI8 PHP extensions. * A Doctrine DBAL driver for the Oracle OCI8 PHP extensions.
...@@ -22,7 +22,7 @@ class Driver extends AbstractOracleDriver ...@@ -22,7 +22,7 @@ class Driver extends AbstractOracleDriver
(string) $password, (string) $password,
$this->_constructDsn($params), $this->_constructDsn($params),
$params['charset'] ?? '', $params['charset'] ?? '',
$params['sessionMode'] ?? OCI_DEFAULT, $params['sessionMode'] ?? OCI_NO_AUTO_COMMIT,
$params['persistent'] ?? false $params['persistent'] ?? false
); );
} catch (OCI8Exception $e) { } catch (OCI8Exception $e) {
......
...@@ -7,7 +7,6 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection; ...@@ -7,7 +7,6 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use UnexpectedValueException; use UnexpectedValueException;
use const OCI_COMMIT_ON_SUCCESS; use const OCI_COMMIT_ON_SUCCESS;
use const OCI_DEFAULT;
use const OCI_NO_AUTO_COMMIT; use const OCI_NO_AUTO_COMMIT;
use function addcslashes; use function addcslashes;
use function func_get_args; use function func_get_args;
...@@ -51,7 +50,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection ...@@ -51,7 +50,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
$password, $password,
$db, $db,
$charset = '', $charset = '',
$sessionMode = OCI_DEFAULT, $sessionMode = OCI_NO_AUTO_COMMIT,
$persistent = false $persistent = false
) { ) {
$dbh = $persistent $dbh = $persistent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment