1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Licensed to CRATE Technology GmbH("Crate") under one or more contributor |
4
|
|
|
* license agreements. See the NOTICE file distributed with this work for |
5
|
|
|
* additional information regarding copyright ownership. Crate licenses |
6
|
|
|
* this file to you under the Apache License, Version 2.0 (the "License"); |
7
|
|
|
* you may not use this file except in compliance with the License. You may |
8
|
|
|
* obtain a copy of the License at |
9
|
|
|
* |
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
11
|
|
|
* |
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
14
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
15
|
|
|
* License for the specific language governing permissions and limitations |
16
|
|
|
* under the License. |
17
|
|
|
* |
18
|
|
|
* However, if you have executed another commercial license agreement |
19
|
|
|
* with Crate these terms will supersede the license and you may use the |
20
|
|
|
* software solely pursuant to the terms of the relevant commercial agreement. |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
/* |
24
|
|
|
* PDO compatibility for PHP 8.x. |
25
|
|
|
* |
26
|
|
|
* Reason: |
27
|
|
|
* - https://github.com/php/php-src/pull/6220 |
28
|
|
|
* |
29
|
|
|
* Implementation derived and inspired from: |
30
|
|
|
* - https://github.com/doctrine/dbal/pull/4347 |
31
|
|
|
* - https://www.drupal.org/project/drupal/issues/3109885 |
32
|
|
|
* - https://www.drupal.org/project/drupal/issues/3156881 |
33
|
|
|
* - https://www.drupal.org/node/3170913 |
34
|
|
|
* |
35
|
|
|
*/ |
36
|
|
|
|
37
|
|
|
declare(strict_types=1); |
38
|
|
|
|
39
|
|
|
namespace Crate\PDO; |
40
|
|
|
|
41
|
|
|
use const PHP_VERSION_ID; |
42
|
|
|
|
43
|
1 |
|
if (PHP_VERSION_ID >= 80000) { |
44
|
|
|
trait PDOStatementImplementation |
45
|
|
|
{ |
46
|
|
|
use PDOStatementImplementationPhp8; |
47
|
|
|
} |
48
|
|
|
} else { |
49
|
|
|
// phpcs:disable |
50
|
|
|
trait PDOStatementImplementation |
51
|
|
|
{ |
52
|
|
|
use PDOStatementImplementationPhp7; |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|