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/Connection.php | 131 ----------------- .../dbal/src/Driver/IBMDB2/DataSourceName.php | 80 ----------- vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php | 41 ------ .../IBMDB2/Exception/CannotCopyStreamToStream.php | 27 ---- .../IBMDB2/Exception/CannotCreateTemporaryFile.php | 27 ---- .../Driver/IBMDB2/Exception/ConnectionError.php | 29 ---- .../Driver/IBMDB2/Exception/ConnectionFailed.php | 28 ---- .../dbal/src/Driver/IBMDB2/Exception/Factory.php | 35 ----- .../src/Driver/IBMDB2/Exception/PrepareFailed.php | 25 ---- .../src/Driver/IBMDB2/Exception/StatementError.php | 34 ----- vendor/doctrine/dbal/src/Driver/IBMDB2/Result.php | 106 -------------- .../doctrine/dbal/src/Driver/IBMDB2/Statement.php | 156 --------------------- 12 files changed, 719 deletions(-) delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionError.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/ConnectionFailed.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/Factory.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/PrepareFailed.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/StatementError.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Result.php delete mode 100644 vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php (limited to 'vendor/doctrine/dbal/src/Driver/IBMDB2') diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php deleted file mode 100644 index 2c8783b..0000000 --- a/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php +++ /dev/null @@ -1,131 +0,0 @@ -connection); - assert($serverInfo instanceof stdClass); - - return $serverInfo->DBMS_VER; - } - - public function prepare(string $sql): Statement - { - $stmt = @db2_prepare($this->connection, $sql); - - if ($stmt === false) { - throw PrepareFailed::new(error_get_last()); - } - - return new Statement($stmt); - } - - public function query(string $sql): Result - { - return $this->prepare($sql)->execute(); - } - - public function quote(string $value): string - { - return "'" . db2_escape_string($value) . "'"; - } - - public function exec(string $sql): int|string - { - $stmt = @db2_exec($this->connection, $sql); - - if ($stmt === false) { - throw StatementError::new(); - } - - $numRows = db2_num_rows($stmt); - - if ($numRows === false) { - throw StatementError::new(); - } - - return $numRows; - } - - public function lastInsertId(): string - { - $lastInsertId = db2_last_insert_id($this->connection); - - if ($lastInsertId === null) { - throw NoIdentityValue::new(); - } - - return $lastInsertId; - } - - public function beginTransaction(): void - { - if (db2_autocommit($this->connection, DB2_AUTOCOMMIT_OFF) !== true) { - throw ConnectionError::new($this->connection); - } - } - - public function commit(): void - { - if (! db2_commit($this->connection)) { - throw ConnectionError::new($this->connection); - } - - if (db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON) !== true) { - throw ConnectionError::new($this->connection); - } - } - - public function rollBack(): void - { - if (! db2_rollback($this->connection)) { - throw ConnectionError::new($this->connection); - } - - if (db2_autocommit($this->connection, DB2_AUTOCOMMIT_ON) !== true) { - throw ConnectionError::new($this->connection); - } - } - - /** @return resource */ - public function getNativeConnection() - { - return $this->connection; - } -} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php deleted file mode 100644 index a1e5948..0000000 --- a/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php +++ /dev/null @@ -1,80 +0,0 @@ -string; - } - - /** - * Creates the object from an array representation - * - * @param array $params - */ - public static function fromArray( - #[SensitiveParameter] - array $params, - ): self { - $chunks = []; - - foreach ($params as $key => $value) { - $chunks[] = sprintf('%s=%s', $key, $value); - } - - return new self(implode(';', $chunks)); - } - - /** - * Creates the object from the given DBAL connection parameters. - * - * @param array $params - */ - public static function fromConnectionParameters(#[SensitiveParameter] - array $params,): self - { - if (isset($params['dbname']) && str_contains($params['dbname'], '=')) { - return new self($params['dbname']); - } - - $dsnParams = []; - - foreach ( - [ - 'host' => 'HOSTNAME', - 'port' => 'PORT', - 'protocol' => 'PROTOCOL', - 'dbname' => 'DATABASE', - 'user' => 'UID', - 'password' => 'PWD', - ] as $dbalParam => $dsnParam - ) { - if (! isset($params[$dbalParam])) { - continue; - } - - $dsnParams[$dsnParam] = $params[$dbalParam]; - } - - return self::fromArray($dsnParams); - } -} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php deleted file mode 100644 index f2f4ed7..0000000 --- a/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php +++ /dev/null @@ -1,41 +0,0 @@ -toString(); - - $username = $params['user'] ?? ''; - $password = $params['password'] ?? ''; - $driverOptions = $params['driverOptions'] ?? []; - - if (! empty($params['persistent'])) { - $connection = db2_pconnect($dataSourceName, $username, $password, $driverOptions); - } else { - $connection = db2_connect($dataSourceName, $username, $password, $driverOptions); - } - - if ($connection === false) { - throw ConnectionFailed::new(); - } - - return new Connection($connection); - } -} diff --git a/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php b/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php deleted file mode 100644 index c584fb8..0000000 --- a/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php +++ /dev/null @@ -1,27 +0,0 @@ -statement); - - if ($row === false && db2_stmt_error($this->statement) !== '02000') { - throw StatementError::new($this->statement); - } - - return $row; - } - - public function fetchAssociative(): array|false - { - $row = @db2_fetch_assoc($this->statement); - - if ($row === false && db2_stmt_error($this->statement) !== '02000') { - throw StatementError::new($this->statement); - } - - return $row; - } - - public function fetchOne(): mixed - { - return FetchUtils::fetchOne($this); - } - - /** - * {@inheritDoc} - */ - public function fetchAllNumeric(): array - { - return FetchUtils::fetchAllNumeric($this); - } - - /** - * {@inheritDoc} - */ - public function fetchAllAssociative(): array - { - return FetchUtils::fetchAllAssociative($this); - } - - /** - * {@inheritDoc} - */ - public function fetchFirstColumn(): array - { - return FetchUtils::fetchFirstColumn($this); - } - - public function rowCount(): int - { - $numRows = @db2_num_rows($this->statement); - - if ($numRows === false) { - throw StatementError::new($this->statement); - } - - return $numRows; - } - - public function columnCount(): int - { - $count = db2_num_fields($this->statement); - - if ($count !== false) { - return $count; - } - - return 0; - } - - public function free(): void - { - db2_free_result($this->statement); - } -} 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