diff --git a/install.php b/install.php index 1c2fa99..8c1a253 100644 --- a/install.php +++ b/install.php @@ -57,7 +57,7 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = wp_cache_flush(); - if (isset($_SERVER['SERVER_NAME']) && stripos($_SERVER['SERVER_NAME'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) { + if (isset($_SERVER['SERVER_SOFTWARE']) && stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) { ;// Your server is Apache. Nothing to do more. } else { $server_message = sprintf('Your webserver doesn\'t seem to be Apache. So the database directory access restriction by the .htaccess file may not function. We strongly recommend that you should restrict the access to the directory %s in some other way.', FQDBDIR); diff --git a/languages/sqlite-integration-ja.po b/languages/sqlite-integration-ja.po index ab80428..b7b9c56 100644 --- a/languages/sqlite-integration-ja.po +++ b/languages/sqlite-integration-ja.po @@ -156,12 +156,12 @@ msgid "" "SQLite for its database. But PDO for WordPress doesn't seem to be maintained " "any more only to be outdated. SQLite Integration makes use of the basic " "ideas and framework of PDO for WordPress, adds some new features and updates " -"it to be able to work with the newest version of WordPress(3.6)." +"it to be able to work with the newest version of WordPress(3.7.1)." msgstr "" "このプラグインは" "PDO for WordPressの後継です。PDO for WordPressはWordPressでSQLiteを使えるようにする" "ものでしたが、もうメンテナンスされていないようで、古くなってしまいました。SQLite Integrationは、その基本的な" -"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.6)で動作するように" +"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.7.1)で動作するように" "したものです。" #: utilities/documentation.php:43 @@ -866,7 +866,7 @@ msgstr "SQLite Integrationにようこそ" #: utilities/utility.php:406 msgid "Thank you for using SQLite Integration plugin!" -msgstr "SQLite Integrationをお使いいただき、ありがとうぐざいます。" +msgstr "SQLite Integrationをお使いいただき、ありがとうございます。" #: utilities/utility.php:409 msgid "" diff --git a/pdoengine.class.php b/pdoengine.class.php index 3b08ffb..0044fbe 100644 --- a/pdoengine.class.php +++ b/pdoengine.class.php @@ -390,6 +390,8 @@ class PDOEngine extends PDO { case 'showindex': case 'describe': case 'desc': + case 'check': + case 'analyze': // case "foundrows": $this->num_rows = count($this->_results); $this->return_value = $this->num_rows; @@ -468,7 +470,7 @@ class PDOEngine extends PDO { * @return boolean|string */ private function determine_query_type($query) { - $result = preg_match('/^\\s*(EXPLAIN|PRAGMA|SELECT\\s*FOUND_ROWS|SELECT|INSERT|UPDATE|REPLACE|DELETE|ALTER|CREATE|DROP\\s*INDEX|DROP|SHOW\\s*\\w+\\s*\\w+\\s*|DESCRIBE|DESC|TRUNCATE|OPTIMIZE)/i', $query, $match); + $result = preg_match('/^\\s*(EXPLAIN|PRAGMA|SELECT\\s*FOUND_ROWS|SELECT|INSERT|UPDATE|REPLACE|DELETE|ALTER|CREATE|DROP\\s*INDEX|DROP|SHOW\\s*\\w+\\s*\\w+\\s*|DESCRIBE|DESC|TRUNCATE|OPTIMIZE|CHECK|ANALYZE)/i', $query, $match); if (!$result) { return false; @@ -724,6 +726,8 @@ class PDOEngine extends PDO { $this->convert_to_columns_object(); } elseif ('showindex' === $this->query_type){ $this->convert_to_index_object(); + } elseif (in_array($this->query_type, array('check', 'analyze'))) { + $this->convert_result_check_or_analyze(); } else { $this->results = $this->_results; } @@ -870,6 +874,26 @@ class PDOEngine extends PDO { $this->results = $_results; } + private function convert_result_check_or_analyze() { + $results = array(); + if ($this->query_type == 'check') { + $_columns = array( + 'Table' => '', + 'Op' => 'check', + 'Msg_type' => 'status', + 'Msg_text' => 'OK' + ); + } else { + $_columns = array( + 'Table' => '', + 'Op' => 'analyze', + 'Msg_type' => 'status', + 'Msg_text' => 'Table is already up to date' + ); + } + $_results[] = new ObjectArray($_columns); + $this->results = $_results; + } /** * function to get SQLite library version * this is used for checking if SQLite can execute multiple rows insert diff --git a/query.class.php b/query.class.php index 74ddb05..a399f54 100644 --- a/query.class.php +++ b/query.class.php @@ -88,7 +88,15 @@ class PDOSQLiteDriver { case 'optimize': $this->_rewrite_optimize(); break; + case 'pragma': + break; default: + if (defined(WP_DEBUG) && WP_DEBUG) { + break; + } else { + $this->_return_true(); + break; + } } return $this->_query; } @@ -542,5 +550,11 @@ class PDOSQLiteDriver { $this->_query = $rewritten; } } + /** + * + */ + private function _return_true() { + $this->_query = 'SELECT 1=1'; + } } ?> \ No newline at end of file diff --git a/readme-ja.txt b/readme-ja.txt index 001b933..8847d79 100644 --- a/readme-ja.txt +++ b/readme-ja.txt @@ -6,8 +6,8 @@ Tags: database, SQLite, PDO Author: Kojima Toshiyasu Author URI: http://dogwood.skr.jp/ Requires at least: 3.3 -Tested up to: 3.6.1 -Stable tag: 1.4.1 +Tested up to: 3.7.1 +Stable tag: 1.4.2 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -174,6 +174,11 @@ SQLite Integrationのアップグレードに失敗するようなら、FTPを == Changelog == += 1.4.2 (2013-11-06) = +* ダッシュボードに表示される情報についてのバグを修正しました。 +* スクリーンショットを変更しました。 +* WordPress 3.7.1 でのインストールテストを行いました。 + = 1.4.1 (2013-09-27) = * BETWEEN関数の書き換え方を修正しました。致命的なバグです。新規投稿に'between A and B'というフレーズが含まれていると、公開されず、投稿自体も消えます。 * MP6を使っているときに、管理画面のレイアウトが崩れるのを修正しました。 diff --git a/readme.txt b/readme.txt index 2dcddc4..12a5115 100644 --- a/readme.txt +++ b/readme.txt @@ -6,8 +6,8 @@ Tags: database, SQLite, PDO Author: Kojima Toshiyasu Author URI: http://dogwood.skr.jp/ Requires at least: 3.3 -Tested up to: 3.6.1 -Stable tag: 1.4.1 +Tested up to: 3.7.1 +Stable tag: 1.4.2 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -15,7 +15,7 @@ SQLite Integration is the plugin that enables WordPress to use SQLite. If you wa == Description == -This plugin enables WordPress to work with [SQLite](http://www.sqlite.org/). You don't have to prepare MySQL database server and its configuration. SQLite is a self-contained, serverless, transactional SQL database engine. It is not a full-featured database system like MySQL or PostgreSQL, but it best fits for low to medium traffic websites. +This plugin enables WordPress to work with [SQLite](http://www.sqlite.org/). You don't have to prepare MySQL database server or its configuration. SQLite is a self-contained, serverless, transactional SQL database engine. It is not a full-featured database system like MySQL or PostgreSQL, but it best fits for low to medium traffic websites. SQLite Integration is a kind of wrapper program, which is placed between WordPress and SQLite database and works as a mediator. It works as follows: @@ -32,7 +32,7 @@ SQLite Integration is a successor to [PDO for WordPress](http://wordpress.org/ex = Important Notice = -When your installed WordPress 3.5.x with this plugin and upgraded to 3.6, your database might not work as expected. If this is your case, please upgrade this plugin to the newest version (1.4) and visit the maintenance page in the admin dashboard, where you can check if you need to fix your database, and you can do fixing job with the utility. +When your installed WordPress 3.5.x with this plugin and upgraded to 3.6, your database might not work as expected. If this is your case, please upgrade this plugin to the newest version (1.4.2) and visit the maintenance page in the admin dashboard, where you can check if you need to fix your database, and you can do fixing job with the utility. When you installed WordPress 3.6 with this plugin or your WordPress is 3.5.x, you don't have to fix your database. @@ -65,9 +65,9 @@ This plugin is *not* like the other plugins. You can't install and activate it o First of all, you've got to prepare WordPress installation. See [Installing Wordpress ](http://codex.wordpress.org/Installing_WordPress) section in the Codex. -After checking the prerequisites and unzipping the WordPress archive file, you must rename wp-contig-sample.php file to wp-config.php and do some editting as the [Codex page](http://codex.wordpress.org/Editing_wp-config.php) says. Please follow the instructions *except* the database settings. +After checking the prerequisites and unzipping the WordPress archive file, you must rename wp-contig-sample.php file to wp-config.php and do some editting as the [Codex page](http://codex.wordpress.org/Editing_wp-config.php) says. Please follow the Codex' instructions *except* the database settings. -When you finish, you can add optional settings. Follow the steps below: +When you finish, you can add optional settings. This is not required. If you don't need optional settings, you don't have to edit wp-config.php any more. * If you want to put the SQLite database file to the directory different from the default setting (wp-content/database), you can add the line below (don't forget to add a trailing slash): @@ -165,6 +165,11 @@ When auto upgrading of SQLite Integration fails, please try manual upgrade via F == Changelog == += 1.4.2 (2013-11-06) = +* Fixed some minor bugs about the information in the dashboard. +* Changed the screenshot. +* Tested WordPress 3.7.1 installation. + = 1.4.1 (2013-09-27) = * Fixed the rewriting process of BETWEEN function. This is a critical bug. When your newly created post contains 'between A and B' phrase, it is not published and disappears. * Fixed the admin dashboard display when using MP6. diff --git a/schema.php b/schema.php index 8bdf71d..248c0fd 100644 --- a/schema.php +++ b/schema.php @@ -14,7 +14,7 @@ function make_db_sqlite() { include_once ABSPATH . 'wp-admin/includes/schema.php'; $index_array = array(); - ob_end_clean(); +// ob_end_clean(); $table_schemas = wp_get_db_schema(); $queries = explode (";", $table_schemas); $query_parser = new CreateQuery(); diff --git a/styles/doc.css b/styles/doc.css index 40069d9..977873b 100644 --- a/styles/doc.css +++ b/styles/doc.css @@ -36,7 +36,7 @@ margin-right: 10px; padding: 5px; border: .5px solit #000; - background: rgb(0, 116, 162); + background: rgb(46, 162, 204); color: rgb(256, 256, 256); } .menu-item a { diff --git a/styles/style.css b/styles/style.css index ab80909..77cdf65 100644 --- a/styles/style.css +++ b/styles/style.css @@ -39,7 +39,7 @@ h3 { margin-right: 10px; padding: 5px; border: .5px solit #000; - background: rgb(0, 116, 162); + background: rgb(46, 162, 204); color: rgb(256, 256, 256); } .menu-item a { diff --git a/utilities/documentation.php b/utilities/documentation.php index 6402046..0454d84 100644 --- a/utilities/documentation.php +++ b/utilities/documentation.php @@ -38,7 +38,7 @@ class SQLiteIntegrationDocument {
- PDO for WordPress, which enabled WordPress to use SQLite for its database. But PDO for WordPress doesn\'t seem to be maintained any more only to be outdated. SQLite Integration makes use of the basic ideas and framework of PDO for WordPress, adds some new features and updates it to be able to work with the newest version of WordPress(3.6).', $domain); ?> + PDO for WordPress, which enabled WordPress to use SQLite for its database. But PDO for WordPress doesn\'t seem to be maintained any more only to be outdated. SQLite Integration makes use of the basic ideas and framework of PDO for WordPress, adds some new features and updates it to be able to work with the newest version of WordPress(3.7.1).', $domain); ?>
SQLite Web Page says — SQLite is a "software library that implements selfcontained, serverless, zero-configuration, transactional SQL database engine". It is "a good choice for small to medium size websites". It\'s small and portable, and you don\'t need any database server system.', $domain); ?>