|
14 | 14 | * |
15 | 15 | * The driver requires PDO with the SQLite driver, and the PCRE engine. |
16 | 16 | */ |
17 | | -class WP_PDO_MySQL_On_SQLite extends PDO { |
| 17 | +class WP_MySQL_On_SQLite extends PDO { |
18 | 18 | /** |
19 | 19 | * The path to the MySQL SQL grammar file. |
20 | 20 | */ |
@@ -632,8 +632,17 @@ class WP_PDO_MySQL_On_SQLite extends PDO { |
632 | 632 | * |
633 | 633 | * Set up an SQLite connection and the MySQL-on-SQLite driver. |
634 | 634 | * |
635 | | - * @param WP_SQLite_Connection $connection A SQLite database connection. |
636 | | - * @param string $db_name The database name. |
| 635 | + * @param string $dsn MySQL-on-SQLite DSN containing the SQLite path and database name. |
| 636 | + * @param string|null $username Optional. Ignored by this driver. |
| 637 | + * @param string|null $password Optional. Ignored by this driver. |
| 638 | + * @param array $options { |
| 639 | + * Optional driver options. |
| 640 | + * |
| 641 | + * @type int $mysql_version Optional. MySQL version to emulate. Default 80038. |
| 642 | + * @type PDO|null $pdo Optional. Existing SQLite PDO connection. |
| 643 | + * @type string|null $journal_mode Optional. SQLite journal mode. Default 'WAL'. |
| 644 | + * @type string|int|null $synchronous Optional. SQLite synchronous setting. |
| 645 | + * } |
637 | 646 | * |
638 | 647 | * @throws WP_SQLite_Driver_Exception When the driver initialization fails. |
639 | 648 | */ |
@@ -789,11 +798,12 @@ function ( string $sql, array $params ) { |
789 | 798 | * |
790 | 799 | * A single MySQL query can be translated into zero or more SQLite queries. |
791 | 800 | * |
792 | | - * @param string $query Full SQL statement string. |
793 | | - * @param int $fetch_mode PDO fetch mode. Default is PDO::FETCH_OBJ. |
794 | | - * @param array ...$fetch_mode_args Additional fetch mode arguments. |
| 801 | + * @param string $query Full SQL statement string. |
| 802 | + * @param int|null $fetch_mode Optional. PDO fetch mode. Defaults to the configured |
| 803 | + * PDO::ATTR_DEFAULT_FETCH_MODE. |
| 804 | + * @param mixed ...$fetch_mode_args Additional fetch mode arguments. |
795 | 805 | * |
796 | | - * @return mixed Return value, depending on the query type. |
| 806 | + * @return PDOStatement|false PDO statement, or false when the fetch mode is invalid on PHP < 8.1. |
797 | 807 | * |
798 | 808 | * @throws WP_SQLite_Driver_Exception When the query execution fails. |
799 | 809 | */ |
@@ -4202,7 +4212,7 @@ private function translate_query_expression( WP_Parser_Node $node ): string { |
4202 | 4212 | * When the ORDER BY clause is present, we need to disambiguate the item |
4203 | 4213 | * list and make sure they don't cause an "ambiguous column name" error. |
4204 | 4214 | * |
4205 | | - * @see WP_PDO_MySQL_On_SQLite::disambiguate_item() |
| 4215 | + * @see WP_MySQL_On_SQLite::disambiguate_item() |
4206 | 4216 | */ |
4207 | 4217 | $disambiguated_order_list = array(); |
4208 | 4218 | $order_clause = $node->get_first_child_node( 'orderClause' ); |
@@ -4270,7 +4280,7 @@ private function translate_query_specification( WP_Parser_Node $node ): string { |
4270 | 4280 | * When the GROUP BY or HAVING clause is present, we need to disambiguate |
4271 | 4281 | * the items to ensure they don't cause an "ambiguous column name" error. |
4272 | 4282 | * |
4273 | | - * @see WP_PDO_MySQL_On_SQLite::disambiguate_item() |
| 4283 | + * @see WP_MySQL_On_SQLite::disambiguate_item() |
4274 | 4284 | */ |
4275 | 4285 | $group_by_clause = null; |
4276 | 4286 | $having_clause = null; |
@@ -5779,7 +5789,7 @@ private function unnest_parenthesized_expression( WP_Parser_Node $node ): WP_Par |
5779 | 5789 | * consider column references in forms like "db.table.column". |
5780 | 5790 | * |
5781 | 5791 | * @param array $disambiguation_map The SELECT item disambiguation map (column name => array of select items). |
5782 | | - * @see WP_PDO_MySQL_On_SQLite::create_select_item_disambiguation_map() |
| 5792 | + * @see WP_MySQL_On_SQLite::create_select_item_disambiguation_map() |
5783 | 5793 | * @param WP_Parser_Node $expr The expression AST node or subnode. |
5784 | 5794 | * @return string|null The disambiguated and translated expression; |
5785 | 5795 | * null when the expression cannot be disambiguated. |
@@ -5818,7 +5828,7 @@ private function disambiguate_item( array $disambiguation_map, WP_Parser_Node $e |
5818 | 5828 | * Create a SELECT item disambiguation map from a SELECT item list for use |
5819 | 5829 | * with the ORDER BY, GROUP BY, and HAVING clause disambiguation algorithm. |
5820 | 5830 | * |
5821 | | - * @see WP_PDO_MySQL_On_SQLite::disambiguate_item() |
| 5831 | + * @see WP_MySQL_On_SQLite::disambiguate_item() |
5822 | 5832 | * |
5823 | 5833 | * @param WP_Parser_Node $select_item_list The "selectItemList" AST node. |
5824 | 5834 | * @return array The SELECT item disambiguation map (column name => array of select items). |
|
0 commit comments