composer update
This commit is contained in:
@@ -1,21 +1,4 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8;
|
||||
|
||||
@@ -25,9 +8,6 @@ use const OCI_DEFAULT;
|
||||
|
||||
/**
|
||||
* A Doctrine DBAL driver for the Oracle OCI8 PHP extensions.
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @since 2.0
|
||||
*/
|
||||
class Driver extends AbstractOracleDriver
|
||||
{
|
||||
@@ -53,7 +33,7 @@ class Driver extends AbstractOracleDriver
|
||||
/**
|
||||
* Constructs the Oracle DSN.
|
||||
*
|
||||
* @param array $params
|
||||
* @param mixed[] $params
|
||||
*
|
||||
* @return string The DSN.
|
||||
*/
|
||||
|
||||
@@ -1,27 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8;
|
||||
|
||||
use Doctrine\DBAL\Driver\Connection;
|
||||
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use UnexpectedValueException;
|
||||
use const OCI_COMMIT_ON_SUCCESS;
|
||||
use const OCI_DEFAULT;
|
||||
use const OCI_NO_AUTO_COMMIT;
|
||||
@@ -43,19 +27,13 @@ use function str_replace;
|
||||
|
||||
/**
|
||||
* OCI8 implementation of the Connection interface.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
/** @var resource */
|
||||
protected $dbh;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $executeMode = OCI_COMMIT_ON_SUCCESS;
|
||||
|
||||
/**
|
||||
@@ -72,7 +50,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
*/
|
||||
public function __construct($username, $password, $db, $charset = null, $sessionMode = OCI_DEFAULT, $persistent = false)
|
||||
{
|
||||
if (!defined('OCI_NO_AUTO_COMMIT')) {
|
||||
if (! defined('OCI_NO_AUTO_COMMIT')) {
|
||||
define('OCI_NO_AUTO_COMMIT', 0);
|
||||
}
|
||||
|
||||
@@ -80,7 +58,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
? @oci_pconnect($username, $password, $db, $charset, $sessionMode)
|
||||
: @oci_connect($username, $password, $db, $charset, $sessionMode);
|
||||
|
||||
if ( ! $this->dbh) {
|
||||
if (! $this->dbh) {
|
||||
throw OCI8Exception::fromErrorInfo(oci_error());
|
||||
}
|
||||
}
|
||||
@@ -88,13 +66,13 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @throws \UnexpectedValueException if the version string returned by the database server
|
||||
* does not contain a parsable version number.
|
||||
* @throws UnexpectedValueException If the version string returned by the database server
|
||||
* does not contain a parsable version number.
|
||||
*/
|
||||
public function getServerVersion()
|
||||
{
|
||||
if ( ! preg_match('/\s+(\d+\.\d+\.\d+\.\d+\.\d+)\s+/', oci_server_version($this->dbh), $version)) {
|
||||
throw new \UnexpectedValueException(
|
||||
if (! preg_match('/\s+(\d+\.\d+\.\d+\.\d+\.\d+)\s+/', oci_server_version($this->dbh), $version)) {
|
||||
throw new UnexpectedValueException(
|
||||
sprintf(
|
||||
'Unexpected database version string "%s". Cannot parse an appropriate version number from it. ' .
|
||||
'Please report this database version string to the Doctrine team.',
|
||||
@@ -128,7 +106,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
public function query()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$sql = $args[0];
|
||||
$sql = $args[0];
|
||||
//$fetchMode = $args[1];
|
||||
$stmt = $this->prepare($sql);
|
||||
$stmt->execute();
|
||||
@@ -174,7 +152,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
$result = $stmt->fetchColumn();
|
||||
|
||||
if ($result === false) {
|
||||
throw new OCI8Exception("lastInsertId failed: Query was executed but no result was returned.");
|
||||
throw new OCI8Exception('lastInsertId failed: Query was executed but no result was returned.');
|
||||
}
|
||||
|
||||
return (int) $result;
|
||||
@@ -205,7 +183,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
if (!oci_commit($this->dbh)) {
|
||||
if (! oci_commit($this->dbh)) {
|
||||
throw OCI8Exception::fromErrorInfo($this->errorInfo());
|
||||
}
|
||||
$this->executeMode = OCI_COMMIT_ON_SUCCESS;
|
||||
@@ -218,7 +196,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
|
||||
*/
|
||||
public function rollBack()
|
||||
{
|
||||
if (!oci_rollback($this->dbh)) {
|
||||
if (! oci_rollback($this->dbh)) {
|
||||
throw OCI8Exception::fromErrorInfo($this->errorInfo());
|
||||
}
|
||||
$this->executeMode = OCI_COMMIT_ON_SUCCESS;
|
||||
|
||||
@@ -1,21 +1,4 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8;
|
||||
|
||||
@@ -24,7 +7,7 @@ use Doctrine\DBAL\Driver\AbstractDriverException;
|
||||
class OCI8Exception extends AbstractDriverException
|
||||
{
|
||||
/**
|
||||
* @param array $error
|
||||
* @param mixed[] $error
|
||||
*
|
||||
* @return \Doctrine\DBAL\Driver\OCI8\OCI8Exception
|
||||
*/
|
||||
|
||||
@@ -1,21 +1,4 @@
|
||||
<?php
|
||||
/*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the MIT license. For more information, see
|
||||
* <http://www.doctrine-project.org>.
|
||||
*/
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8;
|
||||
|
||||
@@ -23,7 +6,9 @@ use Doctrine\DBAL\Driver\Statement;
|
||||
use Doctrine\DBAL\Driver\StatementIterator;
|
||||
use Doctrine\DBAL\FetchMode;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use InvalidArgumentException;
|
||||
use IteratorAggregate;
|
||||
use PDO;
|
||||
use const OCI_ASSOC;
|
||||
use const OCI_B_BIN;
|
||||
use const OCI_B_BLOB;
|
||||
@@ -59,35 +44,22 @@ use function substr;
|
||||
|
||||
/**
|
||||
* The OCI8 implementation of the Statement interface.
|
||||
*
|
||||
* @since 2.0
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class OCI8Statement implements IteratorAggregate, Statement
|
||||
{
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
/** @var resource */
|
||||
protected $_dbh;
|
||||
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
/** @var resource */
|
||||
protected $_sth;
|
||||
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Driver\OCI8\OCI8Connection
|
||||
*/
|
||||
/** @var OCI8Connection */
|
||||
protected $_conn;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
/** @var string */
|
||||
protected static $_PARAM = ':param';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
/** @var int[] */
|
||||
protected static $fetchModeMap = [
|
||||
FetchMode::MIXED => OCI_BOTH,
|
||||
FetchMode::ASSOCIATIVE => OCI_ASSOC,
|
||||
@@ -95,14 +67,10 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
FetchMode::COLUMN => OCI_NUM,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
/** @var int */
|
||||
protected $_defaultFetchMode = FetchMode::MIXED;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
/** @var string[] */
|
||||
protected $_paramMap = [];
|
||||
|
||||
/**
|
||||
@@ -110,7 +78,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
*
|
||||
* This is a new requirement for PHP7's oci8 extension that prevents bound values from being garbage collected.
|
||||
*
|
||||
* @var array
|
||||
* @var mixed[]
|
||||
*/
|
||||
private $boundValues = [];
|
||||
|
||||
@@ -124,17 +92,16 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
/**
|
||||
* Creates a new OCI8Statement that uses the given connection handle and SQL statement.
|
||||
*
|
||||
* @param resource $dbh The connection handle.
|
||||
* @param string $statement The SQL statement.
|
||||
* @param \Doctrine\DBAL\Driver\OCI8\OCI8Connection $conn
|
||||
* @param resource $dbh The connection handle.
|
||||
* @param string $statement The SQL statement.
|
||||
*/
|
||||
public function __construct($dbh, $statement, OCI8Connection $conn)
|
||||
{
|
||||
list($statement, $paramMap) = self::convertPositionalToNamedPlaceholders($statement);
|
||||
$this->_sth = oci_parse($dbh, $statement);
|
||||
$this->_dbh = $dbh;
|
||||
$this->_paramMap = $paramMap;
|
||||
$this->_conn = $conn;
|
||||
[$statement, $paramMap] = self::convertPositionalToNamedPlaceholders($statement);
|
||||
$this->_sth = oci_parse($dbh, $statement);
|
||||
$this->_dbh = $dbh;
|
||||
$this->_paramMap = $paramMap;
|
||||
$this->_conn = $conn;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,22 +116,23 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
* Question marks inside literal strings are therefore handled correctly by this method.
|
||||
* This comes at a cost, the whole sql statement has to be looped over.
|
||||
*
|
||||
* @todo extract into utility class in Doctrine\DBAL\Util namespace
|
||||
* @todo review and test for lost spaces. we experienced missing spaces with oci8 in some sql statements.
|
||||
*
|
||||
* @param string $statement The SQL statement to convert.
|
||||
*
|
||||
* @return array [0] => the statement value (string), [1] => the paramMap value (array).
|
||||
* @throws \Doctrine\DBAL\Driver\OCI8\OCI8Exception
|
||||
* @return mixed[] [0] => the statement value (string), [1] => the paramMap value (array).
|
||||
*
|
||||
* @throws OCI8Exception
|
||||
*
|
||||
* @todo extract into utility class in Doctrine\DBAL\Util namespace
|
||||
* @todo review and test for lost spaces. we experienced missing spaces with oci8 in some sql statements.
|
||||
*/
|
||||
public static function convertPositionalToNamedPlaceholders($statement)
|
||||
{
|
||||
$fragmentOffset = $tokenOffset = 0;
|
||||
$fragments = $paramMap = [];
|
||||
$fragmentOffset = $tokenOffset = 0;
|
||||
$fragments = $paramMap = [];
|
||||
$currentLiteralDelimiter = null;
|
||||
|
||||
do {
|
||||
if (!$currentLiteralDelimiter) {
|
||||
if (! $currentLiteralDelimiter) {
|
||||
$result = self::findPlaceholderOrOpeningQuote(
|
||||
$statement,
|
||||
$tokenOffset,
|
||||
@@ -186,7 +154,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
}
|
||||
|
||||
$fragments[] = substr($statement, $fragmentOffset);
|
||||
$statement = implode('', $fragments);
|
||||
$statement = implode('', $fragments);
|
||||
|
||||
return [$statement, $paramMap];
|
||||
}
|
||||
@@ -201,6 +169,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
* @param string|null $currentLiteralDelimiter The delimiter of the current string literal
|
||||
* or NULL if not currently in a literal
|
||||
* @param array<int, string> $paramMap Mapping of the original parameter positions to their named replacements
|
||||
*
|
||||
* @return bool Whether the token was found
|
||||
*/
|
||||
private static function findPlaceholderOrOpeningQuote(
|
||||
@@ -213,18 +182,18 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
) {
|
||||
$token = self::findToken($statement, $tokenOffset, '/[?\'"]/');
|
||||
|
||||
if (!$token) {
|
||||
if (! $token) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($token === '?') {
|
||||
$position = count($paramMap) + 1;
|
||||
$param = ':param' . $position;
|
||||
$fragments[] = substr($statement, $fragmentOffset, $tokenOffset - $fragmentOffset);
|
||||
$fragments[] = $param;
|
||||
$position = count($paramMap) + 1;
|
||||
$param = ':param' . $position;
|
||||
$fragments[] = substr($statement, $fragmentOffset, $tokenOffset - $fragmentOffset);
|
||||
$fragments[] = $param;
|
||||
$paramMap[$position] = $param;
|
||||
$tokenOffset += 1;
|
||||
$fragmentOffset = $tokenOffset;
|
||||
$tokenOffset += 1;
|
||||
$fragmentOffset = $tokenOffset;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -242,6 +211,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
* @param string $tokenOffset The offset to start searching from
|
||||
* @param string|null $currentLiteralDelimiter The delimiter of the current string literal
|
||||
* or NULL if not currently in a literal
|
||||
*
|
||||
* @return bool Whether the token was found
|
||||
*/
|
||||
private static function findClosingQuote(
|
||||
@@ -255,7 +225,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
'/' . preg_quote($currentLiteralDelimiter, '/') . '/'
|
||||
);
|
||||
|
||||
if (!$token) {
|
||||
if (! $token) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -272,6 +242,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
* @param string $statement The SQL statement to parse
|
||||
* @param string $offset The offset to start searching from
|
||||
* @param string $regex The regex containing token pattern
|
||||
*
|
||||
* @return string|null Token or NULL if not found
|
||||
*/
|
||||
private static function findToken($statement, &$offset, $regex)
|
||||
@@ -340,7 +311,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
public function closeCursor()
|
||||
{
|
||||
// not having the result means there's nothing to close
|
||||
if (!$this->result) {
|
||||
if (! $this->result) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -397,7 +368,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
}
|
||||
|
||||
$ret = @oci_execute($this->_sth, $this->_conn->getExecuteMode());
|
||||
if ( ! $ret) {
|
||||
if (! $ret) {
|
||||
throw OCI8Exception::fromErrorInfo($this->errorInfo());
|
||||
}
|
||||
|
||||
@@ -427,11 +398,11 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fetch($fetchMode = null, $cursorOrientation = \PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
|
||||
public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEXT, $cursorOffset = 0)
|
||||
{
|
||||
// do not try fetching from the statement if it's not expected to contain result
|
||||
// in order to prevent exceptional situation
|
||||
if (!$this->result) {
|
||||
if (! $this->result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -446,7 +417,7 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
}
|
||||
|
||||
if (! isset(self::$fetchModeMap[$fetchMode])) {
|
||||
throw new \InvalidArgumentException("Invalid fetch style: " . $fetchMode);
|
||||
throw new InvalidArgumentException('Invalid fetch style: ' . $fetchMode);
|
||||
}
|
||||
|
||||
return oci_fetch_array(
|
||||
@@ -472,8 +443,8 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ( ! isset(self::$fetchModeMap[$fetchMode])) {
|
||||
throw new \InvalidArgumentException("Invalid fetch style: " . $fetchMode);
|
||||
if (! isset(self::$fetchModeMap[$fetchMode])) {
|
||||
throw new InvalidArgumentException('Invalid fetch style: ' . $fetchMode);
|
||||
}
|
||||
|
||||
if (self::$fetchModeMap[$fetchMode] === OCI_BOTH) {
|
||||
@@ -489,12 +460,17 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
|
||||
// do not try fetching from the statement if it's not expected to contain result
|
||||
// in order to prevent exceptional situation
|
||||
if (!$this->result) {
|
||||
if (! $this->result) {
|
||||
return [];
|
||||
}
|
||||
|
||||
oci_fetch_all($this->_sth, $result, 0, -1,
|
||||
self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS);
|
||||
oci_fetch_all(
|
||||
$this->_sth,
|
||||
$result,
|
||||
0,
|
||||
-1,
|
||||
self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS
|
||||
);
|
||||
|
||||
if ($fetchMode === FetchMode::COLUMN) {
|
||||
$result = $result[0];
|
||||
@@ -511,13 +487,13 @@ class OCI8Statement implements IteratorAggregate, Statement
|
||||
{
|
||||
// do not try fetching from the statement if it's not expected to contain result
|
||||
// in order to prevent exceptional situation
|
||||
if (!$this->result) {
|
||||
if (! $this->result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$row = oci_fetch_array($this->_sth, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS);
|
||||
|
||||
if (false === $row) {
|
||||
if ($row === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user