From cfc1d0b2ef90b56863acce459f264450d298cd74 Mon Sep 17 00:00:00 2001 From: kjmtsh Date: Wed, 25 Sep 2013 07:40:16 +0000 Subject: [PATCH] Removed the rewriting code of the BETWEEN function. Changed some documentation. git-svn-id: https://plugins.svn.wordpress.org/sqlite-integration/trunk@778174 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- languages/sqlite-integration-ja.mo | Bin 48905 -> 49138 bytes languages/sqlite-integration-ja.po | 15 +++++++ pdoengine.class.php | 70 ++++++++++++++--------------- query.class.php | 16 +++---- readme-ja.txt | 5 ++- readme.txt | 7 +-- utilities/database_maintenance.php | 37 ++++++++------- utilities/plugin_lists.json | 18 ++++---- 8 files changed, 94 insertions(+), 74 deletions(-) diff --git a/languages/sqlite-integration-ja.mo b/languages/sqlite-integration-ja.mo index 4d86a9c16806574cfa2abafb27283f5373f9d35d..8160f79496997025af1af8d2a24d9a6a96db4093 100644 GIT binary patch delta 5402 zcmYk<30%)<9>DQOR1_jgjwojnVJKk+<*LzvGD<6ia>WQy*#1T+(h%b&-joph%JIfu{8fz5C zOQIQZ#8IiRYD$H>NUc(74V9{o=~xGIOuhkQIIjrTQeWL&sX4e2)6un&QVzHrLK+8B${kVNEGDiytWzFI+nPOF3FgwL@S`8m9Zm$3^yE%3CpSY2(dZ+s7B zL>{9&;9uAP?ON!1cch1^HOhlKVNL9V-WZB4EEFbFXot&CZg3deV;RZ=ULc*4=E^_S zj6ZJJ3v1D^Xp|1bb64qcBFYda8`DrmauLe?u45Z~gcfO0?UqV0jmizXpfA!H6_0dY z%|~h225gI;VJp0XzW5qxqiRKE2keJ+aXQNVEyiq=`{bcKZ&xeEUs_sXD$0zvupaf# z@Htj%t%vv}rc|SX=D!a!XpPME0hET`M=nus&=p%UtkS>$WL>H;*cs>GAnvoborP6Q z#Y-Qifr_wqlp2f2xatY@jp@#IayvhzhLi8?$iwhgOu?c~N;R@m%9FcFg98}82{;g? z=lfCWk0Xyz=deCLM_CiqEnRgF8lXKD15idJ%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V6&6-mh*D)EbVrGH&6I8GQCpgW7ENXm_R%D zl-Z7%IE40A)Lm17IxtAU_1xUuQh~vXeNmu z+7T^VNFS?awwm5hhrO45Ot<@W!a9{7bp9*LYAQ^<^{?1!xQehjgi*G>4Sj_z$UUM( zpY$ooArHvwL`wnDc~2v}=&Y$@#N`p0O3KM6M2q89qxJSGwd+iqRqpV!A-P5vY3m;v z-WWqF%VR1-i9X0}!kV?dtj)TCL z%+LcAeZ6XFO|}xYul3CdtTLOQH^@IsQ`nu>{~2LdTV*Lf$B=)LLNbBqA3E#xnSvLH zmZoGFVKYb-(wMwNrV&4)<(9$vUoC^|`Woy(R@m)StVy1bf00gP5}88kk#5A1$d5f_ zA-PKOh!6RgXz5Ju6Mv#5iX@R-l25d_leb71i6gs6E28B`l1?^|l_Y>@*-4J*{CA-; zoP?4_B#=}mpAju>46?xXTicKD94R9c?PK$C4w-JZBW+){4aP6+Iiotqy zcBQ_YbR=iVcH%`Ylk=pqd{bFLU-Aa2O+Fx%WgC@D(%wE$7Y~w4#Cse+`jaA}Wsx(} zcUBE&d4n0Q&a}ppe4Sr+4DxdR-ut4v^HTh|`p(VitE)I)$q20POv(Gq-`Qr@k{Zs_ I2Rr!u9})+sumAu6 diff --git a/languages/sqlite-integration-ja.po b/languages/sqlite-integration-ja.po index 16d0fd5..ab80428 100644 --- a/languages/sqlite-integration-ja.po +++ b/languages/sqlite-integration-ja.po @@ -1364,3 +1364,18 @@ msgstr "%sのカラム" msgid "Columns Info" msgstr "カラム情報" + +msgid "Table Name: " +msgstr "テーブル名" + +msgid "Column" +msgstr "カラム" + +msgid "Type" +msgstr "タイプ" + +msgid "Null" +msgstr "ヌル" + +msgid "Default" +msgstr "デフォルト" diff --git a/pdoengine.class.php b/pdoengine.class.php index 70c6279..3b08ffb 100644 --- a/pdoengine.class.php +++ b/pdoengine.class.php @@ -34,7 +34,7 @@ class PDOEngine extends PDO { /** * Constructor - * @param array $DatabaseParams + * @param */ function __construct() { $this->init(); @@ -79,8 +79,8 @@ class PDOEngine extends PDO { if ($status == 5 || $status == 6) { $locked = true; } else { - $message = __("Database connection error!
", 'sqlite-integration'); - $message .= sprintf(__("Error message is: %s", 'sqlite-integration'), $err->getMessage()); + $message = 'Database connection error!
'; + $message .= sprintf("Error message is: %s", $err->getMessage()); $this->set_error(__LINE__, __FUNCTION__, $message); return false; } @@ -95,8 +95,8 @@ class PDOEngine extends PDO { try { $this->pdo = new PDO($dsn, null, null, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); } catch (PDOException $err) { - $message = __("Database connection error!
", 'sqlite-integration'); - $message .= sprintf(__("Error message is: %s", 'sqlite-integration'), $err->getMessage()); + $message = 'Database initialization error!
'; + $message .= sprintf("Error message is: %s", $err->getMessage()); $this->set_error(__LINE__, __FUNCTION__, $message); return false; } @@ -133,7 +133,7 @@ class PDOEngine extends PDO { echo $message; return false; } - fwrite($fh, "DENY FROM ALL"); + fwrite($fh, 'DENY FROM ALL'); fclose($fh); } umask($u); @@ -144,7 +144,7 @@ class PDOEngine extends PDO { * executed once while installation process */ private function make_sqlite_tables() { - require_once PDODIR . "install.php"; + require_once PDODIR . 'install.php'; } public function query($query) { @@ -252,7 +252,7 @@ class PDOEngine extends PDO { ob_start(); debug_print_backtrace(); - $output .= "
" . ob_get_contents() . "
"; + $output .= '
' . ob_get_contents() . '
'; ob_end_clean(); return $output; @@ -298,7 +298,7 @@ class PDOEngine extends PDO { } private function prepare_query(){ - $this->queries[] = "Prepare:\t". $this->prepared_query; + $this->queries[] = 'Prepare: ' . $this->prepared_query; $reason = 0; $message = ''; $statement = null; @@ -312,7 +312,7 @@ class PDOEngine extends PDO { } while (5 == $reason || 6 == $reason); if ($reason > 0){ - $err_message = sprintf(__("Problem preparing the PDO SQL Statement. Error was: %s", 'sqlite-integration'), $message); + $err_message = sprintf("Problem preparing the PDO SQL Statement. Error was: %s", $message); $this->set_error(__LINE__, __FUNCTION__, $err_message); } return $statement; @@ -324,7 +324,7 @@ class PDOEngine extends PDO { if (!is_object($statement)) return; if (count($this->extracted_variables) > 0) { - $this->queries[] = "Executing: ". var_export($this->extracted_variables, true); + $this->queries[] = 'Executing: ' . var_export($this->extracted_variables, true); do { if ($this->query_type == 'update' || $this->query_type == 'replace') { try { @@ -346,7 +346,7 @@ class PDOEngine extends PDO { } } while (5 == $reason || 6 == $reason); } else { - $this->queries[] = "Executing: (no parameters)\t "; + $this->queries[] = 'Executing: (no parameters)'; do{ if ($this->query_type == 'update' || $this->query_type == 'replace') { try { @@ -369,7 +369,7 @@ class PDOEngine extends PDO { } while (5 == $reason || 6 == $reason); } if ($reason > 0) { - $err_message = sprintf(__("Error while executing query! Error message was: %s", 'sqlite-integration'), $message); + $err_message = sprintf("Error while executing query! Error message was: %s", $message); $this->set_error(__LINE__, __FUNCTION__, $err_message); return false; } else { @@ -377,32 +377,32 @@ class PDOEngine extends PDO { } //generate the results that $wpdb will want to see switch ($this->query_type) { - case "insert": - case "update": - case "replace": + case 'insert': + case 'update': + case 'replace': $this->last_insert_id = $this->pdo->lastInsertId(); $this->affected_rows = $statement->rowCount(); $this->return_value = $this->affected_rows; break; - case "select": - case "show": - case "showcolumns": - case "showindex": - case "describe": - case "desc": + case 'select': + case 'show': + case 'showcolumns': + case 'showindex': + case 'describe': + case 'desc': // case "foundrows": $this->num_rows = count($this->_results); $this->return_value = $this->num_rows; break; - case "delete": + case 'delete': $this->affected_rows = $statement->rowCount(); $this->return_value = $this->affected_rows; break; - case "alter": - case "drop": - case "create": - case "optimize": - case "truncate": + case 'alter': + case 'drop': + case 'create': + case 'optimize': + case 'truncate': if ($this->is_error) { $this->return_value = false; } else { @@ -423,7 +423,7 @@ class PDOEngine extends PDO { $_limit = $limit = ini_get('pcre.backtrack_limit'); do { if ($limit > 10000000) { - $message = __("The query is too big to parse properly", 'sqlite-integration'); + $message = 'The query is too big to parse properly'; $this->set_error(__LINE__, __FUNCTION__, $message); break; //no point in continuing execution, would get into a loop } else { @@ -435,7 +435,7 @@ class PDOEngine extends PDO { //reset the pcre.backtrack_limist ini_set('pcre.backtrack_limit', $_limit); - $this->queries[]= "With Placeholders: $query "; + $this->queries[]= 'With Placeholders: ' . $query; $this->prepared_query = $query; } @@ -504,7 +504,7 @@ class PDOEngine extends PDO { private function execute_insert_query_new($query) { $engine = $this->prepare_engine($this->query_type); $this->rewritten_query = $engine->rewrite_query($query, $this->query_type); - $this->queries[] = "Rewritten: $this->rewritten_query"; + $this->queries[] = 'Rewritten: ' . $this->rewritten_query; $this->extract_variables(); $statement = $this->prepare_query(); $this->execute_query($statement); @@ -543,7 +543,7 @@ class PDOEngine extends PDO { } $query_string = $query_prefix . ' ' . $value . $suffix; $this->rewritten_query = $engine->rewrite_query($query_string, $this->query_type); - $this->queries[] = "Rewritten: $this->rewritten_query"; + $this->queries[] = 'Rewritten: ' . $this->rewritten_query; $this->extracted_variables = array(); $this->extract_variables(); if ($first) { @@ -556,7 +556,7 @@ class PDOEngine extends PDO { } } else { $this->rewritten_query = $engine->rewrite_query($query, $this->query_type); - $this->queries[] = "Rewritten: $this->rewritten_query"; + $this->queries[] = 'Rewritten: ' . $this->rewritten_query; $this->extract_variables(); $statement = $this->prepare_query(); $this->execute_query($statement); @@ -632,7 +632,7 @@ class PDOEngine extends PDO { } } if ($reason > 0) { - $err_message = sprintf(__("Problem in creating table or index. Error was: %s", 'sqlite-integration'), $message); + $err_message = sprintf("Problem in creating table or index. Error was: %s", $message); $this->set_error(__LINE__, __FUNCTION__, $err_message); return false; } @@ -683,7 +683,7 @@ class PDOEngine extends PDO { $this->query($re_query); } if ($reason > 0) { - $err_message = sprintf(__("Problem in executing alter query. Error was: %s", 'sqlite-integration'), $message); + $err_message = sprintf("Problem in executing alter query. Error was: %s", $message); $this->set_error(__LINE__, __FUNCTION__, $err_message); return false; } diff --git a/query.class.php b/query.class.php index 47d970b..640be64 100644 --- a/query.class.php +++ b/query.class.php @@ -54,7 +54,7 @@ class PDOSQLiteDriver { $this->_rewrite_regexp(); $this->_rewrite_boolean(); $this->_fix_date_quoting(); - $this->_rewrite_between(); +// $this->_rewrite_between(); break; case 'insert': $this->_strip_backticks(); @@ -70,7 +70,7 @@ class PDOSQLiteDriver { $this->_rewrite_limit_usage(); $this->_rewrite_order_by_usage(); $this->_rewrite_regexp(); - $this->_rewrite_between(); +// $this->_rewrite_between(); break; case 'delete': $this->_strip_backticks(); @@ -488,13 +488,13 @@ class PDOSQLiteDriver { $this->_query = $update_query; } } - } else { - // wordaround... - $pattern = '/ ON DUPLICATE KEY UPDATE.*$/im'; - $replace_query = preg_replace($pattern, '', $this->_query); - $replace_query = str_ireplace('INSERT ', 'INSERT OR REPLACE ', $replace_query); - $this->_query = $replace_query; } +// else { +// $pattern = '/ ON DUPLICATE KEY UPDATE.*$/im'; +// $replace_query = preg_replace($pattern, '', $this->_query); +// $replace_query = str_ireplace('INSERT ', 'INSERT OR REPLACE ', $replace_query); +// $this->_query = $replace_query; +// } } private function _rewrite_between() { diff --git a/readme-ja.txt b/readme-ja.txt index ba2bdf4..2c22e0c 100644 --- a/readme-ja.txt +++ b/readme-ja.txt @@ -6,7 +6,7 @@ Tags: database, SQLite, PDO Author: Kojima Toshiyasu Author URI: http://dogwood.skr.jp/ Requires at least: 3.3 -Tested up to: 3.6 +Tested up to: 3.6.1 Stable tag: 1.4 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -50,7 +50,8 @@ SQLite Integrationは普通の「プラグイン」ではありません。WordP 下の方法でコンタクトを取ってください。 -[Support Forum](http://wordpress.org/support/plugin/sqlite-integration)にポストする。 +1. [Support Forum](http://wordpress.org/support/plugin/sqlite-integration)にポストする。 +2. [SQLite Integration(ja)のページ](http://dogwood.skr.jp/wordpress/sqlite-integration-ja/)でメッセージを残す。 注意: WordPress.orgはMySQL以外のデータベースを正式にサポートしていません。だから、WordPress.orgからのサポートは得られません。フォーラムに投稿しても、回答を得ることはまずないでしょう。また、パッチをあてたプラグインを使う場合は、そのプラグインの作者からのサポートはないものと思ってください。自分でリスクを負う必要があります。 diff --git a/readme.txt b/readme.txt index 3ec24c9..f2c698a 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tags: database, SQLite, PDO Author: Kojima Toshiyasu Author URI: http://dogwood.skr.jp/ Requires at least: 3.3 -Tested up to: 3.6 +Tested up to: 3.6.1 Stable tag: 1.4 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -38,7 +38,7 @@ When you installed WordPress 3.6 with this plugin or your WordPress is 3.5.x, yo = Features = -SQLite Integration is not an ordinary 'plugin'. It is used to install WordPress itself. You need to do some preparations. 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 not an ordinary 'plugin'. It is used to install WordPress itself. You need to do some preparations. Please read the install section. And see more detailed instruction in the [SQLite Integration Page](http://dogwood.skr.jp/wordpress/sqlite-integration/). Once you succeeded in installing WordPress, you can use it just like the others using MySQL. Optionally, you can activate this plugin in the installed plugins panel of the adimn dashboard, and you can see the useful information and instructions. It is not required but I recommend it. @@ -50,7 +50,8 @@ If you are using [PDO for WordPress](http://wordpress.org/extend/plugins/pdo-for Please contact us with the methods below: -Post to [Support Forum](http://wordpress.org/support/plugin/sqlite-integration/). +1. Post to [Support Forum](http://wordpress.org/support/plugin/sqlite-integration/). +2. Visti the [SQLite Integration Page](http://dogwood.skr.jp/wordpress/sqlite-integration/) or [SQLite Integration(ja) Page](http://dogwood.skr.jp/wordpress/sqlite-integration-ja/) and leave a message. Notes: WordPress.org doesn't officially support using any other database than MySQL. So there will be no supports from WordPress.org. Even if you post to the general Forum, you have few chances to get the answer. And if you use patched plugins, you will have no support from the plugin authors, eithter. diff --git a/utilities/database_maintenance.php b/utilities/database_maintenance.php index 3ddc8a5..65be138 100644 --- a/utilities/database_maintenance.php +++ b/utilities/database_maintenance.php @@ -304,14 +304,13 @@ class DatabaseMaintenance { ) ); if (version_compare($wp_version, '3.6', '<')) return false; - $results = $this->sanity_check(); $return_val = array(); $queries = array(); + $results = $this->sanity_check(); if ($results !== true) { if (!$this->maintenance_backup()) { $message = __('Can\'t create backup file.', $domain); - echo $message; - return false; + return $message; } $tables = array_keys($results); foreach ($tables as $table) { @@ -334,10 +333,12 @@ class DatabaseMaintenance { } } } else { - return true; + $message = __('Your database is OK. You don\'t have to restore it.', $domain); + return $message; } if (empty($return_val)) { - return true; + $message = __('Your database restoration is successfully finished!', $domain); + return $message; } else { return $return_val; } @@ -398,8 +399,6 @@ class DatabaseMaintenance { } elseif (!current_user_can('manage_options')) { die(__('You are not allowed to access this page!', $domain)); } - - if (isset($_GET['page']) && $_GET['page'] == 'maintenance') : ?>