sqlite-database-integration
/
wp-includes
/
database
/
sqlite
/
trait-wp-mysql-on-sqlite-pdo-compat-php-84.php
trait-wp-mysql-on-sqlite-pdo-compat-php-84.php in SQLite Database Integration 3.0.1, at wp-includes/database/sqlite/trait-wp-mysql-on-sqlite-pdo-compat-php-84.php
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * The SQLite driver uses PDO. Enable PDO function calls: |
| 5 | * phpcs:disable WordPress.DB.RestrictedClasses.mysql__PDO |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * PDO methods introduced in PHP 8.4. |
| 10 | * |
| 11 | * @access private |
| 12 | */ |
| 13 | trait WP_MySQL_On_SQLite_PDO_Compat { |
| 14 | /** |
| 15 | * Create a PDO connection to MySQL on SQLite. |
| 16 | * |
| 17 | * @param string $dsn MySQL-on-SQLite data source name. |
| 18 | * @param string|null $username Optional. Ignored by this driver. |
| 19 | * @param string|null $password Optional. Ignored by this driver. |
| 20 | * @param array|null $options Optional PDO and driver options. |
| 21 | * @return static The new connection. |
| 22 | */ |
| 23 | public static function connect( |
| 24 | string $dsn, |
| 25 | ?string $username = null, |
| 26 | ?string $password = null, |
| 27 | ?array $options = null |
| 28 | ): static { |
| 29 | return new static( $dsn, $username, $password, $options ); |
| 30 | } |
| 31 | } |
| 32 |