diff --git a/languages/sqlite-integration-ja.mo b/languages/sqlite-integration-ja.mo index 4d86a9c..8160f79 100644 Binary files a/languages/sqlite-integration-ja.mo and b/languages/sqlite-integration-ja.mo differ 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') : ?>