Skip to content

Commit 163a1db

Browse files
committed
build(includes) update sqlite plugin to version 2.1.2
1 parent 737b28c commit 163a1db

File tree

6 files changed

+16
-22
lines changed

6 files changed

+16
-22
lines changed

includes/sqlite-database-integration/activate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ function sqlite_activation() {
3939

4040
// Handle upgrading from the performance-lab plugin.
4141
if ( isset( $_GET['upgrade-from-pl'] ) ) {
42+
global $wp_filesystem;
43+
require_once ABSPATH . '/wp-admin/includes/file.php';
4244
// Delete the previous db.php file.
43-
unlink( WP_CONTENT_DIR . '/db.php' );
45+
$wp_filesystem->delete( WP_CONTENT_DIR . '/db.php' );
4446
// Deactivate the performance-lab SQLite module.
4547
$pl_option_name = defined( 'PERFLAB_MODULES_SETTING' ) ? PERFLAB_MODULES_SETTING : 'perflab_modules_settings';
4648
$pl_option = get_option( $pl_option_name, array() );

includes/sqlite-database-integration/load.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: SQLite Database Integration
44
* Description: SQLite database driver drop-in.
55
* Author: WordPress Performance Team
6-
* Version: 2.1.1
6+
* Version: 2.1.2
77
* Requires PHP: 5.6
88
* Textdomain: sqlite-database-integration
99
*

includes/sqlite-database-integration/readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Contributors: wordpressdotorg, aristath
44
Requires at least: 6.0
5-
Tested up to: 6.1
5+
Tested up to: 6.4
66
Requires PHP: 5.6
7-
Stable tag: 2.1.1
7+
Stable tag: 2.1.2
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010
Tags: performance, database

includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class WP_SQLite_DB extends wpdb {
1616
/**
1717
* Database Handle
1818
*
19-
* @access protected
20-
*
2119
* @var WP_SQLite_Translator
2220
*/
2321
protected $dbh;
@@ -315,7 +313,6 @@ public function query( $query ) {
315313
* This overrides wpdb::load_col_info(), which uses a mysql function.
316314
*
317315
* @see wpdb::load_col_info()
318-
* @access protected
319316
*/
320317
protected function load_col_info() {
321318
if ( $this->col_info ) {

includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,11 @@ public function isnull( $field ) {
446446
*
447447
* As 'IF' is a reserved word for PHP, function name must be changed.
448448
*
449-
* @param unknonw $expression the statement to be evaluated as true or false.
450-
* @param unknown $true statement or value returned if $expression is true.
451-
* @param unknown $false statement or value returned if $expression is false.
449+
* @param mixed $expression the statement to be evaluated as true or false.
450+
* @param mixed $true statement or value returned if $expression is true.
451+
* @param mixed $false statement or value returned if $expression is false.
452452
*
453-
* @return unknown
453+
* @return mixed
454454
*/
455455
public function _if( $expression, $true, $false ) {
456456
return ( true === $expression ) ? $true : $false;

includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class WP_SQLite_Translator {
3131
/**
3232
* Class variable to reference to the PDO instance.
3333
*
34-
* @access private
35-
*
3634
* @var PDO object
3735
*/
3836
private $pdo;
@@ -180,8 +178,6 @@ class WP_SQLite_Translator {
180178
/**
181179
* Class variable to store the result of the query.
182180
*
183-
* @access private
184-
*
185181
* @var array reference to the PHP object
186182
*/
187183
private $results = null;
@@ -196,17 +192,13 @@ class WP_SQLite_Translator {
196192
/**
197193
* Class variable to store the file name and function to cause error.
198194
*
199-
* @access private
200-
*
201195
* @var array
202196
*/
203197
private $errors;
204198

205199
/**
206200
* Class variable to store the error messages.
207201
*
208-
* @access private
209-
*
210202
* @var array
211203
*/
212204
private $error_messages = array();
@@ -215,7 +207,6 @@ class WP_SQLite_Translator {
215207
* Class variable to store the affected row id.
216208
*
217209
* @var int integer
218-
* @access private
219210
*/
220211
private $last_insert_id;
221212

@@ -1692,9 +1683,9 @@ private function preprocess_string_literal( $value ) {
16921683
private function preprocess_like_expr( &$token ) {
16931684
/*
16941685
* This code handles escaped wildcards in LIKE clauses.
1695-
* If we are within a LIKE experession, we look for \_ and \%, the
1686+
* If we are within a LIKE expression, we look for \_ and \%, the
16961687
* escaped LIKE wildcards, the ones where we want a literal, not a
1697-
* wildcard match. We change the \ escape for an ASCII \x1a (SUB) character,
1688+
* wildcard match. We change the \ escape for an ASCII \x1A (SUB) character,
16981689
* so the \ characters won't get munged.
16991690
* These \_ and \% escape sequences are in the token name, because
17001691
* the lexer has already done stripcslashes on the value.
@@ -2424,6 +2415,10 @@ private function strip_sqlite_system_tables( $tables ) {
24242415
array_filter(
24252416
$tables,
24262417
function ( $table ) {
2418+
// Bail early if $table is not an object.
2419+
if ( ! is_object( $table ) ) {
2420+
return true;
2421+
}
24272422
$table_name = property_exists( $table, 'Name' ) ? $table->Name : $table->table_name; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
24282423
return ! array_key_exists( $table_name, $this->sqlite_system_tables );
24292424
},

0 commit comments

Comments
 (0)