From 05e38eadbeb3de19e5b26003c2b401e00bb71df4 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 18 Oct 2026 00:08:23 +0200 Subject: =?UTF-8?q?sortie=20de=20vendor=20du=20d=C3=A9p=C3=B4t,=20oubli=20?= =?UTF-8?q?dans=20config-template.ini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doctrine/dbal/src/Driver/IBMDB2/Statement.php | 156 --------------------- 1 file changed, 156 deletions(-) delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php (limited to 'vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php') diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php deleted file mode 100644 index 96852da..0000000 --- a/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php +++ /dev/null @@ -1,156 +0,0 @@ - - */ - private array $lobs = []; - - /** - * @internal The statement can be only instantiated by its driver connection. - * - * @param resource $stmt - */ - public function __construct(private readonly mixed $stmt) - { - } - - public function bindValue(int|string $param, mixed $value, ParameterType $type): void - { - assert(is_int($param)); - - switch ($type) { - case ParameterType::INTEGER: - $this->bind($param, $value, DB2_PARAM_IN, DB2_LONG); - break; - - case ParameterType::LARGE_OBJECT: - $this->lobs[$param] = &$value; - break; - - default: - $this->bind($param, $value, DB2_PARAM_IN, DB2_CHAR); - break; - } - } - - /** @throws Exception */ - private function bind(int $position, mixed &$variable, int $parameterType, int $dataType): void - { - $this->parameters[$position] =& $variable; - - if (! db2_bind_param($this->stmt, $position, '', $parameterType, $dataType)) { - throw StatementError::new($this->stmt); - } - } - - public function execute(): Result - { - $handles = $this->bindLobs(); - - $result = @db2_execute($this->stmt, $this->parameters); - - foreach ($handles as $handle) { - fclose($handle); - } - - $this->lobs = []; - - if ($result === false) { - throw StatementError::new($this->stmt); - } - - return new Result($this->stmt); - } - - /** - * @return list - * - * @throws Exception - */ - private function bindLobs(): array - { - $handles = []; - - foreach ($this->lobs as $param => $value) { - if (is_resource($value)) { - $handle = $handles[] = $this->createTemporaryFile(); - $path = stream_get_meta_data($handle)['uri']; - - $this->copyStreamToStream($value, $handle); - - $this->bind($param, $path, DB2_PARAM_FILE, DB2_BINARY); - } else { - $this->bind($param, $value, DB2_PARAM_IN, DB2_CHAR); - } - - unset($value); - } - - return $handles; - } - - /** - * @return resource - * - * @throws Exception - */ - private function createTemporaryFile() - { - $handle = @tmpfile(); - - if ($handle === false) { - throw CannotCreateTemporaryFile::new(error_get_last()); - } - - return $handle; - } - - /** - * @param resource $source - * @param resource $target - * - * @throws Exception - */ - private function copyStreamToStream($source, $target): void - { - if (@stream_copy_to_stream($source, $target) === false) { - throw CannotCopyStreamToStream::new(error_get_last()); - } - } -} -- cgit v1.2.3