Skip to content

Commit

Permalink
build(includes) update sqlite plugin to version 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Nov 28, 2023
1 parent 737b28c commit 163a1db
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
4 changes: 3 additions & 1 deletion includes/sqlite-database-integration/activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ function sqlite_activation() {

// Handle upgrading from the performance-lab plugin.
if ( isset( $_GET['upgrade-from-pl'] ) ) {
global $wp_filesystem;
require_once ABSPATH . '/wp-admin/includes/file.php';
// Delete the previous db.php file.
unlink( WP_CONTENT_DIR . '/db.php' );
$wp_filesystem->delete( WP_CONTENT_DIR . '/db.php' );
// Deactivate the performance-lab SQLite module.
$pl_option_name = defined( 'PERFLAB_MODULES_SETTING' ) ? PERFLAB_MODULES_SETTING : 'perflab_modules_settings';
$pl_option = get_option( $pl_option_name, array() );
Expand Down
2 changes: 1 addition & 1 deletion includes/sqlite-database-integration/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: SQLite Database Integration
* Description: SQLite database driver drop-in.
* Author: WordPress Performance Team
* Version: 2.1.1
* Version: 2.1.2
* Requires PHP: 5.6
* Textdomain: sqlite-database-integration
*
Expand Down
4 changes: 2 additions & 2 deletions includes/sqlite-database-integration/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Contributors: wordpressdotorg, aristath
Requires at least: 6.0
Tested up to: 6.1
Tested up to: 6.4
Requires PHP: 5.6
Stable tag: 2.1.1
Stable tag: 2.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: performance, database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class WP_SQLite_DB extends wpdb {
/**
* Database Handle
*
* @access protected
*
* @var WP_SQLite_Translator
*/
protected $dbh;
Expand Down Expand Up @@ -315,7 +313,6 @@ public function query( $query ) {
* This overrides wpdb::load_col_info(), which uses a mysql function.
*
* @see wpdb::load_col_info()
* @access protected
*/
protected function load_col_info() {
if ( $this->col_info ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@ public function isnull( $field ) {
*
* As 'IF' is a reserved word for PHP, function name must be changed.
*
* @param unknonw $expression the statement to be evaluated as true or false.
* @param unknown $true statement or value returned if $expression is true.
* @param unknown $false statement or value returned if $expression is false.
* @param mixed $expression the statement to be evaluated as true or false.
* @param mixed $true statement or value returned if $expression is true.
* @param mixed $false statement or value returned if $expression is false.
*
* @return unknown
* @return mixed
*/
public function _if( $expression, $true, $false ) {
return ( true === $expression ) ? $true : $false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class WP_SQLite_Translator {
/**
* Class variable to reference to the PDO instance.
*
* @access private
*
* @var PDO object
*/
private $pdo;
Expand Down Expand Up @@ -180,8 +178,6 @@ class WP_SQLite_Translator {
/**
* Class variable to store the result of the query.
*
* @access private
*
* @var array reference to the PHP object
*/
private $results = null;
Expand All @@ -196,17 +192,13 @@ class WP_SQLite_Translator {
/**
* Class variable to store the file name and function to cause error.
*
* @access private
*
* @var array
*/
private $errors;

/**
* Class variable to store the error messages.
*
* @access private
*
* @var array
*/
private $error_messages = array();
Expand All @@ -215,7 +207,6 @@ class WP_SQLite_Translator {
* Class variable to store the affected row id.
*
* @var int integer
* @access private
*/
private $last_insert_id;

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

0 comments on commit 163a1db

Please sign in to comment.