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/SQLSrv/Connection.php | 108 ---------------- vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php | 73 ----------- .../dbal/src/Driver/SQLSrv/Exception/Error.php | 44 ------- vendor/doctrine/dbal/src/Driver/SQLSrv/Result.php | 104 --------------- .../doctrine/dbal/src/Driver/SQLSrv/Statement.php | 140 --------------------- 5 files changed, 469 deletions(-) delete mode 100644 vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php delete mode 100644 vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php delete mode 100644 vendor/doctrine/dbal/src/Driver/SQLSrv/Exception/Error.php delete mode 100644 vendor/doctrine/dbal/src/Driver/SQLSrv/Result.php delete mode 100644 vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php (limited to 'vendor/doctrine/dbal/src/Driver/SQLSrv') diff --git a/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php b/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php deleted file mode 100644 index 71050f1..0000000 --- a/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php +++ /dev/null @@ -1,108 +0,0 @@ -connection); - - return $serverInfo['SQLServerVersion']; - } - - public function prepare(string $sql): Statement - { - return new Statement($this->connection, $sql); - } - - public function query(string $sql): Result - { - return $this->prepare($sql)->execute(); - } - - public function quote(string $value): string - { - return "'" . str_replace("'", "''", $value) . "'"; - } - - public function exec(string $sql): int - { - $stmt = sqlsrv_query($this->connection, $sql); - - if ($stmt === false) { - throw Error::new(); - } - - $rowsAffected = sqlsrv_rows_affected($stmt); - - if ($rowsAffected === false) { - throw Error::new(); - } - - return $rowsAffected; - } - - public function lastInsertId(): int|string - { - $result = $this->query('SELECT @@IDENTITY'); - - $lastInsertId = $result->fetchOne(); - - if ($lastInsertId === null) { - throw NoIdentityValue::new(); - } - - return $lastInsertId; - } - - public function beginTransaction(): void - { - if (! sqlsrv_begin_transaction($this->connection)) { - throw Error::new(); - } - } - - public function commit(): void - { - if (! sqlsrv_commit($this->connection)) { - throw Error::new(); - } - } - - public function rollBack(): void - { - if (! sqlsrv_rollback($this->connection)) { - throw Error::new(); - } - } - - /** @return resource */ - public function getNativeConnection() - { - return $this->connection; - } -} diff --git a/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php b/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php deleted file mode 100644 index c9c2c34..0000000 --- a/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php +++ /dev/null @@ -1,73 +0,0 @@ -fetch(SQLSRV_FETCH_NUMERIC); - } - - public function fetchAssociative(): array|false - { - return $this->fetch(SQLSRV_FETCH_ASSOC); - } - - 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 - { - $count = sqlsrv_rows_affected($this->statement); - - if ($count !== false) { - return $count; - } - - return 0; - } - - public function columnCount(): int - { - $count = sqlsrv_num_fields($this->statement); - - if ($count !== false) { - return $count; - } - - return 0; - } - - public function free(): void - { - // emulate it by fetching and discarding rows, similarly to what PDO does in this case - // @link http://php.net/manual/en/pdostatement.closecursor.php - // @link https://github.com/php/php-src/blob/php-7.0.11/ext/pdo/pdo_stmt.c#L2075 - // deliberately do not consider multiple result sets, since doctrine/dbal doesn't support them - while (sqlsrv_fetch($this->statement)) { - } - } - - private function fetch(int $fetchType): mixed - { - return sqlsrv_fetch_array($this->statement, $fetchType) ?? false; - } -} diff --git a/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php b/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php deleted file mode 100644 index dc7827a..0000000 --- a/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php +++ /dev/null @@ -1,140 +0,0 @@ - - */ - private array $variables = []; - - /** - * Bound parameter types. - * - * @var array - */ - private array $types = []; - - /** - * Append to any INSERT query to retrieve the last insert id. - */ - private const LAST_INSERT_ID_SQL = ';SELECT SCOPE_IDENTITY() AS LastInsertId;'; - - /** - * @internal The statement can be only instantiated by its driver connection. - * - * @param resource $conn - */ - public function __construct( - private readonly mixed $conn, - private string $sql, - ) { - if (stripos($sql, 'INSERT INTO ') !== 0) { - return; - } - - $this->sql .= self::LAST_INSERT_ID_SQL; - } - - public function bindValue(int|string $param, mixed $value, ParameterType $type): void - { - assert(is_int($param)); - - $this->variables[$param] = $value; - $this->types[$param] = $type; - } - - public function execute(): Result - { - $this->stmt ??= $this->prepare(); - - if (! sqlsrv_execute($this->stmt)) { - throw Error::new(); - } - - return new Result($this->stmt); - } - - /** - * Prepares SQL Server statement resource - * - * @return resource - * - * @throws Exception - */ - private function prepare() - { - $params = []; - - foreach ($this->variables as $column => &$variable) { - switch ($this->types[$column]) { - case ParameterType::LARGE_OBJECT: - $params[$column - 1] = [ - &$variable, - SQLSRV_PARAM_IN, - SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY), - SQLSRV_SQLTYPE_VARBINARY('max'), - ]; - break; - - case ParameterType::BINARY: - $params[$column - 1] = [ - &$variable, - SQLSRV_PARAM_IN, - SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_BINARY), - ]; - break; - - case ParameterType::ASCII: - $params[$column - 1] = [ - &$variable, - SQLSRV_PARAM_IN, - SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_CHAR), - ]; - break; - - default: - $params[$column - 1] =& $variable; - break; - } - } - - $stmt = sqlsrv_prepare($this->conn, $this->sql, $params); - - if ($stmt === false) { - throw Error::new(); - } - - return $stmt; - } -} -- cgit v1.2.3