tagged 1.8 and released

git-svn-id: https://plugins.svn.wordpress.org/sqlite-integration/trunk@1106368 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
kjmtsh 2015-03-05 21:01:35 +00:00
parent 8235d4c4d8
commit 54d9e1b02a
10 changed files with 65 additions and 20 deletions

View File

@ -1,3 +1,22 @@
2015-03-06 KOJIMA Toshiyasu
* version 1.8 release.
* readme.txt, readme-ja.txt: updated.
* query_create.class.php: fixed the index query regexp.
* query.class.php: added 'orderby_callback' method.
This is a workaround for PHP 5.2.x compatibility issue.
2015-03-05 KOJIMA Toshiyasu
* pdodb.class.php: removed the unnecessary require directive.
* pdoengin.class.php: revised install process algorithm.
Database directory and file check was too late.
Changed the database directory permission.
2014-10-01 KOJIMA Toshiyasu 2014-10-01 KOJIMA Toshiyasu
* pdoengine.class.php: revised pdoengine class constructor definition * pdoengine.class.php: revised pdoengine class constructor definition

2
db.php
View File

@ -5,7 +5,7 @@
* This file must be placed in the directory wordpress/wp-content/db.php. * This file must be placed in the directory wordpress/wp-content/db.php.
* WordPress loads this file automatically. * WordPress loads this file automatically.
* *
* @version 1.7 * @version 1.8
* @package SQLite Integration * @package SQLite Integration
* @author Kojima Toshiyasu * @author Kojima Toshiyasu
* *

View File

@ -12,7 +12,7 @@ if (!defined('ABSPATH')) {
die(); die();
} }
require_once PDODIR . 'pdoengine.class.php'; require_once PDODIR . 'pdoengine.class.php';
require_once PDODIR . 'install.php'; //require_once PDODIR . 'install.php';
if (!defined('SAVEQUERIES')){ if (!defined('SAVEQUERIES')){
define ('SAVEQUERIES', false); define ('SAVEQUERIES', false);

View File

@ -170,6 +170,9 @@ class PDOEngine extends PDO {
*/ */
function __construct() { function __construct() {
register_shutdown_function(array($this, '__destruct')); register_shutdown_function(array($this, '__destruct'));
if (is_file(FQDB)) {
$this->prepare_directory();
}
$dsn = 'sqlite:' . FQDB; $dsn = 'sqlite:' . FQDB;
if (isset($GLOBALS['@pdo'])) { if (isset($GLOBALS['@pdo'])) {
$this->pdo = $GLOBALS['@pdo']; $this->pdo = $GLOBALS['@pdo'];
@ -245,7 +248,6 @@ class PDOEngine extends PDO {
*/ */
private function init() { private function init() {
if (defined('WP_INSTALLING') && WP_INSTALLING) { if (defined('WP_INSTALLING') && WP_INSTALLING) {
$this->prepare_directory();
$statement = $this->pdo->query("SELECT COUNT(*) FROM sqlite_master WHERE type='table'"); $statement = $this->pdo->query("SELECT COUNT(*) FROM sqlite_master WHERE type='table'");
$number_of_tables = $statement->fetchColumn(0); $number_of_tables = $statement->fetchColumn(0);
$statement = null; $statement = null;
@ -267,7 +269,7 @@ class PDOEngine extends PDO {
global $wpdb; global $wpdb;
$u = umask(0000); $u = umask(0000);
if (!is_dir(FQDBDIR)) { if (!is_dir(FQDBDIR)) {
if (!@mkdir(FQDBDIR, 0707, true)) { if (!@mkdir(FQDBDIR, 0704, true)) {
umask($u); umask($u);
$message = 'Unable to create the required directory! Please check your server settings.'; $message = 'Unable to create the required directory! Please check your server settings.';
wp_die($message, 'Error!'); wp_die($message, 'Error!');

View File

@ -766,15 +766,29 @@ class PDOSQLiteDriver {
$_wpdb = new PDODB(); $_wpdb = new PDODB();
$results = $_wpdb->get_results($query); $results = $_wpdb->get_results($query);
$_wpdb = null; $_wpdb = null;
$compare = function($a, $b) { /* $compare = function($a, $b) { */
global $flipped; /* global $flipped; */
return $flipped[$a->ID] - $flipped[$b->ID]; /* return $flipped[$a->ID] - $flipped[$b->ID]; */
}; /* }; */
usort($results, $compare); /* usort($results, $compare); */
usort($results, array($this, 'orderby_callback'));
} }
$wpdb->dbh->pre_ordered_results = $results; $wpdb->dbh->pre_ordered_results = $results;
} }
} }
/**
* Callback method for sorting
*
* As PHP 5.2 doesn't allow closure function, this callback procedure
* is necessary.
*
* @param queried object
* @access private
*/
private function orderby_callback($a, $b) {
global $flipped;
return $flipped[$a->ID] - $flipped[$b->ID];
}
/** /**
* Method to avoid DELETE with JOIN statement. * Method to avoid DELETE with JOIN statement.
* *

View File

@ -298,7 +298,7 @@ class CreateQuery{
* @access private * @access private
*/ */
private function rewrite_key(){ private function rewrite_key(){
$this->_query = preg_replace_callback('/,\\s*(KEY|INDEX)\\s*(\\w+)?\\s*(\(.*(?<!\\d)\))/im', array($this, '_rewrite_key'), $this->_query); $this->_query = preg_replace_callback('/,\\s*(KEY|INDEX)\\s*(\\w+)?\\s*(\(.+\))/im', array($this, '_rewrite_key'), $this->_query);
} }
/** /**
* Callback method for rewrite_key. * Callback method for rewrite_key.

View File

@ -6,8 +6,8 @@ Tags: database, SQLite, PDO
Author: Kojima Toshiyasu Author: Kojima Toshiyasu
Author URI: http://dogwood.skr.jp/ Author URI: http://dogwood.skr.jp/
Requires at least: 3.3 Requires at least: 3.3
Tested up to: 4.0 Tested up to: 4.1.1
Stable tag: 1.7 Stable tag: 1.8
License: GPLv2 License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -164,10 +164,15 @@ wp-config.php を手動で作成することが必要です。WordPress に作
== Upgrade Notice == == Upgrade Notice ==
WordPress 4.0 での動作チェックをして、いくつかのバグを修正しました。アップグレードをお勧めします。自動アップグレードで失敗するようなら、FTPを使っての手動アップグレードを試してみてください。 WordPress 4.1.1 での動作チェックをして、いくつかのバグを修正しました。アップグレードをお勧めします。自動アップグレードで失敗するようなら、FTPを使っての手動アップグレードを試してみてください。
== Changelog == == Changelog ==
= 1.8 (2014-03-06) =
* インストール・プロセスのバグを修正しました。
* index query の正規表現を修正しました。いくつかのプラグインが影響を受けるかもしれません。
* PHP 5.2.x で動作しない部分を修正しました。
= 1.7 (2014-09-05) = = 1.7 (2014-09-05) =
* エディタ画面で、添付ファイルの並べ替えができなかったのを修正しました。 * エディタ画面で、添付ファイルの並べ替えができなかったのを修正しました。
* CREATE クエリのバグを修正しました。 * CREATE クエリのバグを修正しました。

View File

@ -6,8 +6,8 @@ Tags: database, SQLite, PDO
Author: Kojima Toshiyasu Author: Kojima Toshiyasu
Author URI: http://dogwood.skr.jp/ Author URI: http://dogwood.skr.jp/
Requires at least: 3.3 Requires at least: 3.3
Tested up to: 4.0 Tested up to: 4.1.1
Stable tag: 1.7 Stable tag: 1.8
License: GPLv2 License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -21,7 +21,7 @@ SQLite Integration is a successor to [PDO for WordPress](http://wordpress.org/ex
= Features = = Features =
SQLite Integration is a database access engine program. So it's not like the other plugins. It must be used to install WordPress. Please read the install section. And see more detailed instruction in the [SQLite Integration Page](http://dogwood.skr.jp/wordpress/sqlite-integration/). SQLite Integration is a database access engine program, which means it's not like the other plugins. It must be used to install WordPress. Please read the install section. And see more detailed instruction in the [SQLite Integration Page](http://dogwood.skr.jp/wordpress/sqlite-integration/).
Once you succeed in installing WordPress, you can use it just like the other systems using MySQL. Optionally, this plugin provides the feature to temporarily change the database to MySQL and come back to SQLite, which may help developers test their sites on the local machines without MySQL. Once you succeed in installing WordPress, you can use it just like the other systems using MySQL. Optionally, this plugin provides the feature to temporarily change the database to MySQL and come back to SQLite, which may help developers test their sites on the local machines without MySQL.
@ -162,10 +162,15 @@ This plugin doesn't support 'WP_PLUGIN_URL' constant.
== Upgrade Notice == == Upgrade Notice ==
WordPress 4.0 compatibility is checked and some bugs are fixed. Upgrade is recommended. When auto upgrading fails, please try manual upgrade via FTP. WordPress 4.1.1 compatibility is checked and some bugs are fixed. Upgrade is recommended. When auto upgrading fails, please try manual upgrade via FTP.
== Changelog == == Changelog ==
= 1.8 (2015-03-06) =
* Fixed the bug about install process algorithm.
* Fixed the index query regexp, which may cause a problem to some plugins.
* Solved PHP 5.2.x compatibility issue.
= 1.7 (2014-09-05) = = 1.7 (2014-09-05) =
* Fixed the bug about changing the order of the attachment file in the editor screen. * Fixed the bug about changing the order of the attachment file in the editor screen.
* Fixed the bug about the manipulation of CREATE query. * Fixed the bug about the manipulation of CREATE query.

View File

@ -4,7 +4,7 @@ Plugin Name: SQLite Integration
Plugin URI: http://dogwood.skr.jp/wordpress/sqlite-integration/ Plugin URI: http://dogwood.skr.jp/wordpress/sqlite-integration/
Description: SQLite Integration is the plugin that enables WordPress to use SQLite. If you don't have MySQL and want to build a WordPress website, it's for you. Description: SQLite Integration is the plugin that enables WordPress to use SQLite. If you don't have MySQL and want to build a WordPress website, it's for you.
Author: Kojima Toshiyasu Author: Kojima Toshiyasu
Version: 1.7 Version: 1.8
Author URI: http://dogwood.skr.jp Author URI: http://dogwood.skr.jp
Text Domain: sqlite-integration Text Domain: sqlite-integration
Domain Path: /languages Domain Path: /languages
@ -44,7 +44,7 @@ $siteurl = get_option('siteurl');
/* /*
* Defines basic constants. * Defines basic constants.
*/ */
define('SQLITE_INTEGRATION_VERSION', '1.7'); define('SQLITE_INTEGRATION_VERSION', '1.8');
define('SQLiteDir', dirname(plugin_basename(__FILE__))); define('SQLiteDir', dirname(plugin_basename(__FILE__)));
define('SQLiteFilePath', dirname(__FILE__)); define('SQLiteFilePath', dirname(__FILE__));
define('SQLiteDirName', basename(SQLiteFilePath)); define('SQLiteDirName', basename(SQLiteFilePath));

View File

@ -39,7 +39,7 @@ class SQLiteIntegrationUtils {
return; return;
$notice_string = __('Upgrading Notice: To finish upgrading, please activate SQLite Integration and go Setting >> SQLite Integration >> Miscellaneous, and click the button &quot;update&quot; at the bottom of the page. Or else replace wp-content/db.php with the one in sqlite-integration directory manually.', 'sqlite-integration'); $notice_string = __('Upgrading Notice: To finish upgrading, please activate SQLite Integration and go Setting >> SQLite Integration >> Miscellaneous, and click the button &quot;update&quot; at the bottom of the page. Or else replace wp-content/db.php with the one in sqlite-integration directory manually.', 'sqlite-integration');
$current_version = defined('SQLITE_INTEGRATION_VERSION') ? SQLITE_INTEGRATION_VERSION : ''; $current_version = defined('SQLITE_INTEGRATION_VERSION') ? SQLITE_INTEGRATION_VERSION : '';
if (version_compare($current_version, '1.7', '=')) return; if (version_compare($current_version, '1.8', '=')) return;
$version = ''; $version = '';
if (defined('WP_CONTENT_DIR')) { if (defined('WP_CONTENT_DIR')) {
$path = WP_CONTENT_DIR . '/db.php'; $path = WP_CONTENT_DIR . '/db.php';