diff --git a/db.php b/db.php index 3724300..30df2a8 100644 --- a/db.php +++ b/db.php @@ -5,12 +5,11 @@ * wordpress/wp-content/db.php * * @package SQLite Integration - * @version 1.1 * @author Kojima Toshiyasu, Justin Adie * */ -function pdo_log_erro($message, $data = null) { +function pdo_log_error($message, $data = null) { if (strpos($_SERVER['SCRIPT_NAME'], 'wp-admin') !== false) { $admin_dir = ''; @@ -38,15 +37,15 @@ HTML } if (version_compare( PHP_VERSION, '5.2.4', '<')) { - pdo_log_erro(__('PHP version on this server is too old.'), sprinf(__("Your server is running PHP version %d but this version of WordPress requires at least 5.2.4"), phpversion())); + pdo_log_error('PHP version on this server is too old.', sprinf("Your server is running PHP version %d but this version of WordPress requires at least 5.2.4", phpversion())); } if (!extension_loaded('pdo')) { - pdo_log_erro(__('PHP PDO Extension is not loaded.'), __('Your PHP installation appears to be missing the PDO extension which is required for this version of WordPress.')); + pdo_log_error('PHP PDO Extension is not loaded.', 'Your PHP installation appears to be missing the PDO extension which is required for this version of WordPress.'); } if (!extension_loaded('pdo_sqlite')) { - pdo_log_erro(__('PDO Driver for SQLite is missing.'), __('Your PHP installtion appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.')); + pdo_log_error('PDO Driver for SQLite is missing.', 'Your PHP installtion appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.'); } /** diff --git a/functions-5-2.php b/functions-5-2.php index 6867473..934b57b 100644 --- a/functions-5-2.php +++ b/functions-5-2.php @@ -1,7 +1,6 @@ 'inet_ntoa', 'inet_aton' => 'inet_aton', 'datediff' => 'datediff', - 'locate' => 'locate' + 'locate' => 'locate', + 'version' => 'version' ); public function month($field){ @@ -385,5 +385,12 @@ class PDOSQLiteUDFS { } } } + /** + * + */ + public function version() { + global $required_mysql_version; + return $required_mysql_version; + } } ?> \ No newline at end of file diff --git a/functions.php b/functions.php index 8cb715c..e97e373 100644 --- a/functions.php +++ b/functions.php @@ -1,7 +1,6 @@ 'inet_ntoa', 'inet_aton' => 'inet_aton', 'datediff' => 'datediff', - 'locate' => 'locate' + 'locate' => 'locate', + 'version' => 'version' ); public function month($field){ @@ -359,5 +359,12 @@ class PDOSQLiteUDFS { } } } + /** + * + */ + public function version() { + global $required_mysql_version; + return $required_mysql_version; + } } ?> \ No newline at end of file diff --git a/install.php b/install.php index 3f48dbf..8c1a253 100644 --- a/install.php +++ b/install.php @@ -1,13 +1,12 @@

'; + echo $server_message; + echo '

'; + } + return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message); } ?> \ No newline at end of file diff --git a/js/sqlite.js b/js/sqlite.js index 140eae7..228697c 100644 --- a/js/sqlite.js +++ b/js/sqlite.js @@ -14,6 +14,9 @@ jQuery(document).ready(function($) { } else if (document.getElementById("patch-files") != null) { $table = $('#patch-files'); $headers = $table.find('thead th').slice(1); + } else if (document.getElementById("backup-files") != null) { + $table = $('#backup-files'); + $headers = $table.find('thead th').slice(1); } $headers .wrapInner('') diff --git a/languages/sqlite-integration-ja.mo b/languages/sqlite-integration-ja.mo index a5db75e..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 2c6c093..b7b9c56 100644 --- a/languages/sqlite-integration-ja.po +++ b/languages/sqlite-integration-ja.po @@ -1,188 +1,133 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2013 THE PACKAGE'S COPYRIGHT HOLDER +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# Kojima Toshiyasu , 2013. +# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-21 13:11+0900\n" -"PO-Revision-Date: 2013-05-21 13:11+0900\n" +"POT-Creation-Date: 2013-09-03 14:31+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Kojima Toshiyasu \n" "Language-Team: LANGUAGE \n" "Language: Japanese\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: db.php:46 -msgid "PHP version on this server is too old." -msgstr "お使いのPHPが古すぎます。" - -#: db.php:46 -#, php-format -msgid "" -"Your server is running PHP version %d but this version of WordPress requires " -"at least 5.2.4" -msgstr "" -"PHP%dをお使いになっていますが、WordPressには5.2.4以上が必要です。" - -#: db.php:50 -msgid "PHP PDO Extension is not loaded." -msgstr "PHPのPDOエクステンションがロードされていません。" - -#: db.php:50 -msgid "" -"Your PHP installation appears to be missing the PDO extension which is " -"required for this version of WordPress." -msgstr "" -"このWordPressで必要とされるPHPのPDOエクステンションが欠けているようです。" - -#: db.php:54 -msgid "PDO Driver for SQLite is missing." -msgstr "PDOのSQLite用ドライバがありません。" - -#: db.php:54 -msgid "" -"Your PHP installtion appears not to have the right PDO drivers loaded. These " -"are required for this version of WordPress and the type of database you have " -"specified." -msgstr "" -"お使いのPHPでは、必要なPDOドライバがロードされていないようです。これは、WordPressとデータベースを運用するのに" -"必要です。" - -#: install.php:42 +#: install.php:40 msgid "" "Note that password carefully! It is a random password that was generated just for you." -msgstr "" -"注意してパスワードを控えてください! これはランダムに" -"作成されたものです。" +msgstr "注意してこのパスワードを扱ってください。これはランダムに生成された" +"パスワードです。" -#: install.php:47 +#: install.php:45 msgid "Your chosen password." -msgstr "あなたが決めたパスワード。" +msgstr "あなたが入力したパスワード。" -#: install.php:58 +#: install.php:56 msgid "The password you chose during the install." -msgstr "インストールのときにあなたが決めたパスワード。" +msgstr "インストールのときにあなたが入力したパスワード。" #: pdodb.class.php:96 #, php-format msgid "WordPress database error %1$s for query %2$s made by %3$s" -msgstr "WordPressデータベースエラー%1$s。クエリは%2$s。%3$sが作成しました。" +msgstr "データベース・エラーです。メッセージ: %1$s, クエリ: %2$s, 呼び出し: %3$s" #: pdodb.class.php:98 #, php-format msgid "WordPress database error %1$s for query %2$s" -msgstr "WordPressデータベースエラー%1$s。クエリは%2$s。" +msgstr "データベース・エラーです。メッセージ: %1$s, クエリ: %2$s" -#: pdodb.class.php:134 +#: pdodb.class.php:136 #, php-format msgid "" "

Error establlishing a database connection

We have been unable to " "connect to the specified database.
The error message received was %s" msgstr "" -"

データベース接続エラー

データベースに接続できませんでした。
エラーメッセージは、%sです。" +"

データベース接続エラー

データベースに接続できません。
エラーメッセージは、%s" -#: pdoengine.class.php:80 pdoengine.class.php:96 schema.php:26 +#: pdoengine.class.php:82 pdoengine.class.php:98 msgid "Database connection error!
" msgstr "データベース接続エラー!
" -#: pdoengine.class.php:81 pdoengine.class.php:97 schema.php:27 schema.php:81 +#: pdoengine.class.php:83 pdoengine.class.php:99 +#, php-format msgid "Error message is: %s" -msgstr "エラーメッセージは: " +msgstr "エラーメッセージ: %s" -#: pdoengine.class.php:115 -msgid "" -"Unable to create the required directory! Please check your server settings." -msgstr "" -"必要なディレクトリが作成できませんでした。サーバ設定を確認してください。" - -#: pdoengine.class.php:120 pdoengine.class.php:126 -msgid "" -"Unable to create a file in the directory! Please check your server settings." -msgstr "" -"ディレクトリにファイルを作成できませんでした。サーバ設定を確認してください。" - -#: pdoengine.class.php:148 +#: pdoengine.class.php:156 #, php-format msgid "" "

Unknown query type

Sorry, we cannot determine the type of query " "that is requested.

The query is %s

" msgstr "" -"

未知のクエリ

申し訳ありません、要求されたクエリのタイプを決定できません。

クエリは%s" -"です。

" +"

不明のクエリ

申し訳ありません。要求されたクエリのタイプを判別できませんでした。

" +"

クエリ: %s

" -#: pdoengine.class.php:294 +#: pdoengine.class.php:315 #, php-format msgid "Problem preparing the PDO SQL Statement. Error was: %s" -msgstr "SQLステートメントの準備中に問題。エラーは: %s" +msgstr "PDO SQLステートメントを準備中に問題がありました。エラー: %s" -#: pdoengine.class.php:327 +#: pdoengine.class.php:372 #, php-format msgid "Error while executing query! Error message was: %s" -msgstr "クエリの実行中にエラー! エラーメッセージは: %s" +msgstr "クエリを実行中にエラーが発生しました。エラーメッセージ: %s" -#: pdoengine.class.php:381 +#: pdoengine.class.php:426 msgid "The query is too big to parse properly" -msgstr "クエリが長すぎて解析できません" +msgstr "クエリが長すぎてちゃんと解析できません" -#: pdoengine.class.php:583 +#: pdoengine.class.php:635 #, php-format msgid "Problem in creating table or index. Error was: %s" -msgstr "テーブルまたはインデックスを作成中に問題発生。エラーは: %s" +msgstr "テーブルかインデックスを作るときに問題がありました。エラー: %s" -#: pdoengine.class.php:626 +#: pdoengine.class.php:678 #, php-format msgid "Problem in executing alter query. Error was: %s" -msgstr "ALTERクエリを実行中に問題発生。エラーは: %s" - -#: schema.php:80 -#, php-format -msgid "" -"Error occured while creating tables or indexes...
Query was: %s
" -msgstr "" -"テーブルまたはインデックスを作成中にエラー発生。
クエリは: %s
" +msgstr "ALTERクエリを実行中に問題がありました。エラー: %s" #: sqlite-integration.php:158 sqlite-integration.php:181 msgid "SQLite Integration" msgstr "" -#: utilities/documentation.php:17 utilities/documentation.php:19 -#: utilities/patch.php:157 utilities/patch.php:159 utilities/utility.php:382 -#: utilities/utility.php:384 utilities/utility.php:555 -#: utilities/utility.php:557 +#: utilities/documentation.php:16 utilities/documentation.php:18 +#: utilities/patch.php:161 utilities/patch.php:163 +#: utilities/utility.php:450 utilities/utility.php:452 +#: utilities/utility.php:636 utilities/utility.php:638 msgid "You are not allowed to access this page!" msgstr "このページにアクセスする権限がありません!" -#: utilities/documentation.php:24 utilities/documentation.php:31 -#: utilities/patch.php:217 utilities/utility.php:354 utilities/utility.php:389 -#: utilities/utility.php:601 +#: utilities/documentation.php:23 utilities/documentation.php:30 +#: utilities/patch.php:221 utilities/utility.php:422 +#: utilities/utility.php:457 utilities/utility.php:711 msgid "Documentation" msgstr "ドキュメント" -#: utilities/documentation.php:25 utilities/patch.php:218 -#: utilities/utility.php:358 utilities/utility.php:390 -#: utilities/utility.php:602 +#: utilities/documentation.php:24 utilities/patch.php:222 +#: utilities/utility.php:426 utilities/utility.php:458 +#: utilities/utility.php:712 msgid "System Info" msgstr "システム情報" -#: utilities/documentation.php:26 utilities/patch.php:219 -#: utilities/utility.php:362 utilities/utility.php:391 -#: utilities/utility.php:603 +#: utilities/documentation.php:25 utilities/patch.php:223 +#: utilities/utility.php:430 utilities/utility.php:459 +#: utilities/utility.php:713 msgid "Miscellaneous" -msgstr "いろいろなもの" +msgstr "いろいろ" -#: utilities/documentation.php:27 utilities/patch.php:220 -#: utilities/utility.php:366 utilities/utility.php:392 -#: utilities/utility.php:604 +#: utilities/documentation.php:26 utilities/patch.php:224 +#: utilities/utility.php:434 utilities/utility.php:460 +#: utilities/utility.php:714 msgid "Patch Utility" -msgstr "パッチをあてる" +msgstr "パッチ" -#: utilities/documentation.php:33 +#: utilities/documentation.php:32 msgid "" "This is a brief documentation about this plugin. For more details, see also " "the Plugin " @@ -191,7 +136,7 @@ msgstr "" "このプラグインについての短いドキュメントです。詳しくは、プラグインのページをご覧ください。" -#: utilities/documentation.php:36 +#: utilities/documentation.php:35 msgid "" "Please don't forget: WordPress DOES NOT OFFICIALLY SUPPORT any database " "other than MySQL. So if you ask about this plugin in the Forum, it's not " @@ -200,26 +145,26 @@ msgstr "" "忘れないでください。WordPressが正式にサポートしているのはMySQLだけです。だから、フォーラムで質問しても、" "回答が得られることは少ないでしょう。" -#: utilities/documentation.php:39 +#: utilities/documentation.php:38 msgid "Features" msgstr "機能" -#: utilities/documentation.php:41 +#: utilities/documentation.php:40 msgid "" "This plugin is a successor to 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.5.1 and 3.6 beta)." +"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)." msgstr "" "このプラグインは" "PDO for WordPressの後継です。PDO for WordPressはWordPressでSQLiteを使えるようにする" "ものでしたが、もうメンテナンスされていないようで、古くなってしまいました。SQLite Integrationは、その基本的な" -"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.5.1および3.6ベータ)で動作するように" +"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.7.1)で動作するように" "したものです。" -#: utilities/documentation.php:44 +#: utilities/documentation.php:43 msgid "" "SQLite Web Page says — SQLite " "is a "software library that implements selfcontained, serverless, zero-" @@ -232,7 +177,7 @@ msgstr "" "のライブラリです"。"小規模・中規模のウェブサイトによく合います"。小さくてポータブル、" "データベース・サーバなしでも使えるデータベースです。" -#: utilities/documentation.php:47 +#: utilities/documentation.php:46 msgid "" "Unfortunately enough, WordPress only supports MySQL. Consequently it doesn't " "provide any APIs for SQLite. So if you want to create a website using " @@ -243,53 +188,53 @@ msgstr "" "存在しません。だから、データベース・サーバなしでWordPressを使い、ウェブサイトを作ろうと思ったら、ある種の" "ラッパ・プログラムを書かなければなりません。これが、SQLite Integrationです。" -#: utilities/documentation.php:50 +#: utilities/documentation.php:49 msgid "SQLite Integration does the work as follows:" msgstr "SQLite Integrationは次のように動作します:" -#: utilities/documentation.php:53 +#: utilities/documentation.php:52 msgid "Intercepts SQL statement for MySQL from WordPress" msgstr "WordPressからMySQLに発行されるSQLステートメントをインターセプトします" -#: utilities/documentation.php:54 +#: utilities/documentation.php:53 msgid "Rewrites it as SQLite can execute" msgstr "SQLiteが実行できる形に書き換えます" -#: utilities/documentation.php:55 +#: utilities/documentation.php:54 msgid "Gives it to SQLite" msgstr "SQLiteに実行させます" -#: utilities/documentation.php:56 +#: utilities/documentation.php:55 msgid "Gets the results from SQLite" msgstr "SQLiteから結果を受け取ります" -#: utilities/documentation.php:57 +#: utilities/documentation.php:56 msgid "Format the results as MySQL returns, if necessary" msgstr "必要があれば、その結果をMySQLが返す形に整形します" -#: utilities/documentation.php:58 +#: utilities/documentation.php:57 msgid "Gives back the results to WordPress" msgstr "WordPressに結果を返します" -#: utilities/documentation.php:61 +#: utilities/documentation.php:60 msgid "" "WordPress doesn't know what has happened in the background and will be happy " "with it." msgstr "" "WordPressは背後で何が起こっているかを知らず、普通通り動作を続けます。" -#: utilities/documentation.php:64 +#: utilities/documentation.php:63 msgid "Limitations" msgstr "できないこと" -#: utilities/documentation.php:66 +#: utilities/documentation.php:65 msgid "" "SQLite Integration uses SQLite, so the limitations of SQLite is, as it is, " "those of SQLite Integration. MySQL is far from a simple SQL engine and has " "many extended features and functionalities. WordPress uses some of them. " "Among those are some SQLite doesn't implement. For those features that " -"WordPress uses, I made them work with SQLite Integration. But for others that " -"some plugins are using, SQLite Integration can't manipulate. So..." +"WordPress uses, I made them work with SQLite Integration. But for others " +"that some plugins are using, SQLite Integration can't manipulate. So..." msgstr "" "SQLite IntegrationはSQLiteを使います。だから、SQLiteの限界がそのまま、SQLite Integrationの" "限界になります。MySQLは単純なSQLエンジンなどというものではなくて、たくさんの拡張機能があります。" @@ -297,11 +242,11 @@ msgstr "" "SQLite Integrationが動作するようにしました。でも、他のプラグインが使っているようなもので、SQLite Integration" "が扱えないものもあります。だから..." -#: utilities/documentation.php:69 +#: utilities/documentation.php:68 msgid "There are some plugins that you can't use in any way.
" msgstr "どうしても使えないプラグインがあります。" -#: utilities/documentation.php:70 +#: utilities/documentation.php:69 msgid "" "Some plugins can't be activated or work properly. See the "Plugin " "Compatibility/Incompatibility" section." @@ -309,14 +254,14 @@ msgstr "" "プラグインの中には、有効化できなかったり、うまく動作しなかったりするものがあります。「プラグインの互換性」" "セクションをご覧ください。" -#: utilities/documentation.php:71 +#: utilities/documentation.php:70 msgid "" "There are some plugins that you can't use without rewriting some codes in " "them.
" msgstr "" "中のコードを書き換えなければ動作しないプラグインがあります。
" -#: utilities/documentation.php:72 +#: utilities/documentation.php:71 #, php-format msgid "" "Some plugins do work fine if you rewrite MySQL functions. I made some patch " @@ -328,7 +273,7 @@ msgstr "" "パッチをあてるページを作りました。" "プラグインのページもご覧ください。" -#: utilities/documentation.php:75 +#: utilities/documentation.php:74 msgid "" "And there may be other problems I overlooked. If you find malfunctionality, " "please let me know at the サポートフォーラムでお知らせください。" -#: utilities/documentation.php:77 +#: utilities/documentation.php:76 msgid "User Defined Functions" msgstr "ユーザ定義関数" -#: utilities/documentation.php:79 +#: utilities/documentation.php:78 msgid "" "SQLite Integration replaces some functions of MySQL with the user defined " "functions built in PHP PDO library. But some of the functions are " @@ -353,55 +298,55 @@ msgstr "" "書き換えます。でも、SQLiteでは意味のない関数もあります。たとえば、get_lock()やrelease_lock()" "などです。SQLite Integrationは、これらの関数がエラーを出さないようにする以外のことをしていません。" -#: utilities/documentation.php:82 +#: utilities/documentation.php:81 msgid "" "If you want SQLite Integration to execute more functions, you can add the " -"definition in the file sqlite-integration/functions.php (functions-5-2.php is " -"for PHP 5.2 or lesser)." +"definition in the file sqlite-integration/functions.php (functions-5-2.php " +"is for PHP 5.2 or lesser)." msgstr "" "SQLite Integrationにもっとさくさんの関数を実行させたいときには、sqlite-integration/functions.php" "(functions-5-2.phpはPHP5.2以前用です)に定義を追加することができます。" -#: utilities/documentation.php:85 +#: utilities/documentation.php:84 msgid "Database Administration and Maintenance" msgstr "データベース管理・メンテナンス" -#: utilities/documentation.php:87 +#: utilities/documentation.php:86 msgid "" -"SQLite Integration doesn't contain database maintenace functionality, because " -"there are some other free or proprietary softwares that give you such " -"functionalities. For example, these are among free softwares:" +"SQLite Integration doesn't contain database maintenace functionality, " +"because there are some other free or proprietary softwares that give you " +"such functionalities. For example, these are among free softwares:" msgstr "" "SQLite Integrationはメンテナンスの機能を持っていません。というのは、他に同じ機能を提供することができる、" "フリーや独占ソフトウェアがあるからです。フリー・ソフトウェアには、次のようなものがあります。" -#: utilities/documentation.php:90 +#: utilities/documentation.php:89 msgid "my recommendation" msgstr "お勧めです" -#: utilities/documentation.php:91 +#: utilities/documentation.php:90 msgid "unfortunately seems not to maintained..." msgstr "残念なことにあまり活発に開発されていないようです..." -#: utilities/documentation.php:94 +#: utilities/documentation.php:93 msgid "" "I'm not sure if future release may have some of the database maintenance " "functionality." msgstr "" "将来のリリースでデータベースのメンテナンス機構を組み込むかどうかはわかりません。" -#: utilities/documentation.php:100 +#: utilities/documentation.php:99 msgid "Plugin Compatibility/Incompatibility" msgstr "プラグインの互換性/非互換性" -#: utilities/documentation.php:102 +#: utilities/documentation.php:101 msgid "" "WordPress without its plugins is a king without people. Of course, you need " "plugins, I know." msgstr "" "プラグインなしのWordPressは、国民のいない王様です。プラグインが使えなければなりません。" -#: utilities/documentation.php:105 +#: utilities/documentation.php:104 #, php-format msgid "" "Most of the plugins will work fine with this plugin. But there are some that " @@ -418,36 +363,36 @@ msgstr "" "プラグインのページ" "をご覧ください。" -#: utilities/documentation.php:111 +#: utilities/documentation.php:110 msgid "Plugins Name" msgstr "プラグイン名" -#: utilities/documentation.php:112 +#: utilities/documentation.php:111 msgid "Compatibility" msgstr "互換性" -#: utilities/documentation.php:113 +#: utilities/documentation.php:112 msgid "Reasons" msgstr "理由" -#: utilities/documentation.php:127 utilities/utility.php:239 +#: utilities/documentation.php:126 utilities/utility.php:239 #: utilities/utility.php:241 msgid "Needs Patch" msgstr "パッチが必要" -#: utilities/documentation.php:129 utilities/utility.php:245 +#: utilities/documentation.php:128 utilities/utility.php:245 msgid "Probably No" msgstr "たぶん不可" -#: utilities/documentation.php:131 utilities/utility.php:251 +#: utilities/documentation.php:130 utilities/utility.php:251 msgid "No" msgstr "不可" -#: utilities/documentation.php:141 +#: utilities/documentation.php:140 msgid "Caching Plugins" msgstr "キャッシュ用プラグイン" -#: utilities/documentation.php:143 +#: utilities/documentation.php:142 msgid "" "Some plugins that give you cache functinality might cause problems. It is " "because they try to create the db.php file in wp-content directory, which " @@ -456,7 +401,7 @@ msgstr "" "キャッシュの機能を提供するプラグインの中には問題になるものがあります。wp-contentディレクトリにdb.php" "ファイルを作ろうとするのですが、SQLite Integrationがすでにそれを使ってしまっているからです。" -#: utilities/documentation.php:146 +#: utilities/documentation.php:145 msgid "" "If those plugins overwrite the db.php file, SQLite Integration doesn't work. " "My recommendation is not to use caching plugins. " @@ -470,15 +415,15 @@ msgstr "" "wp-super-cache/\">WP Super Cacheのようなものなら試せるかもしれません。db.phpを使わない" "からです。でも、保証はありません。ご自分の責任でお試しください。" -#: utilities/documentation.php:149 +#: utilities/documentation.php:148 msgid "I have not tested none of those caching plugins." msgstr "私はこれらのキャッシュ・プラグインをテストしていません。" -#: utilities/documentation.php:151 +#: utilities/documentation.php:150 msgid "MySQL specific functions" msgstr "MySQL用の関数" -#: utilities/documentation.php:153 +#: utilities/documentation.php:152 msgid "" "Some plugins don't use WordPress database functions such as dbDelta(), and " "use PHP native MySQL functions when they create and manage tables in the " @@ -491,15 +436,15 @@ msgstr "" "の関数を再定義することを許しません(少なくとも通常のサーバ設定では)。だから、SQLite Integrationは" "それらをインターセプトして、書き換えることができません。" -#: utilities/documentation.php:156 +#: utilities/documentation.php:155 msgid "For example, you can see these codes in Google XML Sitemaps." msgstr "たとえば、Google XML Sitemapsにはこのようなコードがあります。" -#: utilities/documentation.php:162 +#: utilities/documentation.php:161 msgid "or in Camera Slideshow" msgstr "あるいは、Camera Slideshowには、こんな部分があります。" -#: utilities/documentation.php:168 +#: utilities/documentation.php:167 msgid "" "Such functions as mysql_get_server_info() or mysql_query() are from the " "MySQL driver of PHP. Not only some plugins but WordPress uses them, but " @@ -511,7 +456,7 @@ msgstr "" "でも、SQLite Integrationはこれらを書き換えたり、再定義したりすることができません。もし、あなたが" "使いたいプラグインがこれらの関数を使っていたら、うまく動かないか、エラー・メッセージが出るでしょう。" -#: utilities/documentation.php:171 +#: utilities/documentation.php:170 msgid "" "So, you have to rewrite them for SQLite Integration can execute. The two " "example above can be rewritten like this:" @@ -519,7 +464,7 @@ msgstr "" "だから、これらの関数は手動で書き換えなければ、SQLite Integrationで実行できません。上の2つの" "例は、次のように書き換えればうまくいきます。" -#: utilities/documentation.php:180 +#: utilities/documentation.php:179 msgid "" "As for those functions in WordPress, I overrode the WordPress functions " "themselves that contains such MySQL functions as mysql_query() or " @@ -528,11 +473,11 @@ msgstr "" "WordPressで使われているこれらの関数については、mysql_query()やmysql_real_escape_string()" "といった関数を含むWordPress関数をオーバーライドしています。" -#: utilities/documentation.php:182 +#: utilities/documentation.php:181 msgid "FULLTEXT index" msgstr "FULLTEXTインデックス" -#: utilities/documentation.php:184 +#: utilities/documentation.php:183 msgid "" "Some plugins use FULLTEXT index of MySQL. Of course SQLite does have the " "functionality named "full-text search". But it is not correlated " @@ -545,7 +490,7 @@ msgstr "" "インデックスではなく、新たなテーブルを作らなければならないものです。構文も異なります。だから、FULLTEXT" "インデックスを使うプラグインは使うことができません。" -#: utilities/documentation.php:187 +#: utilities/documentation.php:186 msgid "" "If your language is not written by separating words with spaces, e.g. " "Japanese, Chinese or Thai, neither FULLTEXT index nor full-text search work " @@ -563,82 +508,88 @@ msgstr "" "wordpress.org/extend/plugins/related-posts/\">Related Postsのうようなプラグインを" "使うことができます。これらは、SQLite Integrationでちゃんと動作します。" -#: utilities/patch.php:53 +#: utilities/patch.php:55 msgid "Patch command is not found" msgstr "パッチコマンドがありません" -#: utilities/patch.php:56 +#: utilities/patch.php:58 msgid "Patch command is not executable" msgstr "パッチコマンドが実行可能ではありません" -#: utilities/patch.php:73 +#: utilities/patch.php:75 msgid "Patch file name is invalid" msgstr "パッチファイルが不正です" -#: utilities/patch.php:77 +#: utilities/patch.php:79 msgid "Patch file version does not match with that of your plugin." msgstr "パッチファイルのバージョンがプラグインのものと一致しません。" -#: utilities/patch.php:86 +#: utilities/patch.php:88 msgid "Error! Plugin directory is not accessible." msgstr "エラーです。プラグインのディレクトリにアクセスできません。" -#: utilities/patch.php:89 +#: utilities/patch.php:91 msgid "is patched successfully." msgstr "パッチを適用しました。" -#: utilities/patch.php:94 utilities/patch.php:121 +#: utilities/patch.php:96 #, php-format msgid "Error! Messages: %s" -msgstr "エラー。メッセージは: %s" +msgstr "エラー! メッセージ: %s" -#: utilities/patch.php:118 -msgid "Error!: patches directory is not accessible." -msgstr "エラー。パッチディレクトリにアクセスできません。" - -#: utilities/patch.php:123 +#: utilities/patch.php:120 #, php-format msgid "File %s is deleted." msgstr "ファイル%sは削除されました。" -#: utilities/patch.php:138 +#: utilities/patch.php:122 +#, php-format +msgid "Error! File %s is not deleted." +msgstr "エラー! ファイル%sは削除されていません。" + +#: utilities/patch.php:126 +msgid "Error!: patches directory is not accessible." +msgstr "エラー! パッチ・ディレクトリにアクセスできません。" + +#: utilities/patch.php:142 msgid "File is uploaded" msgstr "ファイルをアップロードしました" -#: utilities/patch.php:142 -msgid "File is not uploaded" -msgstr "ファイルのアップロードができませんでした" - #: utilities/patch.php:146 +msgid "File is not uploaded" +msgstr "ファイルはアップロードされていません" + +#: utilities/patch.php:150 msgid "File is not selected" msgstr "ファイルが選択されていません" -#: utilities/patch.php:164 utilities/patch.php:166 utilities/patch.php:186 -#: utilities/patch.php:188 utilities/patch.php:208 utilities/patch.php:210 +#: utilities/patch.php:168 utilities/patch.php:170 +#: utilities/patch.php:190 utilities/patch.php:192 +#: utilities/patch.php:212 utilities/patch.php:214 msgid "You are not allowed to do this operation!" -msgstr "この操作をする権限がありません" +msgstr "この操作をする権限がありません!" -#: utilities/patch.php:170 utilities/patch.php:192 +#: utilities/patch.php:174 utilities/patch.php:196 msgid "Please select patch file(s)" msgstr "パッチファイルを選択してください" -#: utilities/patch.php:179 +#: utilities/patch.php:183 msgid "None of the patches is applied!" -msgstr "パッチは適用されませんでした。" +msgstr "パッチは適用されませんでした!" -#: utilities/patch.php:201 +#: utilities/patch.php:205 msgid "Error! Please remove files manually" -msgstr "エラー。ファイルを手動で削除してください。" +msgstr "エラー! ファイルを手動で削除してください" -#: utilities/patch.php:224 +#: utilities/patch.php:228 msgid "Patch Files Upload and Apply" msgstr "パッチファイルのアップロードと適用" -#: utilities/patch.php:225 +#: utilities/patch.php:229 msgid "What you can do in this page" msgstr "このページでできること" -#: utilities/patch.php:227 +#: utilities/patch.php:231 msgid "" "I made patch files for some plugins that are incompatible with SQLite " "Integration and need rewriting. And I wrote in the プラグイン・ページで適用の仕方を書きましたが、コマンドライン" "での操作が苦手な人もいます。初心者は特にそうでしょう。" -#: utilities/patch.php:230 +#: utilities/patch.php:234 msgid "" "In this page, you can upload patch files and apply them automatically. But " "there are some requirements." @@ -658,7 +609,7 @@ msgstr "" "このページでは、パッチファイルをアップロードして、自動的にそれを適用することができます。でも、いくつかの必要" "要件があります。" -#: utilities/patch.php:233 +#: utilities/patch.php:237 msgid "" "Think before you leap. Is the plugin to which you are going to apply patch " "really necessary for your site? Did you search in the Plugin Directory" "で代わりになるプラグインを探してみましたか?" -#: utilities/patch.php:234 +#: utilities/patch.php:238 msgid "" "Your PHP script has the permission to create a directory and write a file in " "it." msgstr "" "PHPスクリプトがディレクトリやファイルを作成する権限を持っていなければなりません。" -#: utilities/patch.php:235 +#: utilities/patch.php:239 msgid "Your PHP scripts can execute exec() function on the server." msgstr "PHPスクリプトがサーバ上で、exec()関数を実行できること。" -#: utilities/patch.php:236 +#: utilities/patch.php:240 msgid "" "Your PHP script can execute "patch" shell command.(Script will " "check if it is executable or not.)" @@ -687,17 +638,18 @@ msgstr "" "PHPスクリプトが"patch"シェルコマンドを実行できること(実行可能かどうかはスクリプトが" "チェックします)。" -#: utilities/patch.php:239 +#: utilities/patch.php:243 msgid "" "If uploading fails, it' very likely that application will fail. When you try " "uploading with FTP client, the patch files must be put into the directory wp-" -"content/uploads/patches/. When constant UPLOADS is defined, script follows it." +"content/uploads/patches/. When constant UPLOADS is defined, script follows " +"it." msgstr "" "ファイルのアップロードが失敗する場合は、パッチの適用も失敗する可能性があります。FTPクライアントでアップロード" "するときは、wp-content/uploads/patchesディレクトリに入るようにしてください。UPLOADS定数が定義されている" "場合はそれに従います。" -#: utilities/patch.php:242 +#: utilities/patch.php:246 msgid "" "You can create your patch file yourself. When you create one, please test it " "on your local server first and check if it works fine without PHP error or " @@ -708,23 +660,23 @@ msgstr "" "出ていないことを確認してください(error_reposting(E_ALL)をセットするとよい)。このページで使いたい" "場合は、次のように名前をつけてください。" -#: utilities/patch.php:245 +#: utilities/patch.php:249 msgid "Use the file name beginning with the plugin directory name." msgstr "プラグインのディレクトリ名で始まる名前にする。" -#: utilities/patch.php:246 +#: utilities/patch.php:250 msgid "Use the plugin version number after the directory name with underscore." msgstr "ディレクトリ名の後にアンダースコアとバージョン番号を使う。" -#: utilities/patch.php:247 +#: utilities/patch.php:251 msgid "Use the suffix .patch." msgstr ".patchを拡張子にする。" -#: utilities/patch.php:248 +#: utilities/patch.php:252 msgid "Use diff command options "-Naur"." msgstr "diffコマンドには"-Naur"オプションを使う。" -#: utilities/patch.php:251 +#: utilities/patch.php:255 msgid "" "For example, the patch file for the plugin "Debug Bar" is "" "debug-bar_0.8.patch". Script interprets "debug-bar" as the " @@ -737,47 +689,47 @@ msgstr "" "を対象のバージョンとして解釈します。バージョン番号が対象のものと一致しない場合は、スクリプトはエラー・メッセージ" "を出力して、実行を中断します。他のファイル名の場合は実行しません。" -#: utilities/patch.php:254 +#: utilities/patch.php:258 msgid "How to install, patch and activate plugins" msgstr "プラグインのインストール、パッチ、有効化のしかた" -#: utilities/patch.php:256 +#: utilities/patch.php:260 msgid "Install the plugin (not yet activate it)" msgstr "プラグインをインストールします(まだ有効化しないでください)" -#: utilities/patch.php:257 +#: utilities/patch.php:261 msgid "Upload the patch file (if any) to the server and ppply it in this page" msgstr "パッチファイルがあれば、アップロードし、適用します" -#: utilities/patch.php:258 +#: utilities/patch.php:262 msgid "Back to the installed plugin page and activate it" msgstr "インストール済みプラグインのページに戻り、有効化します" -#: utilities/patch.php:260 +#: utilities/patch.php:264 msgid "How to upgrade plugins" msgstr "プラグインのアップグレードのしかた" -#: utilities/patch.php:262 +#: utilities/patch.php:266 msgid "When upgrading the plugin, it will be safer to follow next steps." msgstr "プラグインをアップグレードするときは、安全のために次のステップに従ってください。" -#: utilities/patch.php:265 +#: utilities/patch.php:269 msgid "Deactivate the plugin" msgstr "プラグインを無効化します" -#: utilities/patch.php:266 +#: utilities/patch.php:270 msgid "Upgrade the plugin" msgstr "プラグインをアップグレードします" -#: utilities/patch.php:267 +#: utilities/patch.php:271 msgid "Upload the patch file (if any) and apply it" msgstr "パッチファイルがあればそれをアップロードして適用します" -#: utilities/patch.php:268 +#: utilities/patch.php:272 msgid "Reactivate the plugin" msgstr "再び有効化します" -#: utilities/patch.php:270 +#: utilities/patch.php:274 msgid "" "If there isn't a patch file to match with the newest version of the plugin, " "it won't work properly. Please wait for somebody to make one or rewrite the " @@ -789,78 +741,78 @@ msgstr "" "だれかがパッチを作るのを待つか、前バージョンのパッチを参考に自分で書き換えをしてください(それほど難しい" "作業ではありません。多くの場合、MySQLの関数をWordPressの関数に置き換えるだけです)。" -#: utilities/patch.php:271 +#: utilities/patch.php:275 msgid "Upload and Apply" msgstr "アップロードと適用" -#: utilities/patch.php:275 +#: utilities/patch.php:279 msgid "File Select" msgstr "ファイルを選択" -#: utilities/patch.php:282 +#: utilities/patch.php:286 msgid "" "Select file from your computer. If the file name is the same as existent " "file, this operation will override it." msgstr "" "あなたのコンピュータにあるファイルを選択します。ファイル名がすでに存在する場合は、それを上書きします。" -#: utilities/patch.php:284 +#: utilities/patch.php:288 msgid "Upload" msgstr "アップロード" -#: utilities/patch.php:289 +#: utilities/patch.php:293 msgid "Patch files uploaded" msgstr "アップロードしたパッチファイル" -#: utilities/patch.php:296 +#: utilities/patch.php:300 msgid "" "Select the file(s) you want to apply to the plugin(s) or you want to delete. " "You can select multiple files." msgstr "" "プラグインに適用したいパッチファイル、または削除したいパッチファイルを選択してください。複数選択できます。" -#: utilities/patch.php:300 +#: utilities/patch.php:304 msgid "Apply/Hold" msgstr "適用/保留" -#: utilities/patch.php:301 +#: utilities/patch.php:305 msgid "Patch files to apply" msgstr "適用するパッチ" -#: utilities/patch.php:317 +#: utilities/patch.php:321 msgid "Apply patch" msgstr "パッチを適用" -#: utilities/patch.php:317 +#: utilities/patch.php:321 msgid "" "Are you sure to apply patch files?\\n\\nClick [Cancel] to stop,[OK] to " "continue." msgstr "" "本当にパッチを適用してもよろしいですか?\\n\\nやめるなら[キャンセル]をクリック、続けるなら[OK]をクリック。" -#: utilities/patch.php:318 +#: utilities/patch.php:322 utilities/utility.php:765 msgid "Delete file" msgstr "ファイルを削除" -#: utilities/patch.php:318 +#: utilities/patch.php:322 msgid "" "Are you sure to delete patch files?\\n\\nClick [Cancel] to stop,[OK] to " "continue." msgstr "" "本当に削除してもよろしいですか?\\n\\nやめるなら[キャンセル]をクリック、続けるなら[OK]をクリック。" -#: utilities/patch.php:329 +#: utilities/patch.php:333 msgid "Caution about your patch file(s)" msgstr "パッチファイルについての注意" -#: utilities/patch.php:333 +#: utilities/patch.php:337 msgid "" "If you don't know where it comes from or who created it, I strongly " "recommend that you should see and check the contents of the file. If a " "person who created it secretly inserted a malicious codes, it will be " "executed by the plugin and may damage your site or your server, for which " -"damage I don't incur any liability. If you don't understand well, you'd better use " -"the substitute plugins. Take your own risk, please." +"damage I don't incur any liability. If you don't understand well, you'd " +"better use the substitute plugins. Take your own risk, please." msgstr "" "素性のあやしいパッチファイルがあったら、ファイルの内容を確認することを強くお勧めします。作成者がひそかに" "悪意のあるコードを仕込んでいると、プラグインがそれを実行してしまいます。あなたのサイトやサーバが被害を受ける" @@ -869,7 +821,7 @@ msgstr "" #: utilities/utility.php:248 msgid "Probably Yes" -msgstr "たぶん不可" +msgstr "たぶん可" #: utilities/utility.php:254 msgid "Checked" @@ -891,24 +843,41 @@ msgstr "有効" msgid "Inactive" msgstr "無効" -#: utilities/utility.php:336 +#: utilities/utility.php:368 +msgid " was created." +msgstr "が作成されました。" + +#: utilities/utility.php:370 +msgid " was not created." +msgstr "は作成できませんでした。" + +#: utilities/utility.php:391 +#, php-format +msgid "File %s was deleted." +msgstr "ファイル%sは削除されました。" + +#: utilities/utility.php:393 +msgid "Error! File was not deleted." +msgstr "エラー! ファイルは削除されていません。" + +#: utilities/utility.php:404 msgid "Welcome to SQLite Integration" msgstr "SQLite Integrationにようこそ" -#: utilities/utility.php:338 +#: utilities/utility.php:406 msgid "Thank you for using SQLite Integration plugin!" -msgstr "SQLite Integrationをお使いいただき、ありがとうぐざいます。" +msgstr "SQLite Integrationをお使いいただき、ありがとうございます。" -#: utilities/utility.php:341 +#: utilities/utility.php:409 msgid "" "You read this message, which means you have succeeded in installing " -"WordPress with this plugin SQLite Integration. Congratulations and enjoy your " -"Blogging!" +"WordPress with this plugin SQLite Integration. Congratulations and enjoy " +"your Blogging!" msgstr "" "このメッセージを読んでいるということは、インストールの成功したことを意味します。おめでとうございます。ブログをお楽しみ" "ください。" -#: utilities/utility.php:344 +#: utilities/utility.php:412 msgid "" "You don't have to set any special settings. In fact there are no other " "settings. You can write articles or pages and customize you WordPress in an " @@ -920,129 +889,129 @@ msgstr "" "WordPressをカスタマイズしたりできます。プラグインをインストールしたいですか? そうしましょう。でも、中には" "使えないものもあります。プラグインやSQLiteデータベースについての情報をお読みください。" -#: utilities/utility.php:346 +#: utilities/utility.php:414 msgid "" "Deactivation makes this documents and utilities disappear from the " -"dashboard, but it doesn't affect the functionality of the SQLite Integration. " -"when uninstalled, it will remove wp-content/uploads/patches directory (if " -"exists) and wp-content/db.php file altogether." +"dashboard, but it doesn't affect the functionality of the SQLite " +"Integration. when uninstalled, it will remove wp-content/uploads/patches " +"directory (if exists) and wp-content/db.php file altogether." msgstr "" "無効化すると、ダッシュボードからこのドキュメントとユーティリティを消すことができます。でも、SQLite Integration" "の機能には影響ありません。削除のときは、もしあれば、wp-content/uploads/patchesディレクトリと、" "wp-content/db.phpファイルを削除します。" -#: utilities/utility.php:349 +#: utilities/utility.php:417 msgid "Title" msgstr "タイトル" -#: utilities/utility.php:350 +#: utilities/utility.php:418 msgid "Contents" msgstr "コンテンツ" -#: utilities/utility.php:355 +#: utilities/utility.php:423 msgid "You can read documentation about this plugin and plugin compatibility." msgstr "このプラグインについてのドキュメントとプラグインの互換性について読むことができます。" -#: utilities/utility.php:359 +#: utilities/utility.php:427 msgid "You can see database and system information." msgstr "データベースとシステムの情報を見ることができます。" -#: utilities/utility.php:363 +#: utilities/utility.php:431 msgid "" "You can see the error log and edit db.php file (if necessary) and optimize " "your database." msgstr "" "エラー・ログを見たり、必要なら、db.phpを編集したり、データベースの最適化をしたりできます。" -#: utilities/utility.php:367 +#: utilities/utility.php:435 msgid "You can upload patch files and apply them to the incompatible plugins." msgstr "パッチファイルをアップロードし、プラグインに適用できます。" -#: utilities/utility.php:396 +#: utilities/utility.php:464 msgid "System Information" msgstr "システム情報" -#: utilities/utility.php:397 +#: utilities/utility.php:465 msgid "PHP Informations" msgstr "PHP情報" -#: utilities/utility.php:402 utilities/utility.php:438 +#: utilities/utility.php:470 utilities/utility.php:506 msgid "Items" msgstr "項目" -#: utilities/utility.php:403 +#: utilities/utility.php:471 msgid "Description" msgstr "説明" -#: utilities/utility.php:408 +#: utilities/utility.php:476 msgid "WordPress Version" -msgstr "WordPressのバージョン" +msgstr "WordPressバージョン" -#: utilities/utility.php:412 +#: utilities/utility.php:480 msgid "PHP Version" -msgstr "PHPのバージョン" +msgstr "PHPバージョン" -#: utilities/utility.php:416 +#: utilities/utility.php:484 msgid "PDO Support" msgstr "PDOサポート" -#: utilities/utility.php:420 +#: utilities/utility.php:488 msgid "PDO Drivers" msgstr "PDOドライバ" -#: utilities/utility.php:424 +#: utilities/utility.php:492 msgid "PDO Driver for SQLite 3.x" msgstr "SQLite 3.x用PDOドライバ" -#: utilities/utility.php:428 +#: utilities/utility.php:496 msgid "SQLite Library Version" msgstr "SQLiteライブラリのバージョン" -#: utilities/utility.php:434 +#: utilities/utility.php:502 msgid "Your Database Status" msgstr "データベースの状態" -#: utilities/utility.php:439 +#: utilities/utility.php:507 msgid "Status" msgstr "状態" -#: utilities/utility.php:445 +#: utilities/utility.php:513 msgid "Database Size" -msgstr "データベースのサイズ" +msgstr "データベース・サイズ" -#: utilities/utility.php:449 +#: utilities/utility.php:517 msgid "Page Size" -msgstr "ページサイズ" +msgstr "ページ・サイズ" -#: utilities/utility.php:453 +#: utilities/utility.php:521 msgid "Total Number of Pages" msgstr "合計のページ数" -#: utilities/utility.php:457 +#: utilities/utility.php:525 msgid "Unused Page" msgstr "未使用ページ" -#: utilities/utility.php:461 +#: utilities/utility.php:529 msgid "Integrity Check" msgstr "整合性チェック" -#: utilities/utility.php:465 +#: utilities/utility.php:533 msgid "Encoding" msgstr "エンコーディング" -#: utilities/utility.php:469 +#: utilities/utility.php:537 msgid "Collations" msgstr "照合順序" -#: utilities/utility.php:481 +#: utilities/utility.php:549 msgid "Compile Options" -msgstr "コンパイルオプション" +msgstr "コンパイル・オプション" -#: utilities/utility.php:495 +#: utilities/utility.php:563 msgid "Database Tables and Indexes" msgstr "データベースのテーブルとインデックス" -#: utilities/utility.php:497 +#: utilities/utility.php:565 msgid "" "Table names in brown are required by WordPress, and those in blue are " "created by some plugins. The table sqlite_sequence is not a WordPress table " @@ -1056,74 +1025,86 @@ msgstr "" "格納されています。この値は、テーブル名の隣に括弧つきで表示されます。テーブルやインデックスをここで操作" "することはできません。SQLiteManagerのようなユーティリティをお使いください。" -#: utilities/utility.php:502 +#: utilities/utility.php:570 msgid "Table Name" msgstr "テーブル名" -#: utilities/utility.php:503 +#: utilities/utility.php:571 msgid "System/User" msgstr "システム/ユーザ" -#: utilities/utility.php:504 +#: utilities/utility.php:572 msgid "Index ( Column )" -msgstr "インデックス ( カラム名 )" +msgstr "インデックス(カラム名)" -#: utilities/utility.php:529 +#: utilities/utility.php:610 msgid "Plugin Info" msgstr "プラグイン情報" -#: utilities/utility.php:531 +#: utilities/utility.php:612 msgid "This table shows plugins you have installed and their compatibility." msgstr "この表は、インストール済みのプラグインについて、互換性を表示します。" -#: utilities/utility.php:536 +#: utilities/utility.php:617 msgid "Installed Plugins" msgstr "インストール済み" -#: utilities/utility.php:537 +#: utilities/utility.php:618 msgid "Active/Inactive" msgstr "有効/無効" -#: utilities/utility.php:538 +#: utilities/utility.php:619 msgid "Compatible" msgstr "互換性" -#: utilities/utility.php:562 +#: utilities/utility.php:643 msgid "Log cleared" msgstr "ログをクリアしました" -#: utilities/utility.php:565 +#: utilities/utility.php:646 msgid "Log not cleared" msgstr "ログがクリアされませんでした" -#: utilities/utility.php:577 +#: utilities/utility.php:658 msgid "db.php was saved" msgstr "db.phpを保存しました" -#: utilities/utility.php:580 +#: utilities/utility.php:661 msgid "Error! db.php couldn't be saved" msgstr "エラー。db.phpを保存できませんでした" -#: utilities/utility.php:591 +#: utilities/utility.php:672 #, php-format msgid "" "Optimization finished. Before optimization: %1$s, After optimization: %2$s." msgstr "" "最適化が終了しました。最適化前のサイズ: %1$s、最適化後のサイズ: %2$s。" -#: utilities/utility.php:594 +#: utilities/utility.php:675 msgid "Optimization failed" msgstr "最適化に失敗しました" -#: utilities/utility.php:608 -msgid "Database Optimization, Error Log, Init File" +#: utilities/utility.php:683 +msgid "Couldn't find your database file." msgstr "データベースの最適化、エラーログ、初期化ファイル" -#: utilities/utility.php:609 +#: utilities/utility.php:695 +msgid "Please select backup file(s)." +msgstr "データベースを最適化する" + +#: utilities/utility.php:704 +msgid "Error! Please remove file(s) manyally." +msgstr "エラー! 手動でファイルを削除してください。" + +#: utilities/utility.php:718 +msgid "Database Optimization, Error Log, Init File" +msgstr "データベース最適化、エラー・ログ、初期化ファイル" + +#: utilities/utility.php:719 msgid "Optimize You Database" msgstr "データベースを最適化する" -#: utilities/utility.php:611 +#: utilities/utility.php:721 msgid "" "This button sends "vacuum" command to your SQLite database. That " "command reclaims space after data has been deleted." @@ -1131,49 +1112,99 @@ msgstr "" "このボタンは"vaccum"コマンドをSQLiteデータベースに発行します。このコマンドは、" "データの削除後に空いたスペースを回収します。" -#: utilities/utility.php:619 +#: utilities/utility.php:729 msgid "Optimize" msgstr "最適化" -#: utilities/utility.php:619 +#: utilities/utility.php:729 msgid "" "Are you sure to optimize your database?\\n\\nClick [Cancel] to stop, [OK] to " "continue." msgstr "" "本当にデータベースを最適化しますか?\\n\\nやめるときは[キャンセル]を、続けるなら[OK]をクリック。" -#: utilities/utility.php:622 +#: utilities/utility.php:732 +msgid "Create or Delete backup file(s)" +msgstr "データベースのバックアップを作る・削除する" + +#: utilities/utility.php:734 +msgid "" +"Click the backup button below if you want to create a current snapshot of " +"your database file. The backup file is named ‘DB_FILE_NAME.yyyymmdd." +"zip’ if PHP zip extension is loaded or ‘DB_FILE_NAME.yyyymmdd." +"back’ if not loaded, and is put in the same directory that the database " +"is in." +msgstr "" +"現在のデータベースのコピーを作りたいときには、下のバックアップボタンをクリックしてください。バックアップファイルは、" +"PHPのzipエクステンションがロードされている場合は、‘データベース名.yyyymmdd.zip’という名前で、" +"ロードされていない場合は、‘データベース名.yyyymmdd.back’という名前で、データベースと同じディレクトリ" +"につくられます。" + +#: utilities/utility.php:737 +msgid "" +"If you want to delete the file(s), check the file name and click the Delete " +"button. You can check multiple files." +msgstr "" +"バックアップファイルを削除したい場合は、ファイルをチェックして削除ボタンをクリックしてください。複数ファイルを選択できます。" + +#: utilities/utility.php:748 +msgid "Delete" +msgstr "削除" + +#: utilities/utility.php:749 +msgid "Backup Files" +msgstr "バックアップファイル" + +#: utilities/utility.php:764 +msgid "Backup" +msgstr "バックアップ" + +#: utilities/utility.php:764 +msgid "" +"Are you sure to make a backup file?\\n\\nClick [Cancel] to stop, [OK] to " +"continue." +msgstr "" +"バックアップファイルを作ります。\\n\\n中止する場合は[Cancel]を、続ける場合は[OK]をクリックしてください。" + +#: utilities/utility.php:765 +msgid "" +"Are you sure to delete backup file(s)?\\n\\nClick [Cancel] to stop, [OK] to " +"continue." +msgstr "" +"バックアップファイルを削除します。\\n\\n中止する場合は[Cancel]を、続ける場合は[OK]をクリックしてください。" + +#: utilities/utility.php:768 msgid "SQLite Integration Error Log" msgstr "SQLite Integrationのエラーログ" -#: utilities/utility.php:624 +#: utilities/utility.php:770 msgid "" -"This is the contents of SQLite Integration error log file(default: wp-content/" -"database/debug.txt). If you want to clear this file, click the Clear Log " -"button." +"This is the contents of SQLite Integration error log file(default: wp-" +"content/database/debug.txt). If you want to clear this file, click the Clear " +"Log button." msgstr "" "SQLite Integrationが使うエラーログ・ファイルの内容です(デフォルトでは、wp-content/database/debug.txt)。" "このファイルの内容をクリアするには、ログをクリアのボタンをクリックしてください。" -#: utilities/utility.php:634 +#: utilities/utility.php:780 msgid "No error messages are found" msgstr "エラーメッセージはありません" -#: utilities/utility.php:642 +#: utilities/utility.php:788 msgid "Clear Log" msgstr "ログをクリア" -#: utilities/utility.php:642 +#: utilities/utility.php:788 msgid "" "Are you sure to clear Log?\\n\\nClick [Cancel] to stop, [OK] to continue." msgstr "" "本当にログをクリアしてもいいですか?\\n\\nやめるなら[キャンセル]を。続けるなら[OK]をクリック。" -#: utilities/utility.php:646 +#: utilities/utility.php:792 msgid "Edit Initial File (wp-content/db.php)" msgstr "初期化ファイル(wp-content/db.php)を編集" -#: utilities/utility.php:648 +#: utilities/utility.php:794 msgid "" "When you go "Plugins » Edit Plugin" page, you can edit " "plugin source file. But you can't see this file there because it is not in " @@ -1186,13 +1217,165 @@ msgstr "" "することができます。この設定は問題を起こすことがあります。よくわからない場合は" "このファイルを変更しないでください。" -#: utilities/utility.php:658 +#: utilities/utility.php:804 msgid "Save" msgstr "保存" -#: utilities/utility.php:658 +#: utilities/utility.php:804 msgid "" "Are you sure to save this file?\\n\\nClick [Cancel] to stop, [OK] to " "continue." msgstr "" "この内容を保存してもよろしいですか?\\n\\nやめるなら[キャンセル]を、続けるなら[OK]をクリック。" + +#: database_maintenance.php:314 +msgid "Can't create backup file." +msgstr "バックアップファイルを作れません。" + +#: database_maintenance.php:334 +msgid "Failed: " +msgstr "失敗: " + +#: database_maintenance.php:395 +msgid "Maintenance" +msgstr "メンテナンス" + +#: database_maintenance.php:399 +msgid "Database Maintenace" +msgstr "データベース・メンテナンス" + +#: database_maintenance.php:400 +msgid "Important Notice" +msgstr "重要なお知らせ" + +#: database_maintenance.php:402 +msgid "" +"When you installed WordPress 3.5.x with SQLite Integration and upgraded to " +"3.6, your database might not function as expected." +msgstr "" +"WordPress 3.5.x を SQLite Integrationを使ってインストールし、3.6 にアップグレードした場合、" +"データベースが意図したとおりに動作しないかもしれません。" + +#: database_maintenance.php:403 +msgid "" +"This page provide you the database sanity check utility and the restore " +"utility." +msgstr "" +"このページでは、データベースが正常かどうかをチェックするユーティリティと、回復ユーティリティを提供します。" + +#: database_maintenance.php:406 +msgid "" +"Click \"Sanity Check\" button first, and see if you need to fix database or " +"not. If needed, click \"Fix Database\" button. Afterward you may go to " +"Miscellaneous page and optimize database (this is not required)." +msgstr "" +"「正常チェック」ボタンを最初にクリックして、データベースが修復を必要とするかどうかを見てください。必要なら、" +"「修復」ボタンをクリックしてください。「いろいろ」ページに移動して、最適化をすることもできます(必須ではありません)。" + +#: database_maintenance.php:409 +msgid "" +"Fix Database procedure will create a database backup file each time the " +"button clicked. The backup file is named with \"maintenance-backup\", so you " +"can remove it if you don't need it. Please go to Miscellaneous page and " +"check if there is one." +msgstr "" +"データベースの修復は、ボタンがクリックされるたびにバックアップファイルを作成します。ファイル名には、" +"\"maintenance-backup\"とついていますので、必要なければ削除してかまいません。" +"「いろいろ」ページに移動して、バックアップファイルが作成されているかどうかご覧ください。" + +#: database_maintenance.php:412 +msgid "" +"If you installed WordPress 3.6 (not upgraded), you don't have to restore the " +"database." +msgstr "" +"アップグレードではなくて、WordPress 3.6 を最初からインストールした場合は、データベースの修復は" +"必要ありません。" + +#: database_maintenance.php:421 +msgid "Sanity Check" +msgstr "正常チェック" + +#: database_maintenance.php:421 +msgid "" +"Are you sure to check the database? This will take some time.\\n\\nClick " +"[Cancel] to stop, [OK] to continue." +msgstr "" +"データベースのチェックをします。この操作は少し時間がかかるかもしれません。\\n\\nやめるなら[キャンセル]を、" +"続けるなら[OK]をクリックしてください。" + +#: database_maintenance.php:422 +msgid "Fix database" +msgstr "修復" + +#: database_maintenance.php:422 +msgid "" +"Are you sure to do fix the database? This will take some time.\\n\\nClick " +"[Cancel] to stop, [OK] to continue." +msgstr "" +"データベースの修復をします。この操作は少し時間がかかるかもしれません。\\n\\nやめるなら[キャンセル]を、" +"続けるなら[OK]をクリックしてください。" + +#: database_maintenance.php:436 database_maintenance.php:446 +msgid "Results" +msgstr "結果" + +#: database_maintenance.php:447 +msgid "Your database restoration is successfully finished!" +msgstr "データベースの修復が成功しました。" + +#: database_maintenance.php:463 database_maintenance.php:474 +msgid "Checked Results" +msgstr "チェックの結果" + +#: database_maintenance.php:468 +msgid " needs restoring." +msgstr "修復が必要です。" + +#: database_maintenance.php:475 +msgid "Your database is OK. You don't have to restore it." +msgstr "あなたのデータベースは正常です。修復の必要はありません。" + +msgid "You can check your database and fix it if needed." +msgstr "データベースのチェックと修復をすることができます。" + +msgid "Table name is not selected." +msgstr "テーブル名が選択されていません。" + +msgid "There's no such table." +msgstr "テーブルが存在しません。" + +msgid "Columns Information" +msgstr "カラム情報" + +msgid "" +"Select a table name and click \"Display Columns\" button, and you'll see " +"the column property of that table. This information is for debug use." +msgstr "" +"テーブル名を選択して「カラムを表示」ボタンをクリックしてください。そのテーブルのカラム属性を表示します。" +"この情報はデバッグのために利用されます。" + +msgid "" +"Display columns in the selected table.\\n\\nClick [Cancel] to stop, [OK] to continue." +msgstr "" +"選択したテーブルのカラムを表示します。\\n\\nやめるなら、[キャンセル]を、続けるんら、[OK]をクリックしてください。" + +msgid "Columns In %s" +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/languages/sqlite-integration.pot b/languages/sqlite-integration.pot index c736014..5e229dd 100644 --- a/languages/sqlite-integration.pot +++ b/languages/sqlite-integration.pot @@ -8,197 +8,150 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-05-21 13:11+0900\n" +"POT-Creation-Date: 2013-09-03 14:31+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: db.php:46 -msgid "PHP version on this server is too old." -msgstr "" - -#: db.php:46 -#, php-format -msgid "" -"Your server is running PHP version %d but this version of WordPress requires " -"at least 5.2.4" -msgstr "" - -#: db.php:50 -msgid "PHP PDO Extension is not loaded." -msgstr "" - -#: db.php:50 -msgid "" -"Your PHP installation appears to be missing the PDO extension which is " -"required for this version of WordPress." -msgstr "" - -#: db.php:54 -msgid "PDO Driver for SQLite is missing." -msgstr "" - -#: db.php:54 -msgid "" -"Your PHP installtion appears not to have the right PDO drivers loaded. These " -"are required for this version of WordPress and the type of database you have " -"specified." -msgstr "" - -#: install.php:42 +#: trunk/install.php:40 msgid "" "Note that password carefully! It is a random password that was generated just for you." msgstr "" -#: install.php:47 +#: trunk/install.php:45 msgid "Your chosen password." msgstr "" -#: install.php:58 +#: trunk/install.php:56 msgid "The password you chose during the install." msgstr "" -#: pdodb.class.php:96 +#: trunk/pdodb.class.php:96 #, php-format msgid "WordPress database error %1$s for query %2$s made by %3$s" msgstr "" -#: pdodb.class.php:98 +#: trunk/pdodb.class.php:98 #, php-format msgid "WordPress database error %1$s for query %2$s" msgstr "" -#: pdodb.class.php:134 +#: trunk/pdodb.class.php:136 #, php-format msgid "" "

Error establlishing a database connection

We have been unable to " "connect to the specified database.
The error message received was %s" msgstr "" -#: pdoengine.class.php:80 pdoengine.class.php:96 schema.php:26 +#: trunk/pdoengine.class.php:82 trunk/pdoengine.class.php:98 msgid "Database connection error!
" msgstr "" -#: pdoengine.class.php:81 pdoengine.class.php:97 schema.php:27 schema.php:81 +#: trunk/pdoengine.class.php:83 trunk/pdoengine.class.php:99 +#, php-format msgid "Error message is: %s" msgstr "" -#: pdoengine.class.php:115 -msgid "" -"Unable to create the required directory! Please check your server settings." -msgstr "" - -#: pdoengine.class.php:120 pdoengine.class.php:126 -msgid "" -"Unable to create a file in the directory! Please check your server settings." -msgstr "" - -#: pdoengine.class.php:148 +#: trunk/pdoengine.class.php:156 #, php-format msgid "" "

Unknown query type

Sorry, we cannot determine the type of query " "that is requested.

The query is %s

" msgstr "" -#: pdoengine.class.php:294 +#: trunk/pdoengine.class.php:315 #, php-format msgid "Problem preparing the PDO SQL Statement. Error was: %s" msgstr "" -#: pdoengine.class.php:327 +#: trunk/pdoengine.class.php:372 #, php-format msgid "Error while executing query! Error message was: %s" msgstr "" -#: pdoengine.class.php:381 +#: trunk/pdoengine.class.php:426 msgid "The query is too big to parse properly" msgstr "" -#: pdoengine.class.php:583 +#: trunk/pdoengine.class.php:635 #, php-format msgid "Problem in creating table or index. Error was: %s" msgstr "" -#: pdoengine.class.php:626 +#: trunk/pdoengine.class.php:678 #, php-format msgid "Problem in executing alter query. Error was: %s" msgstr "" -#: schema.php:80 -#, php-format -msgid "" -"Error occured while creating tables or indexes...
Query was: %s
" +#: trunk/sqlite-integration.php:158 trunk/sqlite-integration.php:181 +msgid "SQLite Integration" msgstr "" -#: sqlite-integration.php:158 sqlite-integration.php:181 -msgid "SQLite DB" -msgstr "" - -#: utilities/documentation.php:17 utilities/documentation.php:19 -#: utilities/patch.php:157 utilities/patch.php:159 utilities/utility.php:382 -#: utilities/utility.php:384 utilities/utility.php:555 -#: utilities/utility.php:557 +#: trunk/utilities/documentation.php:16 trunk/utilities/documentation.php:18 +#: trunk/utilities/patch.php:161 trunk/utilities/patch.php:163 +#: trunk/utilities/utility.php:450 trunk/utilities/utility.php:452 +#: trunk/utilities/utility.php:636 trunk/utilities/utility.php:638 msgid "You are not allowed to access this page!" msgstr "" -#: utilities/documentation.php:24 utilities/documentation.php:31 -#: utilities/patch.php:217 utilities/utility.php:354 utilities/utility.php:389 -#: utilities/utility.php:601 +#: trunk/utilities/documentation.php:23 trunk/utilities/documentation.php:30 +#: trunk/utilities/patch.php:221 trunk/utilities/utility.php:422 +#: trunk/utilities/utility.php:457 trunk/utilities/utility.php:711 msgid "Documentation" msgstr "" -#: utilities/documentation.php:25 utilities/patch.php:218 -#: utilities/utility.php:358 utilities/utility.php:390 -#: utilities/utility.php:602 +#: trunk/utilities/documentation.php:24 trunk/utilities/patch.php:222 +#: trunk/utilities/utility.php:426 trunk/utilities/utility.php:458 +#: trunk/utilities/utility.php:712 msgid "System Info" msgstr "" -#: utilities/documentation.php:26 utilities/patch.php:219 -#: utilities/utility.php:362 utilities/utility.php:391 -#: utilities/utility.php:603 +#: trunk/utilities/documentation.php:25 trunk/utilities/patch.php:223 +#: trunk/utilities/utility.php:430 trunk/utilities/utility.php:459 +#: trunk/utilities/utility.php:713 msgid "Miscellaneous" msgstr "" -#: utilities/documentation.php:27 utilities/patch.php:220 -#: utilities/utility.php:366 utilities/utility.php:392 -#: utilities/utility.php:604 +#: trunk/utilities/documentation.php:26 trunk/utilities/patch.php:224 +#: trunk/utilities/utility.php:434 trunk/utilities/utility.php:460 +#: trunk/utilities/utility.php:714 msgid "Patch Utility" msgstr "" -#: utilities/documentation.php:33 +#: trunk/utilities/documentation.php:32 msgid "" "This is a brief documentation about this plugin. For more details, see also " "the Plugin " "Page." msgstr "" -#: utilities/documentation.php:36 +#: trunk/utilities/documentation.php:35 msgid "" "Please don't forget: WordPress DOES NOT OFFICIALLY SUPPORT any database " -"other than MySQL. So if you ask about this plugin in the Codex, it's not " +"other than MySQL. So if you ask about this plugin in the Forum, it's not " "unlikely that you won't get no answers at all." msgstr "" -#: utilities/documentation.php:39 +#: trunk/utilities/documentation.php:38 msgid "Features" msgstr "" -#: utilities/documentation.php:41 +#: trunk/utilities/documentation.php:40 msgid "" "This plugin is a successor to 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.5.1 and 3.6 beta)." +"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)." msgstr "" -#: utilities/documentation.php:44 +#: trunk/utilities/documentation.php:43 msgid "" "SQLite Web Page says — SQLite " "is a "software library that implements selfcontained, serverless, zero-" @@ -207,7 +160,7 @@ msgid "" "you don't need any database server system." msgstr "" -#: utilities/documentation.php:47 +#: trunk/utilities/documentation.php:46 msgid "" "Unfortunately enough, WordPress only supports MySQL. Consequently it doesn't " "provide any APIs for SQLite. So if you want to create a website using " @@ -215,71 +168,71 @@ msgid "" "program yourself to use SQLite. This is the way SQLite Integration goes." msgstr "" -#: utilities/documentation.php:50 +#: trunk/utilities/documentation.php:49 msgid "SQLite Integration does the work as follows:" msgstr "" -#: utilities/documentation.php:53 +#: trunk/utilities/documentation.php:52 msgid "Intercepts SQL statement for MySQL from WordPress" msgstr "" -#: utilities/documentation.php:54 +#: trunk/utilities/documentation.php:53 msgid "Rewrites it as SQLite can execute" msgstr "" -#: utilities/documentation.php:55 +#: trunk/utilities/documentation.php:54 msgid "Gives it to SQLite" msgstr "" -#: utilities/documentation.php:56 +#: trunk/utilities/documentation.php:55 msgid "Gets the results from SQLite" msgstr "" -#: utilities/documentation.php:57 +#: trunk/utilities/documentation.php:56 msgid "Format the results as MySQL returns, if necessary" msgstr "" -#: utilities/documentation.php:58 +#: trunk/utilities/documentation.php:57 msgid "Gives back the results to WordPress" msgstr "" -#: utilities/documentation.php:61 +#: trunk/utilities/documentation.php:60 msgid "" "WordPress doesn't know what has happened in the background and will be happy " "with it." msgstr "" -#: utilities/documentation.php:64 +#: trunk/utilities/documentation.php:63 msgid "Limitations" msgstr "" -#: utilities/documentation.php:66 +#: trunk/utilities/documentation.php:65 msgid "" "SQLite Integration uses SQLite, so the limitations of SQLite is, as it is, " "those of SQLite Integration. MySQL is far from a simple SQL engine and has " "many extended features and functionalities. WordPress uses some of them. " "Among those are some SQLite doesn't implement. For those features that " -"WordPress uses, I made them work with SQLite Integration. But for others that " -"some plugins are using, SQLite Integration can't manipulate. So..." +"WordPress uses, I made them work with SQLite Integration. But for others " +"that some plugins are using, SQLite Integration can't manipulate. So..." msgstr "" -#: utilities/documentation.php:69 +#: trunk/utilities/documentation.php:68 msgid "There are some plugins that you can't use in any way.
" msgstr "" -#: utilities/documentation.php:70 +#: trunk/utilities/documentation.php:69 msgid "" "Some plugins can't be activated or work properly. See the "Plugin " "Compatibility/Incompatibility" section." msgstr "" -#: utilities/documentation.php:71 +#: trunk/utilities/documentation.php:70 msgid "" "There are some plugins that you can't use without rewriting some codes in " "them.
" msgstr "" -#: utilities/documentation.php:72 +#: trunk/utilities/documentation.php:71 #, php-format msgid "" "Some plugins do work fine if you rewrite MySQL functions. I made some patch " @@ -288,18 +241,18 @@ msgid "" "more details." msgstr "" -#: utilities/documentation.php:75 +#: trunk/utilities/documentation.php:74 msgid "" "And there may be other problems I overlooked. If you find malfunctionality, " "please let me know at the Support Forum." msgstr "" -#: utilities/documentation.php:77 +#: trunk/utilities/documentation.php:76 msgid "User Defined Functions" msgstr "" -#: utilities/documentation.php:79 +#: trunk/utilities/documentation.php:78 msgid "" "SQLite Integration replaces some functions of MySQL with the user defined " "functions built in PHP PDO library. But some of the functions are " @@ -308,49 +261,49 @@ msgid "" "error." msgstr "" -#: utilities/documentation.php:82 +#: trunk/utilities/documentation.php:81 msgid "" "If you want SQLite Integration to execute more functions, you can add the " -"definition in the file sqlite-integration/functions.php (functions-5-2.php is " -"for PHP 5.2 or lesser)." +"definition in the file sqlite-integration/functions.php (functions-5-2.php " +"is for PHP 5.2 or lesser)." msgstr "" -#: utilities/documentation.php:85 +#: trunk/utilities/documentation.php:84 msgid "Database Administration and Maintenance" msgstr "" -#: utilities/documentation.php:87 +#: trunk/utilities/documentation.php:86 msgid "" -"SQLite Integration doesn't contain database maintenace functionality, because " -"there are some other free or proprietary softwares that give you such " -"functionalities. For example, these are among free softwares:" +"SQLite Integration doesn't contain database maintenace functionality, " +"because there are some other free or proprietary softwares that give you " +"such functionalities. For example, these are among free softwares:" msgstr "" -#: utilities/documentation.php:90 +#: trunk/utilities/documentation.php:89 msgid "my recommendation" msgstr "" -#: utilities/documentation.php:91 +#: trunk/utilities/documentation.php:90 msgid "unfortunately seems not to maintained..." msgstr "" -#: utilities/documentation.php:94 +#: trunk/utilities/documentation.php:93 msgid "" "I'm not sure if future release may have some of the database maintenance " "functionality." msgstr "" -#: utilities/documentation.php:100 +#: trunk/utilities/documentation.php:99 msgid "Plugin Compatibility/Incompatibility" msgstr "" -#: utilities/documentation.php:102 +#: trunk/utilities/documentation.php:101 msgid "" "WordPress without its plugins is a king without people. Of course, you need " "plugins, I know." msgstr "" -#: utilities/documentation.php:105 +#: trunk/utilities/documentation.php:104 #, php-format msgid "" "Most of the plugins will work fine with this plugin. But there are some that " @@ -362,43 +315,43 @@ msgid "" "\">Plugin Page." msgstr "" -#: utilities/documentation.php:111 +#: trunk/utilities/documentation.php:110 msgid "Plugins Name" msgstr "" -#: utilities/documentation.php:112 +#: trunk/utilities/documentation.php:111 msgid "Compatibility" msgstr "" -#: utilities/documentation.php:113 +#: trunk/utilities/documentation.php:112 msgid "Reasons" msgstr "" -#: utilities/documentation.php:127 utilities/utility.php:239 -#: utilities/utility.php:241 +#: trunk/utilities/documentation.php:126 trunk/utilities/utility.php:239 +#: trunk/utilities/utility.php:241 msgid "Needs Patch" msgstr "" -#: utilities/documentation.php:129 utilities/utility.php:245 +#: trunk/utilities/documentation.php:128 trunk/utilities/utility.php:245 msgid "Probably No" msgstr "" -#: utilities/documentation.php:131 utilities/utility.php:251 +#: trunk/utilities/documentation.php:130 trunk/utilities/utility.php:251 msgid "No" msgstr "" -#: utilities/documentation.php:141 +#: trunk/utilities/documentation.php:140 msgid "Caching Plugins" msgstr "" -#: utilities/documentation.php:143 +#: trunk/utilities/documentation.php:142 msgid "" "Some plugins that give you cache functinality might cause problems. It is " "because they try to create the db.php file in wp-content directory, which " "file SQLite Integration is using." msgstr "" -#: utilities/documentation.php:146 +#: trunk/utilities/documentation.php:145 msgid "" "If those plugins overwrite the db.php file, SQLite Integration doesn't work. " "My recommendation is not to use caching plugins. " @@ -407,15 +360,15 @@ msgid "" "doesn't use db.php file. But no warranty, try at your own risk." msgstr "" -#: utilities/documentation.php:149 +#: trunk/utilities/documentation.php:148 msgid "I have not tested none of those caching plugins." msgstr "" -#: utilities/documentation.php:151 +#: trunk/utilities/documentation.php:150 msgid "MySQL specific functions" msgstr "" -#: utilities/documentation.php:153 +#: trunk/utilities/documentation.php:152 msgid "" "Some plugins don't use WordPress database functions such as dbDelta(), and " "use PHP native MySQL functions when they create and manage tables in the " @@ -424,15 +377,15 @@ msgid "" "and rewrite those functions." msgstr "" -#: utilities/documentation.php:156 +#: trunk/utilities/documentation.php:155 msgid "For example, you can see these codes in Google XML Sitemaps." msgstr "" -#: utilities/documentation.php:162 +#: trunk/utilities/documentation.php:161 msgid "or in Camera Slideshow" msgstr "" -#: utilities/documentation.php:168 +#: trunk/utilities/documentation.php:167 msgid "" "Such functions as mysql_get_server_info() or mysql_query() are from the " "MySQL driver of PHP. Not only some plugins but WordPress uses them, but " @@ -441,24 +394,24 @@ msgid "" "messages." msgstr "" -#: utilities/documentation.php:171 +#: trunk/utilities/documentation.php:170 msgid "" "So, you have to rewrite them for SQLite Integration can execute. The two " "example above can be rewritten like this:" msgstr "" -#: utilities/documentation.php:180 +#: trunk/utilities/documentation.php:179 msgid "" "As for those functions in WordPress, I overrode the WordPress functions " "themselves that contains such MySQL functions as mysql_query() or " "mysql_real_escape_string()." msgstr "" -#: utilities/documentation.php:182 +#: trunk/utilities/documentation.php:181 msgid "FULLTEXT index" msgstr "" -#: utilities/documentation.php:184 +#: trunk/utilities/documentation.php:183 msgid "" "Some plugins use FULLTEXT index of MySQL. Of course SQLite does have the " "functionality named "full-text search". But it is not correlated " @@ -467,7 +420,7 @@ msgid "" "the plugins which uses FULLTEXT index" msgstr "" -#: utilities/documentation.php:187 +#: trunk/utilities/documentation.php:186 msgid "" "If your language is not written by separating words with spaces, e.g. " "Japanese, Chinese or Thai, neither FULLTEXT index nor full-text search work " @@ -479,82 +432,88 @@ msgid "" "with SQLite Integration!" msgstr "" -#: utilities/patch.php:53 +#: trunk/utilities/patch.php:55 msgid "Patch command is not found" msgstr "" -#: utilities/patch.php:56 +#: trunk/utilities/patch.php:58 msgid "Patch command is not executable" msgstr "" -#: utilities/patch.php:73 +#: trunk/utilities/patch.php:75 msgid "Patch file name is invalid" msgstr "" -#: utilities/patch.php:77 +#: trunk/utilities/patch.php:79 msgid "Patch file version does not match with that of your plugin." msgstr "" -#: utilities/patch.php:86 +#: trunk/utilities/patch.php:88 msgid "Error! Plugin directory is not accessible." msgstr "" -#: utilities/patch.php:89 +#: trunk/utilities/patch.php:91 msgid "is patched successfully." msgstr "" -#: utilities/patch.php:94 utilities/patch.php:121 +#: trunk/utilities/patch.php:96 #, php-format msgid "Error! Messages: %s" msgstr "" -#: utilities/patch.php:118 -msgid "Error!: patches directory is not accessible." -msgstr "" - -#: utilities/patch.php:123 +#: trunk/utilities/patch.php:120 #, php-format msgid "File %s is deleted." msgstr "" -#: utilities/patch.php:138 +#: trunk/utilities/patch.php:122 +#, php-format +msgid "Error! File %s is not deleted." +msgstr "" + +#: trunk/utilities/patch.php:126 +msgid "Error!: patches directory is not accessible." +msgstr "" + +#: trunk/utilities/patch.php:142 msgid "File is uploaded" msgstr "" -#: utilities/patch.php:142 +#: trunk/utilities/patch.php:146 msgid "File is not uploaded" msgstr "" -#: utilities/patch.php:146 +#: trunk/utilities/patch.php:150 msgid "File is not selected" msgstr "" -#: utilities/patch.php:164 utilities/patch.php:166 utilities/patch.php:186 -#: utilities/patch.php:188 utilities/patch.php:208 utilities/patch.php:210 +#: trunk/utilities/patch.php:168 trunk/utilities/patch.php:170 +#: trunk/utilities/patch.php:190 trunk/utilities/patch.php:192 +#: trunk/utilities/patch.php:212 trunk/utilities/patch.php:214 msgid "You are not allowed to do this operation!" msgstr "" -#: utilities/patch.php:170 utilities/patch.php:192 +#: trunk/utilities/patch.php:174 trunk/utilities/patch.php:196 msgid "Please select patch file(s)" msgstr "" -#: utilities/patch.php:179 +#: trunk/utilities/patch.php:183 msgid "None of the patches is applied!" msgstr "" -#: utilities/patch.php:201 +#: trunk/utilities/patch.php:205 msgid "Error! Please remove files manually" msgstr "" -#: utilities/patch.php:224 +#: trunk/utilities/patch.php:228 msgid "Patch Files Upload and Apply" msgstr "" -#: utilities/patch.php:225 +#: trunk/utilities/patch.php:229 msgid "What you can do in this page" msgstr "" -#: utilities/patch.php:227 +#: trunk/utilities/patch.php:231 msgid "" "I made patch files for some plugins that are incompatible with SQLite " "Integration and need rewriting. And I wrote in the Plugin Directory for the substitutes?" msgstr "" -#: utilities/patch.php:234 +#: trunk/utilities/patch.php:238 msgid "" "Your PHP script has the permission to create a directory and write a file in " "it." msgstr "" -#: utilities/patch.php:235 +#: trunk/utilities/patch.php:239 msgid "Your PHP scripts can execute exec() function on the server." msgstr "" -#: utilities/patch.php:236 +#: trunk/utilities/patch.php:240 msgid "" "Your PHP script can execute "patch" shell command.(Script will " "check if it is executable or not.)" msgstr "" -#: utilities/patch.php:239 +#: trunk/utilities/patch.php:243 msgid "" "If uploading fails, it' very likely that application will fail. When you try " "uploading with FTP client, the patch files must be put into the directory wp-" -"content/uploads/patches/." +"content/uploads/patches/. When constant UPLOADS is defined, script follows " +"it." msgstr "" -#: utilities/patch.php:242 +#: trunk/utilities/patch.php:246 msgid "" "You can create your patch file yourself. When you create one, please test it " "on your local server first and check if it works fine without PHP error or " @@ -607,23 +567,23 @@ msgid "" "patch file as follows:" msgstr "" -#: utilities/patch.php:245 +#: trunk/utilities/patch.php:249 msgid "Use the file name beginning with the plugin directory name." msgstr "" -#: utilities/patch.php:246 +#: trunk/utilities/patch.php:250 msgid "Use the plugin version number after the directory name with underscore." msgstr "" -#: utilities/patch.php:247 +#: trunk/utilities/patch.php:251 msgid "Use the suffix .patch." msgstr "" -#: utilities/patch.php:248 +#: trunk/utilities/patch.php:252 msgid "Use diff command options "-Naur"." msgstr "" -#: utilities/patch.php:251 +#: trunk/utilities/patch.php:255 msgid "" "For example, the patch file for the plugin "Debug Bar" is "" "debug-bar_0.8.patch". Script interprets "debug-bar" as the " @@ -632,47 +592,47 @@ msgid "" "skip applying the patch file. And script will reject any other file name." msgstr "" -#: utilities/patch.php:254 +#: trunk/utilities/patch.php:258 msgid "How to install, patch and activate plugins" msgstr "" -#: utilities/patch.php:256 +#: trunk/utilities/patch.php:260 msgid "Install the plugin (not yet activate it)" msgstr "" -#: utilities/patch.php:257 +#: trunk/utilities/patch.php:261 msgid "Upload the patch file (if any) to the server and ppply it in this page" msgstr "" -#: utilities/patch.php:258 +#: trunk/utilities/patch.php:262 msgid "Back to the installed plugin page and activate it" msgstr "" -#: utilities/patch.php:260 +#: trunk/utilities/patch.php:264 msgid "How to upgrade plugins" msgstr "" -#: utilities/patch.php:262 +#: trunk/utilities/patch.php:266 msgid "When upgrading the plugin, it will be safer to follow next steps." msgstr "" -#: utilities/patch.php:265 +#: trunk/utilities/patch.php:269 msgid "Deactivate the plugin" msgstr "" -#: utilities/patch.php:266 +#: trunk/utilities/patch.php:270 msgid "Upgrade the plugin" msgstr "" -#: utilities/patch.php:267 +#: trunk/utilities/patch.php:271 msgid "Upload the patch file (if any) and apply it" msgstr "" -#: utilities/patch.php:268 +#: trunk/utilities/patch.php:272 msgid "Reactivate the plugin" msgstr "" -#: utilities/patch.php:270 +#: trunk/utilities/patch.php:274 msgid "" "If there isn't a patch file to match with the newest version of the plugin, " "it won't work properly. Please wait for somebody to make one or rewrite the " @@ -681,116 +641,125 @@ msgid "" "replace the MySQL functions with the WordPress built-in functions)." msgstr "" -#: utilities/patch.php:271 +#: trunk/utilities/patch.php:275 msgid "Upload and Apply" msgstr "" -#: utilities/patch.php:275 +#: trunk/utilities/patch.php:279 msgid "File Select" msgstr "" -#: utilities/patch.php:282 +#: trunk/utilities/patch.php:286 msgid "" "Select file from your computer. If the file name is the same as existent " "file, this operation will override it." msgstr "" -#: utilities/patch.php:284 +#: trunk/utilities/patch.php:288 msgid "Upload" msgstr "" -#: utilities/patch.php:289 +#: trunk/utilities/patch.php:293 msgid "Patch files uploaded" msgstr "" -#: utilities/patch.php:296 +#: trunk/utilities/patch.php:300 msgid "" "Select the file(s) you want to apply to the plugin(s) or you want to delete. " "You can select multiple files." msgstr "" -#: utilities/patch.php:300 +#: trunk/utilities/patch.php:304 msgid "Apply/Hold" msgstr "" -#: utilities/patch.php:301 +#: trunk/utilities/patch.php:305 msgid "Patch files to apply" msgstr "" -#: utilities/patch.php:317 +#: trunk/utilities/patch.php:321 msgid "Apply patch" msgstr "" -#: utilities/patch.php:317 +#: trunk/utilities/patch.php:321 msgid "" "Are you sure to apply patch files?\\n\\nClick [Cancel] to stop,[OK] to " "continue." msgstr "" -#: utilities/patch.php:318 +#: trunk/utilities/patch.php:322 trunk/utilities/utility.php:765 msgid "Delete file" msgstr "" -#: utilities/patch.php:318 +#: trunk/utilities/patch.php:322 msgid "" "Are you sure to delete patch files?\\n\\nClick [Cancel] to stop,[OK] to " "continue." msgstr "" -#: utilities/patch.php:329 +#: trunk/utilities/patch.php:333 msgid "Caution about your patch file(s)" msgstr "" -#: utilities/patch.php:333 +#: trunk/utilities/patch.php:337 msgid "" "If you don't know where it comes from or who created it, I strongly " "recommend that you should see and check the contents of the file. If a " "person who created it secretly inserted a malicious codes, it will be " "executed by the plugin and may damage your site or your server, for which " -"damage I incur any liability. If you don't understand well, you'd better use " -"the substitute plugins. Take your own risk, please." +"damage I don't incur any liability. If you don't understand well, you'd " +"better use the substitute plugins. Take your own risk, please." msgstr "" -#: utilities/utility.php:248 +#: trunk/utilities/utility.php:248 msgid "Probably Yes" msgstr "" -#: utilities/utility.php:254 +#: trunk/utilities/utility.php:254 msgid "Checked" msgstr "" -#: utilities/utility.php:257 utilities/utility.php:263 +#: trunk/utilities/utility.php:257 trunk/utilities/utility.php:263 msgid "Not Checked" msgstr "" -#: utilities/utility.php:268 +#: trunk/utilities/utility.php:268 msgid "Sitewide Active" msgstr "" -#: utilities/utility.php:271 +#: trunk/utilities/utility.php:271 msgid "Active" msgstr "" -#: utilities/utility.php:274 +#: trunk/utilities/utility.php:274 msgid "Inactive" msgstr "" -#: utilities/utility.php:336 +#: trunk/utilities/utility.php:391 +#, php-format +msgid "File %s was deleted." +msgstr "" + +#: trunk/utilities/utility.php:393 +msgid "Error! File was not deleted." +msgstr "" + +#: trunk/utilities/utility.php:404 msgid "Welcome to SQLite Integration" msgstr "" -#: utilities/utility.php:338 +#: trunk/utilities/utility.php:406 msgid "Thank you for using SQLite Integration plugin!" msgstr "" -#: utilities/utility.php:341 +#: trunk/utilities/utility.php:409 msgid "" "You read this message, which means you have succeeded in installing " -"WordPress with this plugin SQLite Integration. Congratulations and enjoy your " -"Blogging!" +"WordPress with this plugin SQLite Integration. Congratulations and enjoy " +"your Blogging!" msgstr "" -#: utilities/utility.php:344 +#: trunk/utilities/utility.php:412 msgid "" "You don't have to set any special settings. In fact there are no other " "settings. You can write articles or pages and customize you WordPress in an " @@ -799,125 +768,125 @@ msgid "" "about this plugin and your SQLite database below." msgstr "" -#: utilities/utility.php:346 +#: trunk/utilities/utility.php:414 msgid "" "Deactivation makes this documents and utilities disappear from the " -"dashboard, but it doesn't affect the functionality of the SQLite Integration. " -"when uninstalled, it will remove wp-content/uploads/patches directory (if " -"exists) and wp-content/db.php file altogether." +"dashboard, but it doesn't affect the functionality of the SQLite " +"Integration. when uninstalled, it will remove wp-content/uploads/patches " +"directory (if exists) and wp-content/db.php file altogether." msgstr "" -#: utilities/utility.php:349 +#: trunk/utilities/utility.php:417 msgid "Title" msgstr "" -#: utilities/utility.php:350 +#: trunk/utilities/utility.php:418 msgid "Contents" msgstr "" -#: utilities/utility.php:355 +#: trunk/utilities/utility.php:423 msgid "You can read documentation about this plugin and plugin compatibility." msgstr "" -#: utilities/utility.php:359 +#: trunk/utilities/utility.php:427 msgid "You can see database and system information." msgstr "" -#: utilities/utility.php:363 +#: trunk/utilities/utility.php:431 msgid "" "You can see the error log and edit db.php file (if necessary) and optimize " "your database." msgstr "" -#: utilities/utility.php:367 +#: trunk/utilities/utility.php:435 msgid "You can upload patch files and apply them to the incompatible plugins." msgstr "" -#: utilities/utility.php:396 +#: trunk/utilities/utility.php:464 msgid "System Information" msgstr "" -#: utilities/utility.php:397 +#: trunk/utilities/utility.php:465 msgid "PHP Informations" msgstr "" -#: utilities/utility.php:402 utilities/utility.php:438 +#: trunk/utilities/utility.php:470 trunk/utilities/utility.php:506 msgid "Items" msgstr "" -#: utilities/utility.php:403 +#: trunk/utilities/utility.php:471 msgid "Description" msgstr "" -#: utilities/utility.php:408 +#: trunk/utilities/utility.php:476 msgid "WordPress Version" msgstr "" -#: utilities/utility.php:412 +#: trunk/utilities/utility.php:480 msgid "PHP Version" msgstr "" -#: utilities/utility.php:416 +#: trunk/utilities/utility.php:484 msgid "PDO Support" msgstr "" -#: utilities/utility.php:420 +#: trunk/utilities/utility.php:488 msgid "PDO Drivers" msgstr "" -#: utilities/utility.php:424 +#: trunk/utilities/utility.php:492 msgid "PDO Driver for SQLite 3.x" msgstr "" -#: utilities/utility.php:428 +#: trunk/utilities/utility.php:496 msgid "SQLite Library Version" msgstr "" -#: utilities/utility.php:434 +#: trunk/utilities/utility.php:502 msgid "Your Database Status" msgstr "" -#: utilities/utility.php:439 +#: trunk/utilities/utility.php:507 msgid "Status" msgstr "" -#: utilities/utility.php:445 +#: trunk/utilities/utility.php:513 msgid "Database Size" msgstr "" -#: utilities/utility.php:449 +#: trunk/utilities/utility.php:517 msgid "Page Size" msgstr "" -#: utilities/utility.php:453 +#: trunk/utilities/utility.php:521 msgid "Total Number of Pages" msgstr "" -#: utilities/utility.php:457 +#: trunk/utilities/utility.php:525 msgid "Unused Page" msgstr "" -#: utilities/utility.php:461 +#: trunk/utilities/utility.php:529 msgid "Integrity Check" msgstr "" -#: utilities/utility.php:465 +#: trunk/utilities/utility.php:533 msgid "Encoding" msgstr "" -#: utilities/utility.php:469 +#: trunk/utilities/utility.php:537 msgid "Collations" msgstr "" -#: utilities/utility.php:481 +#: trunk/utilities/utility.php:549 msgid "Compile Options" msgstr "" -#: utilities/utility.php:495 +#: trunk/utilities/utility.php:563 msgid "Database Tables and Indexes" msgstr "" -#: utilities/utility.php:497 +#: trunk/utilities/utility.php:565 msgid "" "Table names in brown are required by WordPress, and those in blue are " "created by some plugins. The table sqlite_sequence is not a WordPress table " @@ -927,117 +896,172 @@ msgid "" "g. SQLiteManager)." msgstr "" -#: utilities/utility.php:502 +#: trunk/utilities/utility.php:570 msgid "Table Name" msgstr "" -#: utilities/utility.php:503 +#: trunk/utilities/utility.php:571 msgid "System/User" msgstr "" -#: utilities/utility.php:504 +#: trunk/utilities/utility.php:572 msgid "Index ( Column )" msgstr "" -#: utilities/utility.php:529 +#: trunk/utilities/utility.php:610 msgid "Plugin Info" msgstr "" -#: utilities/utility.php:531 +#: trunk/utilities/utility.php:612 msgid "This table shows plugins you have installed and their compatibility." msgstr "" -#: utilities/utility.php:536 +#: trunk/utilities/utility.php:617 msgid "Installed Plugins" msgstr "" -#: utilities/utility.php:537 +#: trunk/utilities/utility.php:618 msgid "Active/Inactive" msgstr "" -#: utilities/utility.php:538 +#: trunk/utilities/utility.php:619 msgid "Compatible" msgstr "" -#: utilities/utility.php:562 +#: trunk/utilities/utility.php:643 msgid "Log cleared" msgstr "" -#: utilities/utility.php:565 +#: trunk/utilities/utility.php:646 msgid "Log not cleared" msgstr "" -#: utilities/utility.php:577 +#: trunk/utilities/utility.php:658 msgid "db.php was saved" msgstr "" -#: utilities/utility.php:580 +#: trunk/utilities/utility.php:661 msgid "Error! db.php couldn't be saved" msgstr "" -#: utilities/utility.php:591 +#: trunk/utilities/utility.php:672 #, php-format msgid "" "Optimization finished. Before optimization: %1$s, After optimization: %2$s." msgstr "" -#: utilities/utility.php:594 +#: trunk/utilities/utility.php:675 msgid "Optimization failed" msgstr "" -#: utilities/utility.php:608 +#: trunk/utilities/utility.php:683 +msgid "Couldn't find your database file." +msgstr "" + +#: trunk/utilities/utility.php:695 +msgid "Please select backup file(s)." +msgstr "" + +#: trunk/utilities/utility.php:704 +msgid "Error! Please remove file(s) manyally." +msgstr "" + +#: trunk/utilities/utility.php:718 msgid "Database Optimization, Error Log, Init File" msgstr "" -#: utilities/utility.php:609 +#: trunk/utilities/utility.php:719 msgid "Optimize You Database" msgstr "" -#: utilities/utility.php:611 +#: trunk/utilities/utility.php:721 msgid "" "This button sends "vacuum" command to your SQLite database. That " "command reclaims space after data has been deleted." msgstr "" -#: utilities/utility.php:619 +#: trunk/utilities/utility.php:729 msgid "Optimize" msgstr "" -#: utilities/utility.php:619 +#: trunk/utilities/utility.php:729 msgid "" "Are you sure to optimize your database?\\n\\nClick [Cancel] to stop, [OK] to " "continue." msgstr "" -#: utilities/utility.php:622 +#: trunk/utilities/utility.php:732 +msgid "Create or Delete backup file(s)" +msgstr "" + +#: trunk/utilities/utility.php:734 +msgid "" +"Click the backup button below if you want to create a current snapshot of " +"your database file. The backup file is named ‘DB_FILE_NAME.yyyymmdd." +"zip’ if PHP zip extension is loaded ‘DB_FILE_NAME.yyyymmdd." +"back’ if not loaded, and is put in the same directory that the database " +"is in." +msgstr "" + +#: trunk/utilities/utility.php:737 +msgid "" +"If you want to delete the file(s), check the file name and click the Delete " +"button. You can check multiple files." +msgstr "" + +#: trunk/utilities/utility.php:748 +msgid "Delete" +msgstr "" + +#: trunk/utilities/utility.php:749 +msgid "Backup Files" +msgstr "" + +#: trunk/utilities/utility.php:764 +msgid "Backup" +msgstr "" + +#: trunk/utilities/utility.php:764 +msgid "" +"Are you sure to make a backup file?\\n\\nClick [Cancel] to stop, [OK] to " +"continue." +msgstr "" + +#: trunk/utilities/utility.php:765 +msgid "" +"Are you sure to delete backup file(s)?\\n\\nClick [Cancel] to stop, [OK] to " +"continue." +msgstr "" + +#: trunk/utilities/utility.php:768 msgid "SQLite Integration Error Log" msgstr "" -#: utilities/utility.php:624 +#: trunk/utilities/utility.php:770 msgid "" -"This is the contents of SQLite Integration error log file(default: wp-content/" -"database/debug.txt). If you want to clear this file, click the Clear Log " -"button." +"This is the contents of SQLite Integration error log file(default: wp-" +"content/database/debug.txt). If you want to clear this file, click the Clear " +"Log button." msgstr "" -#: utilities/utility.php:634 +#: trunk/utilities/utility.php:780 msgid "No error messages are found" msgstr "" -#: utilities/utility.php:642 +#: trunk/utilities/utility.php:788 msgid "Clear Log" msgstr "" -#: utilities/utility.php:642 +#: trunk/utilities/utility.php:788 msgid "" "Are you sure to clear Log?\\n\\nClick [Cancel] to stop, [OK] to continue." msgstr "" -#: utilities/utility.php:646 +#: trunk/utilities/utility.php:792 msgid "Edit Initial File (wp-content/db.php)" msgstr "" -#: utilities/utility.php:648 +#: trunk/utilities/utility.php:794 msgid "" "When you go "Plugins » Edit Plugin" page, you can edit " "plugin source file. But you can't see this file there because it is not in " @@ -1046,11 +1070,11 @@ msgid "" "well, please don't edit this file." msgstr "" -#: utilities/utility.php:658 +#: trunk/utilities/utility.php:804 msgid "Save" msgstr "" -#: utilities/utility.php:658 +#: trunk/utilities/utility.php:804 msgid "" "Are you sure to save this file?\\n\\nClick [Cancel] to stop, [OK] to " "continue." diff --git a/pdodb.class.php b/pdodb.class.php index 7f0816f..2585dd7 100644 --- a/pdodb.class.php +++ b/pdodb.class.php @@ -1,7 +1,6 @@ charset; + if ( ! isset( $collate ) ) + $collate = $this->collate; + } /** * dummy out the MySQL function * @see wpdb::select() @@ -62,10 +71,7 @@ class PDODB extends wpdb { * @see wpdb::_real_escape() */ function _real_escape($string) { - if ($this->dbh && $this->real_escape) - return $this->dbh->quote($string); - else - return addslashes($string); + return addslashes($string); } /** @@ -77,7 +83,7 @@ class PDODB extends wpdb { if (!$str) { $err = $this->dbh->get_error_message() ? $this->dbh->get_error_message() : ''; - $str = $err[2]; + if (!empty($err)) $str = $err[2]; else $str = ''; } $EZSQL_ERROR[] = array('query' => $this->last_query, 'error_str' => $str); diff --git a/pdoengine.class.php b/pdoengine.class.php index 6064e2f..0044fbe 100644 --- a/pdoengine.class.php +++ b/pdoengine.class.php @@ -1,7 +1,6 @@ init(); @@ -80,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; } @@ -96,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; } @@ -113,16 +112,16 @@ class PDOEngine extends PDO { global $wpdb; $u = umask(0000); if (!is_dir(FQDBDIR)) { - if (!@mkdir(FQDBDIR, 0777, true)) { + if (!@mkdir(FQDBDIR, 0707, true)) { umask($u); - $message = __('Unable to create the required directory! Please check your server settings.', 'sqlite-integration'); + $message = 'Unable to create the required directory! Please check your server settings.'; echo $message; return false; } } if (!is_writable(FQDBDIR)) { umask($u); - $message = __('Unable to create a file in the directory! Please check your server settings.', 'sqlite-integration'); + $message = 'Unable to create a file in the directory! Please check your server settings.'; echo $message; return false; } @@ -130,11 +129,11 @@ class PDOEngine extends PDO { $fh = fopen(FQDBDIR . '.htaccess', "w"); if (!$fh) { umask($u); - $message = __('Unable to create a file in the directory! Please check your server settings.', 'sqlite-integration'); + $message = 'Unable to create a file in the directory! Please check your server settings.'; echo $message; return false; } - fwrite($fh, "DENY FROM ALL"); + fwrite($fh, 'DENY FROM ALL'); fclose($fh); } umask($u); @@ -145,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) { @@ -253,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; @@ -299,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; @@ -313,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; @@ -325,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 { @@ -347,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 { @@ -370,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 { @@ -378,32 +377,34 @@ 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 'check': + case 'analyze': // 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 { @@ -424,7 +425,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 { @@ -436,7 +437,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; } @@ -469,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; @@ -505,7 +506,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); @@ -544,7 +545,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) { @@ -557,7 +558,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); @@ -633,7 +634,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; } @@ -649,7 +650,12 @@ class PDOEngine extends PDO { $engine = $this->prepare_engine($this->query_type); $reason = 0; $message = ''; + $re_query = ''; $rewritten_query = $engine->rewrite_query($query, $this->query_type); + if (is_array($rewritten_query) && array_key_exists('recursion', $rewritten_query)) { + $re_query = $rewritten_query['recursion']; + unset($rewritten_query['recursion']); + } try { $this->beginTransaction(); if (is_array($rewritten_query)) { @@ -675,8 +681,11 @@ class PDOEngine extends PDO { $this->rollBack(); } } + if ($re_query != '') { + $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; } @@ -699,7 +708,11 @@ class PDOEngine extends PDO { $value = str_replace("'", '', $match[1]); $dummy_data['Variable_name'] = trim($value); // this is set for Wordfence Security Plugin - if ($value == 'max_allowed_packet') $dummy_data['Value'] = 1047552; + if ($value == 'max_allowed_packet') { + $dummy_data['Value'] = 1047552; + } else { + $dummy_data['Value'] = ''; + } } $_results[] = new ObjectArray($dummy_data); $this->results = $_results; @@ -713,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; } @@ -774,6 +789,7 @@ class PDOEngine extends PDO { } /** * rewrites the result of SHOW INDEX to the Object compatible with MySQL + * added the WHERE clause manipulation (ver 1.3.1) */ private function convert_to_index_object() { $_results = array(); @@ -840,10 +856,44 @@ class PDOEngine extends PDO { $_columns['Comment'] = ''; $_results[] = new ObjectArray($_columns); } + if (stripos($this->queries[0], 'WHERE') !== false) { + preg_match('/WHERE\\s*(.*)$/im', $this->queries[0], $match); + list($key, $value) = explode('=', $match[1]); + $key = trim($key); + $value = preg_replace("/[\';]/", '', $value); + $value = trim($value); + foreach ($_results as $result) { + if (stripos($value, $result->$key) !== false) { + unset($_results); + $_results[] = $result; + break; + } + } + } } $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 0f0a396..a399f54 100644 --- a/query.class.php +++ b/query.class.php @@ -1,7 +1,6 @@ _delete_index_hints(); $this->_rewrite_regexp(); $this->_rewrite_boolean(); + $this->_fix_date_quoting(); + $this->_rewrite_between(); break; case 'insert': $this->_strip_backticks(); $this->_execute_duplicate_key_update(); $this->_rewrite_insert_ignore(); $this->_rewrite_regexp(); + $this->_fix_date_quoting(); break; case 'update': $this->_strip_backticks(); @@ -68,6 +70,7 @@ class PDOSQLiteDriver { $this->_rewrite_limit_usage(); $this->_rewrite_order_by_usage(); $this->_rewrite_regexp(); + $this->_rewrite_between(); break; case 'delete': $this->_strip_backticks(); @@ -85,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; } @@ -95,7 +106,7 @@ class PDOSQLiteDriver { */ private function _handle_show_query(){ $table_name = ''; - $pattern = '/^\\s*SHOW\\s*TABLES\\s*(LIKE\\s*(.*))$/im'; + $pattern = '/^\\s*SHOW\\s*TABLES\\s*.*?(LIKE\\s*(.*))$/im'; if (preg_match($pattern, $this->_query, $matches)) { $table_name = str_replace(array("'", ';'), '', $matches[2]); } @@ -285,25 +296,28 @@ class PDOSQLiteDriver { * @return void */ private function _delete_index_hints(){ - $pattern = '/use\s+index\s*\(.*?\)/i'; + $pattern = '/\\s*(use|ignore|force)\\s+index\\s*\(.*?\)/i'; $this->_query = preg_replace($pattern, '', $this->_query); } /** - * Justin Adie says: - * method to fix inconsistent use of quoted, unquoted etc date values in query function - * this is ironic, given the above rewrite badlyformed dates method - * examples + * Fix the date string and quote. This is required for the calendar widget. + * * where month(fieldname)=08 becomes month(fieldname)='8' * where month(fieldname)='08' becomes month(fieldname)='8' * - * I don't understand... + * I use preg_replace_callback instead of 'e' option because of security reason. + * cf. PHP manual (regular expression) * * @return void */ - private function _fix_date_quoting(){ - $pattern = '/(month|year|second|day|minute|hour|dayofmonth)\s*\((.*?)\)\s*=\s*["\']?(\d{1,4})[\'"]?\s*/ei'; - $this->_query = preg_replace($pattern, "'\\1(\\2)=\'' . intval('\\3') . '\' ' ", $this->_query); + private function _fix_date_quoting() { + $pattern = '/(month|year|second|day|minute|hour|dayofmonth)\\s*\((.*?)\)\\s*=\\s*["\']?(\d{1,4})[\'"]?\\s*/im'; + $this->_query = preg_replace_callback($pattern, array($this, '__fix_date_quoting'), $this->_query); + } + private function __fix_date_quoting($match) { + $fixed_val = "{$match[1]}({$match[2]})='" . intval($match[3]) . "' "; + return $fixed_val; } private function _rewrite_regexp(){ @@ -341,28 +355,12 @@ class PDOSQLiteDriver { /** * method to execute SHOW INDEX query + * Moved the WHERE clause manipulation to pdoengin.class.php (ver 1.3.1) */ private function _handle_show_index() { - $_columns = array(// No, you'll get no meaningful information.. - 'Key_name' => 'name', - ); - $pattern_0 = '/^\\s*SHOW\\s*(?:INDEX|INDEXES|KEYS)\\s*FROM\\s*(\\w+)?\\s*WHERE\\s*(.*)$/im'; - $pattern_1 = '/^\\s*SHOW\\s*(?:INDEX|INDEXES|KEYS)\\s*FROM\\s*(\\w+)?/im'; - if (preg_match($pattern_0, $this->_query, $match_0)) { - $table_name = str_replace("'", '', $match_0[1]); - list($key, $value) = explode('=', $match_0[2]); - $key = trim($key); - $value = preg_replace("/[\';]/", '', $value); - $value = trim($value); - if (array_key_exists($key, $_columns)) { - $key = $_columns[$key]; - $where_clause = 'AND ' . $key . ' LIKE ' . "'" . $value . "%'"; - } else { - $where_clause = ''; - } - $this->_query = "SELECT * FROM sqlite_master WHERE tbl_name='$table_name' $where_clause"; - } elseif (preg_match($pattern_1, $this->_query, $match_1)) { - $table_name = preg_replace("/[\';]/", '', $match_1[1]); + $pattern = '/^\\s*SHOW\\s*(?:INDEX|INDEXES|KEYS)\\s*FROM\\s*(\\w+)?/im'; + if (preg_match($pattern, $this->_query, $match)) { + $table_name = preg_replace("/[\';]/", '', $match[1]); $table_name = trim($table_name); $this->_query = "SELECT * FROM sqlite_master WHERE tbl_name='$table_name'"; } @@ -408,7 +406,7 @@ class PDOSQLiteDriver { return; } // data check - if (preg_match('/^\((.*)\)\\s*VALUES\\s*\((.*)\)$/im', $insert_data, $match_1)) { + if (preg_match('/^\((.*)\)\\s*VALUES\\s*\((.*)\)$/ims', $insert_data, $match_1)) { $col_array = explode(',', $match_1[1]); $ins_data_array = explode(',', $match_1[2]); foreach ($col_array as $col) { @@ -498,15 +496,45 @@ 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() { + $pattern = '/\\s*(\\w+)?\\s*BETWEEN\\s*([^\\s]*)?\\s*AND\\s*([^\\s]*)?\\s*/ims'; + if (preg_match($pattern, $this->_query, $match)) { + $column_name = trim($match[1]); + $min_value = trim($match[2]); + $max_value = trim($match[3]); + $max_value = rtrim($max_value); + $tokens = preg_split("/(''|'|,|)/s", $this->_query, -1, PREG_SPLIT_DELIM_CAPTURE); + $literal = false; + $rewriting = false; + foreach ($tokens as $token) { + if (strpos($token, "'") !== false) { + if ($literal) { + $literal = false; + } else { + $literal = true; + } + } else { + if ($literal === false && stripos($token, 'between') !== false) { + $rewriting = true; + break; + } + } + } + if ($rewriting) { + $replacement = " $column_name >= '$min_value' AND $column_name <= '$max_value'"; + $this->_query = str_ireplace($match[0], $replacement, $this->_query); + } + } + } /** * workaround function to avoid DELETE with JOIN * wp-admin/includes/upgrade.php contains 'DELETE ... JOIN' statement. @@ -522,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/query_alter.class.php b/query_alter.class.php index 5061546..38d5d44 100644 --- a/query_alter.class.php +++ b/query_alter.class.php @@ -3,56 +3,71 @@ * The class for manipulating ALTER query * newly supports multiple variants * @package SQLite Integration - * @version 1.1 * @author Kojima Toshiyasu */ class AlterQuery { public $_query = null; public function rewrite_query($query, $query_type) { - $tokens = array(); if (stripos($query, $query_type) === false) { return false; } $query = str_replace('`', '', $query); if (preg_match('/^\\s*(ALTER\\s*TABLE)\\s*(\\w+)?\\s*/ims', $query, $match)) { + $tmp_query = array(); + $tokens = array(); + $re_command = ''; $command = str_ireplace($match[0], '', $query); $tmp_tokens['query_type'] = trim($match[1]); $tmp_tokens['table_name'] = trim($match[2]); - $command_array = $this->split_multiple($command); - foreach ($command_array as $single_command) { - $command_tokens = $this->command_tokenizer($single_command); - if (!empty($command_tokens)) { - $tokens[] = array_merge($tmp_tokens, $command_tokens); - } else { - $this->_query = 'SELECT 1=1'; - } +// $command_array = $this->split_multiple($command); + $command_array = explode(',', $command); + + $single_command = array_shift($command_array); + if (!empty($command_array)) { + $re_command = 'ALTER TABLE ' . $tmp_tokens['table_name'] . ' '; + $re_command .= implode(',', $command_array); + } + $command_tokens = $this->command_tokenizer($single_command); + if (!empty($command_tokens)) { + $tokens = array_merge($tmp_tokens, $command_tokens); + } else { + $this->_query = 'SELECT 1=1'; + return $this->_query; } - foreach ($tokens as $token) { - $command_name = $token['command']; - switch ($command_name) { - case 'add column': case 'rename to': case 'add index': case 'drop index': - $this->_query = $this->handle_single_command($token); - break; - case 'add primary key': - $this->_query = $this->handle_add_primary_key($token); - break; - case 'drop primary key': - $this->_query = $this->handle_drop_primary_key($token); - break; - case 'modify column': - $this->_query = $this->handle_modify_command($token); - break; - case 'change column': - $this->_query = $this->handle_change_command($token); - break; - case 'alter column': - $this->_query = $this->handle_alter_command($token); - break; - default: - break; +// foreach ($tokens as $token) { + $command_name = strtolower($tokens['command']); + switch ($command_name) { + case 'add column': case 'rename to': case 'add index': case 'drop index': + $tmp_query = $this->handle_single_command($tokens); + break; + case 'add primary key': + $tmp_query = $this->handle_add_primary_key($tokens); + break; + case 'drop primary key': + $tmp_query = $this->handle_drop_primary_key($tokens); + break; + case 'modify column': + $tmp_query = $this->handle_modify_command($tokens); + break; + case 'change column': + $tmp_query = $this->handle_change_command($tokens); + break; + case 'alter column': + $tmp_query = $this->handle_alter_command($tokens); + break; + default: + break; } - } +// } + if (!is_array($tmp_query)) { + $this->_query[] = $tmp_query; + } else { + $this->_query = $tmp_query; + } + if ($re_command != '') { + $this->_query = array_merge($this->_query, array('recursion' => $re_command)); + } } else { $this->_query = 'SELECT 1=1'; } @@ -61,110 +76,125 @@ class AlterQuery { private function command_tokenizer($command) { $tokens = array(); - if (preg_match('/^(ADD|DROP|RENAME|MODIFY|CHANGE|ALTER)\\s*(\\w+)?\\s*(\\w+)?\\s*/ims', $command, $match)) { + if (preg_match('/^(ADD|DROP|RENAME|MODIFY|CHANGE|ALTER)\\s*(\\w+)?\\s*(\\w+(\(.+\)|))?\\s*/ims', $command, $match)) { $the_rest = str_ireplace($match[0], '', $command); - $match_1 = strtolower(trim($match[1])); - $match_2 = strtolower(trim($match[2])); - $match_3 = isset($match[3]) ? strtolower(trim($match[3])) : ''; - switch ($match_1) { + $match_1 = trim($match[1]); + $match_2 = trim($match[2]); + $match_3 = isset($match[3]) ? trim($match[3]) : ''; + switch (strtolower($match_1)) { case 'add': - if (in_array($match_2, array('fulltext', 'constraint', 'foreign'))) { + if (in_array(strtolower($match_2), array('fulltext', 'constraint', 'foreign'))) { break; - } elseif ($match_2 == 'column') { + } elseif (stripos('column', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2; $tokens['column_name'] = $match_3; $tokens['column_def'] = trim($the_rest); - } elseif ($match_2 == 'primary') { + } elseif (stripos('primary', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2.' '.$match_3; $tokens['column_name'] = $the_rest; - } elseif ($match_2 == 'unique') { + } elseif (stripos('unique', $match_2) !== false) { list($index_name, $col_name) = preg_split('/[\(\)]/s', trim($the_rest), -1, PREG_SPLIT_DELIM_CAPTURE); $tokens['unique'] = true; $tokens['command'] = $match_1.' '.$match_3; $tokens['index_name'] = trim($index_name); $tokens['column_name'] = '('.trim($col_name).')'; - } elseif (in_array($match_2, array('index', 'key'))) { + } elseif (in_array(strtolower($match_2), array('index', 'key'))) { $tokens['command'] = $match_1.' '.$match_2; - $tokens['index_name'] = $match_3; + if ($match_3 == '') { + $tokens['index_name'] = str_replace(array('(', ')'), '', $the_rest); + } else { + $tokens['index_name'] = $match_3; + } $tokens['column_name'] = trim($the_rest); } else { - $tokens['command'] = $match_1.' column'; + $tokens['command'] = $match_1.' COLUMN'; $tokens['column_name'] = $match_2; $tokens['column_def'] = $match_3.' '.$the_rest; } break; case 'drop': - if ($match_2 == 'column') { + if (stripos('column', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2; $tokens['column_name'] = trim($match_3); - } elseif ($match_2 == 'primary') { + } elseif (stripos('primary', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2.' '.$match_3; - } elseif (in_array($match_2, array('index', 'key'))) { + } elseif (in_array(strtolower($match_2), array('index', 'key'))) { $tokens['command'] = $match_1.' '.$match_2; $tokens['index_name'] = $match_3; - } elseif ($match_2 == 'primary') { + } elseif (stripos('primary', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2.' '.$match_3; } else { - $tokens['command'] = $match_1.' column'; + $tokens['command'] = $match_1.' COLUMN'; $tokens['column_name'] = $match_2; } break; case 'rename': - if ($match_2 == 'to') { + if (stripos('to', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2; $tokens['column_name'] = $match_3; } else { - $tokens['command'] = $match_1.' to'; + $tokens['command'] = $match_1.' TO'; $tokens['column_name'] = $match_2; } break; case 'modify': - if ($match_2 == 'column') { + if (stripos('column', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2; $tokens['column_name'] = $match_3; $tokens['column_def'] = trim($the_rest); } else { - $tokens['command'] = $match_1.' column'; + $tokens['command'] = $match_1.' COLUMN'; $tokens['column_name'] = $match_2; $tokens['column_def'] = $match_3.' '.trim($the_rest); } break; case 'change': - if ($match_2 == 'column') { + $the_rest = trim($the_rest); + if (stripos('column', $match_2) !== false) { $tokens['command'] = $match_1.' '.$match_2; $tokens['old_column'] = $match_3; - list($new_col) = preg_split('/\s/s', trim($the_rest), -1, PREG_SPLIT_DELIM_CAPTURE); - $tokens['new_column'] = $new_col; - $col_def = str_ireplace($new_col, '', $the_rest); - $tokens['column_def'] = trim($col_def); - } else { - $tokens['command'] = $match_1.' column'; - $tokens['old_column'] = $match_2; - $tokens['new_column'] = $match_3; - $tokens['column_def'] = trim($the_rest); - } - break; - case 'alter': - if ($match_2 == 'column') { - $tokens['command'] = $match_1.' '.$match_2; - $tokens['column_name'] = $match_3; - list($set_or_drop) = explode(' ', $the_rest); - if ($set_or_drop == 'set') { - $tokens['default_command'] = 'set default'; - $default_value = str_ireplace('set default', '', $the_rest); - $tokens['default_value'] = trim($default_value); + list($new_col) = explode(' ', $the_rest); + $tmp_col = preg_replace('/\(.+?\)/im', '', $new_col); + if (array_key_exists(strtolower($tmp_col), $this->array_types)) { + $tokens['column_def'] = $the_rest; } else { - $tokens['default_command'] = 'drop default'; + $tokens['new_column'] = $new_col; + $col_def = str_replace($new_col, '', $the_rest); + $tokens['column_def'] = trim($col_def); } } else { $tokens['command'] = $match_1.' column'; + $tokens['old_column'] = $match_2; + $tmp_col = preg_replace('/\(.+?\)/im', '', $match_3); + if (array_key_exists(strtolower($tmp_col), $this->array_types)) { + $tokens['column_def'] = $match_3 . ' ' . $the_rest; + } else { + $tokens['new_column'] = $match_3; + $tokens['column_def'] = $the_rest; + } + } + break; + case 'alter': + if (stripos('column', $match_2) !== false) { + $tokens['command'] = $match_1.' '.$match_2; + $tokens['column_name'] = $match_3; + list($set_or_drop) = explode(' ', $the_rest); + if (stripos('set', $set_or_drop) !== false) { + $tokens['default_command'] = 'SET DEFAULT'; + $default_value = str_ireplace('set default', '', $the_rest); + $tokens['default_value'] = trim($default_value); + } else { + $tokens['default_command'] = 'DROP DEFAULT'; + } + } else { + $tokens['command'] = $match_1.' COLUMN'; $tokens['column_name'] = $match_2; - if ($match_3 == 'set') { - $tokens['default_command'] = 'set default'; + if (stripos('set', $match_3) !== false) { + $tokens['default_command'] = 'SET DEFAULT'; $default_value = str_ireplace('default', '', $the_rest); $tokens['default_value'] = trim($default_value); } else { - $tokens['default_command'] = 'drop default'; + $tokens['default_command'] = 'DROP DEFAULT'; } } break; @@ -299,14 +329,14 @@ class AlterQuery { $create_query = array_shift($index_queries); if (stripos($create_query, $tokenized_query['column_name']) === false) { return 'SELECT 1=1'; - } elseif (preg_match("/{$tokenized_query['column_name']}\\s*{$tokenized_query['column_def']}\\s*[,)]/i", $create_query)) { + } elseif (preg_match("/{$tokenized_query['column_name']}\\s*{$column_def}\\s*[,)]/i", $create_query)) { return 'SELECT 1=1'; } $create_query = preg_replace("/{$tokenized_query['table_name']}/i", $temp_table, $create_query); if (preg_match("/\\b{$tokenized_query['column_name']}\\s*.*(?=,)/ims", $create_query)) { - $create_query = preg_replace("/\\b{$tokenized_query['column_name']}\\s*.*(?=,)/ims", "{$tokenized_query['column_name']} {$tokenized_query['column_def']}", $create_query); + $create_query = preg_replace("/\\b{$tokenized_query['column_name']}\\s*.*(?=,)/ims", "{$tokenized_query['column_name']} {$column_def}", $create_query); } elseif (preg_match("/\\b{$tokenized_query['column_name']}\\s*.*(?=\))/ims", $create_query)) { - $create_query = preg_replace("/\\b{$tokenized_query['column_name']}\\s*.*(?=\))/ims", "{$tokenized_query['column_name']} {$tokenized_query['column_def']}", $create_query); + $create_query = preg_replace("/\\b{$tokenized_query['column_name']}\\s*.*(?=\))/ims", "{$tokenized_query['column_name']} {$column_def}", $create_query); } $query[] = $create_query; $query[] = "INSERT INTO $temp_table SELECT * FROM {$tokenized_query['table_name']}"; @@ -324,11 +354,16 @@ class AlterQuery { $new_fields = ''; $tokenized_query = $queries; $temp_table = 'temp_'.$tokenized_query['table_name']; - $column_def = $this->convert_field_types($tokenized_query['new_column'], $tokenized_query['column_def']); + if (isset($tokenized_query['new_column'])) { + $column_name = $tokenized_query['new_column']; + } else { + $column_name = $tokenized_query['old_column']; + } + $column_def = $this->convert_field_types($column_name, $tokenized_query['column_def']); $_wpdb = new PDODB(); $col_obj = $_wpdb->get_results("SHOW COLUMNS FROM {$tokenized_query['table_name']}"); foreach ($col_obj as $col) { - if ($col->Field == $tokenized_query['old_column']) $col_check = true; + if (stripos($col->Field, $tokenized_query['old_column']) !== false) $col_check = true; $old_fields .= $col->Field . ','; } if ($col_check == false) { @@ -336,7 +371,7 @@ class AlterQuery { return 'SELECT 1=1'; } $old_fields = rtrim($old_fields, ','); - $new_fields = str_replace($tokenized_query['old_column'], $tokenized_query['new_column'], $old_fields); + $new_fields = str_ireplace($tokenized_query['old_column'], $column_name, $old_fields); $query_obj = $_wpdb->get_results("SELECT sql FROM sqlite_master WHERE tbl_name='{$tokenized_query['table_name']}'"); $_wpdb = null; for ($i = 0; $i < count($query_obj); $i++) { @@ -345,16 +380,16 @@ class AlterQuery { $create_query = array_shift($index_queries); $create_query = preg_replace("/{$tokenized_query['table_name']}/i", $temp_table, $create_query); if (preg_match("/\\b{$tokenized_query['old_column']}\\s*(.+?)(?=,)/ims", $create_query, $match)) { - if ($tokenized_query['column_def'] == trim($match[1])) { + if (stripos(trim($match[1]), $column_def) !== false) { return 'SELECT 1=1'; } else { - $create_query = preg_replace("/\\b{$tokenized_query['old_column']}\\s*.*?(?=,)/ims", "{$tokenized_query['new_column']} {$tokenized_query['column_def']}", $create_query); + $create_query = preg_replace("/\\b{$tokenized_query['old_column']}\\s*.+?(?=,)/ims", "{$column_name} {$column_def}", $create_query, 1); } } elseif (preg_match("/\\b{$tokenized_query['old_column']}\\s*(.+?)(?=\))/ims", $create_query, $match)) { - if ($tokenized_query['column_def'] == trim($match[1])) { + if (stripos(trim($match[1]), $column_def) !== false) { return 'SELECT 1=1'; } else { - $create_query = preg_replace("/\\b{$tokenized_query['old_column']}\\s*.*?(?=\))/ims", "{$tokenized_query['new_column']} {$tokenized_query['column_def']}", $create_query); + $create_query = preg_replace("/\\b{$tokenized_query['old_column']}\\s*.*(?=\))/ims", "{$column_name} {$column_def}", $create_query, 1); } } $query[] = $create_query; @@ -370,11 +405,11 @@ class AlterQuery { private function handle_alter_command($queries) { $tokenized_query = $queries; $temp_table = 'temp_'.$tokenized_query['table_name']; - if (stripos($tokenized_query['default_command'], 'set') !== false) { + if (isset($tokenized_query['default_value'])) { $def_value = $this->convert_field_types($tokenized_query['column_name'], $tokenized_query['default_value']); $def_value = 'DEFAULT '.$def_value; } else { - $def_value = ''; + $def_value = null; } $_wpdb = new PDODB(); $query_obj = $_wpdb->get_results("SELECT sql FROM sqlite_master WHERE tbl_name='{$tokenized_query['table_name']}'"); @@ -386,12 +421,34 @@ class AlterQuery { if (stripos($create_query, $tokenized_query['column_name']) === false) { return 'SELECT 1=1'; } - if (preg_match("/\\s*({$tokenized_query['column_name']}\\s*.*?)\\s*(DEFAULT\\s*.*)[,)]/im", $create_query, $match)) { - $col_def = trim($match[1]); - $old_default = trim($match[2]); - $create_query = preg_replace("/($col_def)\\s*$old_default/im", "\\1 $def_value", $create_query); + if (preg_match("/\\s*({$tokenized_query['column_name']})\\s*(.*)?(DEFAULT\\s*.*)[,)]/im", $create_query, $match)) { + $col_name = trim($match[1]); + $col_def = trim($match[2]); + $col_def_esc = str_replace(array('(', ')'), array('\(', '\)'), $col_def); + $checked_col_def = $this->convert_field_types($col_name, $col_def); + $old_default = trim($match[3]); + $pattern = "/$col_name\\s*$col_def_esc\\s*$old_default/im"; + if (is_null($def_value)) { + $replacement = $col_name . ' ' . $checked_col_def; + } else { + $replacement = $col_name . ' ' . $checked_col_def . ' ' . $def_value; + } + $create_query = preg_replace($pattern, $replacement, $create_query); $create_query = str_ireplace($tokenized_query['table_name'], $temp_table, $create_query); - } else { + } elseif (preg_match("/\\s*({$tokenized_query['column_name']})\\s*(.*)?[,)]/im", $create_query, $match)) { + $col_name = trim($match[1]); + $col_def = trim($match[2]); + $col_def_esc = str_replace(array('(', ')'), array('\(', '\)'), $col_def); + $checked_col_def = $this->convert_field_types($col_name, $col_def); + $pattern = "/$col_name\\s*$col_def_esc/im"; + if (is_null($def_value)) { + $replacement = $col_name . ' ' . $checked_col_def; + } else { + $replacement = $col_name . ' ' . $checked_col_def . ' ' . $def_value; + } + $create_query = preg_replace($pattern, $replacement, $create_query); + $create_query = str_ireplace($tokenized_query['table_name'], $temp_table, $create_query); + } else { return 'SELECT 1=1'; } $query[] = $create_query; @@ -410,29 +467,11 @@ class AlterQuery { * @return string */ private function convert_field_types($col_name, $col_def){ - $array_types = array( - 'bit' => 'INTEGER', 'bool' => 'INTEGER', - 'boolean' => 'INTEGER', 'tinyint' => 'INTEGER', - 'smallint' => 'INTEGER', 'mediumint' => 'INTEGER', - 'int' => 'INTEGER', 'integer' => 'INTEGER', - 'bigint' => 'INTEGER', 'float' => 'REAL', - 'double' => 'REAL', 'decimal' => 'REAL', - 'dec' => 'REAL', 'numeric' => 'REAL', - 'fixed' => 'REAL', 'date' => 'TEXT', - 'datetime' => 'TEXT', 'timestamp' => 'TEXT', - 'time' => 'TEXT', 'year' => 'TEXT', - 'char' => 'TEXT', 'varchar' => 'TEXT', - 'binary' => 'INTEGER', 'varbinary' => 'BLOB', - 'tinyblob' => 'BLOB', 'tinytext' => 'TEXT', - 'blob' => 'BLOB', 'text' => 'TEXT', - 'mediumblob' => 'BLOB', 'mediumtext' => 'TEXT', - 'longblob' => 'BLOB', 'longtext' => 'TEXT' - ); $array_curtime = array('current_timestamp', 'current_time', 'current_date'); $array_reptime = array("'0000-00-00 00:00:00'", "'0000-00-00 00:00:00'", "'0000-00-00'"); $def_string = str_replace('`', '', $col_def); - foreach ($array_types as $o=>$r){ - $pattern = "/\\b" . $o . "\\s*(\([^\)]*\))?\\s*/imsx"; + foreach ($this->array_types as $o=>$r){ + $pattern = "/\\b$o\\s*(\([^\)]*\)*)?\\s*/ims"; if (preg_match($pattern, $def_string)) { $def_string = preg_replace($pattern, "$r ", $def_string); break; @@ -449,5 +488,24 @@ class AlterQuery { } return $def_string; } + + private $array_types = array( + 'bit' => 'INTEGER', 'bool' => 'INTEGER', + 'boolean' => 'INTEGER', 'tinyint' => 'INTEGER', + 'smallint' => 'INTEGER', 'mediumint' => 'INTEGER', + 'bigint' => 'INTEGER', 'integer' => 'INTEGER', + 'int' => 'INTEGER', 'float' => 'REAL', + 'double' => 'REAL', 'decimal' => 'REAL', + 'dec' => 'REAL', 'numeric' => 'REAL', + 'fixed' => 'REAL', 'datetime' => 'TEXT', + 'date' => 'TEXT', 'timestamp' => 'TEXT', + 'time' => 'TEXT', 'year' => 'TEXT', + 'varchar' => 'TEXT', 'char' => 'TEXT', + 'varbinary' => 'BLOB', 'binary' => 'BLOB', + 'tinyblob' => 'BLOB', 'mediumblob' => 'BLOB', + 'longblob' => 'BLOB', 'blob' => 'BLOB', + 'tinytext' => 'TEXT', 'mediumtext' => 'TEXT', + 'longtext' => 'TEXT', 'text' => 'TEXT' + ); } ?> \ No newline at end of file diff --git a/query_create.class.php b/query_create.class.php index 6e41e2c..13bdc2a 100644 --- a/query_create.class.php +++ b/query_create.class.php @@ -1,7 +1,6 @@ _query; } + } elseif (preg_match('/^CREATE\\s*(TEMP|TEMPORARY|)\\s*TRIGGER\\s*/im', $this->_query)) { + return $this->_query; } - $this->strip_backticks(); $this->get_table_name(); $this->rewrite_comments(); $this->rewrite_field_types(); @@ -46,6 +46,7 @@ class CreateQuery{ $this->rewrite_set(); $this->rewrite_key(); $this->add_if_not_exists(); + $this->strip_backticks(); return $this->post_process(); } @@ -86,8 +87,12 @@ class CreateQuery{ 'longblob' => 'blob', 'longtext' => 'text' ); foreach ($array_types as $o=>$r){ - $pattern = '/\\b(?_query = preg_replace($pattern, " $r ", $this->_query); + $pattern = "/\\b(?_query)) { + ; + } else { + $this->_query = preg_replace($pattern, " $r ", $this->_query); + } } } diff --git a/readme-ja.txt b/readme-ja.txt index 5d7ca86..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.5.2 -Stable tag: 1.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 @@ -30,6 +30,12 @@ WordPressはMySQLと話していると思っていて、背後で何が起こっ SQLite Integrationは[PDO for WordPress](http://wordpress.org/extend/plugins/pdo-for-wordpress)プラグインの後継です。後者は残念なことに、もうメンテナンスされていないようです。SQLite IntegrationはPDO for WordPressの基本的なアイディアと構造を借りて、より多くの機能とユーティリティを追加しました。 += 重要なお知らせ = + +このプラグインを使ってWordPress 3.5.x をインストールし、3.6にアップグレードした場合、データベースが意図したとおりに動作していないかもしれません。これに該当する場合は、プラグインを最新版にアップグレードして、管理画面のメンテナンスページに移動し、修復が必要かどうかをチェックしてください。必要なら、そのページで提供しているユーティリティを使って修復をすることができます。 + +WordPress 3.6 をインストールした場合や、3.5.x を使っている場合は、これに該当しませんので、修復は必要ありません。 + = Features = SQLite Integrationは普通の「プラグイン」ではありません。WordPressをインストールするときに使います。そのため、少し準備が必要です。インストールのセクションを参照してください。[SQLite Integration Page](http://dogwood.skr.jp/wordpress/sqlite-integration/)をご覧になると、もっと詳しい説明を読むことができます。 @@ -44,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からのサポートは得られません。フォーラムに投稿しても、回答を得ることはまずないでしょう。また、パッチをあてたプラグインを使う場合は、そのプラグインの作者からのサポートはないものと思ってください。自分でリスクを負う必要があります。 @@ -158,18 +165,56 @@ wp-config.phpの準備が終わったら、次のステップに進みます。 * [Yet Another Related Posts](http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/) * [Better Related Posts](http://wordpress.org/extend/plugins/better-related/) -たぶん、もっとあるでしょう。 +たぶん、もっとあるでしょう。動作しないプラグインを見つけたら、お知らせいただけると助かります。 -== Changelog == - -= 1.1 (2013-07-24) = -* DROP INDEX 単独のクエリが動作していなかったのを修正しました。 -* shutdown_hook で descructor を実行していたのをやめました。 -* LOCATE() 関数を使えるようにしました。 - -= 1.0 (2013-07-07) = -最初のリリース。 == Upgrade Notice == 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を使っているときに、管理画面のレイアウトが崩れるのを修正しました。 +* 日本語が一部表示されないのを直しました。 +* SELECT version()がダミーデータを返すようにしました。 +* WP_DEBUGが有効の時に、WordPressのテーブルからカラム情報を読んで表示できるようにしました。 + += 1.4 (2013-09-12) = +* アップグレードしたWordPressで期待通り動作しないのを修正するために、データベース管理ユーティリティを追加しました。 +* SHOW INDEXクエリにWHERE句がある場合の処理を変更しました。 +* ALTER TABLEクエリのバグを修正しました。 + += 1.3 (2013-09-04) = +* データベースファイルのスナップショットをzipアーカイブとしてバックアップするユーティリティを追加しました。 +* ダッシュボードのスタイルをMP6プラグインに合わせたものに変えました。 +* 言語カタログが読み込まれていないときのエラーメッセージの出力方法を一部変更しました。 +* query_create.class.phpの_rewrite_field_types()を変更しました。dbDelta()関数が意図したとおりに実行されます。 +* BETWEENステートメントが使えるようになりました。 +* クエリからインデックスヒントを全て削除して実行するようにしました。 +* New StatPressプラグインが使えるように、ALTER TABLE CHANGE COLUMNの扱いを修正しました。 +* いくつかの小さなバグを修正しました。 + += 1.2.1 (2013-08-04) = +* wp-db.phpの変更にともなって、wpdb::real_escapeプロパティを削除しました。WordPress 3.6 との互換性を保つための変更です。 + += 1.2 (2013-08-03) = +* カレンダー・ウィジェットでの不具合に対応するため、日付フォーマットとそのクオートを修正しました。 +* Windows マシンでパッチファイルが削除できなかったのを修正しました。 +* パッチファイルをアップロードするときに textdomain のエラーが出るのを修正しました。 +* ON DUPLICATE KEY UPDATEをともなったクエリの処理を変更しました。 +* readme.txt と readme-ja.txt の間違いを直しました。 + += 1.1 (2013-07-24) = +* DROP INDEX 単独のクエリが動作していなかったのを修正しました。 +* shutdown_hook で destruct() を実行していたのをやめました。 +* LOCATE() 関数を使えるようにしました。 + += 1.0 (2013-07-07) = +* 最初のリリース。 diff --git a/readme.txt b/readme.txt index c8c56bb..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.5.2 -Stable tag: 1.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: @@ -30,9 +30,15 @@ WordPress thinks she talks with MySQL and doesn't know what has happened in the SQLite Integration is a successor to [PDO for WordPress](http://wordpress.org/extend/plugins/pdo-for-wordpress) plugin, which unfortunately enough, doesn't seem to be maintained any more. SQLite Integration uses the basic idea and structures of that plugin and adds some more features or some utilities. += 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.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. + = 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. @@ -44,9 +50,10 @@ 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 be no support from the plugin authors, eithter. +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. = Translation = @@ -58,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): @@ -150,18 +157,55 @@ These are other examples: * [Yet Another Related Posts](http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/) * [Better Related Posts](http://wordpress.org/extend/plugins/better-related/) -Probably there are more, I'm afraid. - -== Changelog == - -= 1.1 (2013-07-24) = -* Fixed the manipulation of DROP INDEX query. -* Removed desctructor() from shutdown_hook. -* Enabled LOCATE() function in the query string. - -= 1.0 (2013-07-07) = -First release version of the plugin. +Probably there are more, I'm afraid. If you find one, please let me know. == Upgrade Notice == -When auto upgrading of SQLite Integration fails, Please try manual upgrade via FTP. +When auto upgrading of SQLite Integration fails, please try manual upgrade via FTP. + +== 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. +* Fixed the Japanese catalog. +* Added the procedure for returning the dummy data when using SELECT version(). +* Added the procedure for displaying column informatin of WordPress tables when WP_DEBUG enabled. + += 1.4 (2013-09-12) = +* Added the database maintenance utility for fixing the database malfunction of the upgraded WordPress installation. +* Changed the manipulation of SHOW INDEX query with WHERE clause. +* Fixed the bug of the manipulation of ALTER TABLE query. + += 1.3 (2013-09-04) = +* Added the backup utility that creates the zipped archive of the current snapshot of the database file. +* Changed the dashboard style to match MP6 plugin. +* Changed the way of putting out the error messages when language catalogs are not loaded. +* Modified the _rewrite_field_types() in query_create.class.php for the dbDelta() function to work properly. +* Added the support for BETWEEN statement. +* Changed the regular expression to remove all the index hints from the query string. +* Fixed the manipulation of ALTER TABLE CHANGE COLUMN query for NewStatPress plugin to work. +* Fixed minor bugs. + += 1.2.1 (2013-08-04) = +* Removed wpdb::real_escape property following the change of the wpdb.php file which makes the plugin compatible with Wordpress 3.6. + += 1.2 (2013-08-03) = +* Fixed the date string format and its quotation for calendar widget. +* Fixed the patch utility program for using on the Windows machine. +* Fixed the textdomain error in utilities/patch.php file when uploading the patch file. +* Changed the manipulation of the query with ON DUPLICATE KEY UPDATE. +* Fixed the typos in readme.txt and readme-ja.txt. + += 1.1 (2013-07-24) = +* Fixed the manipulation of DROP INDEX query. +* Removed destruct() from shutdown_hook. +* Enabled LOCATE() function in the query string. + += 1.0 (2013-07-07) = +* First release version of the plugin. diff --git a/schema.php b/schema.php index 185ee0a..248c0fd 100644 --- a/schema.php +++ b/schema.php @@ -1,7 +1,6 @@ PDO::ERRMODE_EXCEPTION)); } catch (PDOException $err) { $err_data = $err->errorInfo; - $message = __("Database connection error!
", 'sqlite-integration'); - $message .= sprintf(__("Error message is: %s", 'sqlite-integration'), $err_data[2]); + $message = 'Database connection error!
'; + $message .= sprintf("Error message is: %s", $err_data[2]); echo $message; return false; } @@ -77,8 +76,8 @@ function make_db_sqlite() { $pdo->commit(); } else { $pdo->rollBack(); - $message = sprintf(__("Error occured while creating tables or indexes...
Query was: %s
", 'sqlite-integration'), var_export($rewritten_query, true)); - $message .= sprintf(__("Error message is: %s", 'sqlite-integration'), $err_data[2]); + $message = sprintf("Error occured while creating tables or indexes...
Query was: %s
", var_export($rewritten_query, true)); + $message .= sprintf("Error message is: %s", $err_data[2]); echo $message; return false; } diff --git a/sqlite-integration.php b/sqlite-integration.php index 6351896..ce7cb09 100644 --- a/sqlite-integration.php +++ b/sqlite-integration.php @@ -1,10 +1,10 @@ prefix.'commentmeta' => array( + 'comment_id' => '\'0\'', + 'meta_key' => 'NULL' + ), + $wpdb->prefix.'comments' => array( + 'comment_post_ID' => '\'0\'', + 'comment_author_email' => '\'\'', + 'comment_author_url' => '\'\'', + 'comment_author_IP' => '\'\'', + 'comment_date_gmt' => '\'0000-00-00 00:00:00\'', + 'comment_date' => '\'0000-00-00 00:00:00\'', + 'comment_karma' => '\'0\'', + 'comment_approved' => '\'1\'', + 'comment_agent' => '\'\'', + 'comment_type' => '\'\'', + 'comment_parent' => '\'0\'', + 'user_id' => '\'0\'' + ), + $wpdb->prefix.'links' => array( + 'link_url' => '\'\'', + 'link_name' => '\'\'', + 'link_image' => '\'\'', + 'link_target' => '\'\'', + 'link_description' => '\'\'', + 'link_visible' => '\'Y\'', + 'link_owner' => '\'1\'', + 'link_rating' => '\'0\'', + 'link_updated' => '\'0000-00-00 00:00:00\'', + 'link_rel' => '\'\'', + 'link_rss' => '\'\'' + ), + $wpdb->prefix.'options' => array( + 'option_name' => '\'\'', + 'autoload' => '\'yes\'' + ), + $wpdb->prefix.'postmeta' => array( + 'post_id' => '\'0\'', + 'meta_key' => 'NULL' + ), + $wpdb->prefix.'posts' => array( + 'post_author' => '\'0\'', + 'post_date_gmt' => '\'0000-00-00 00:00:00\'', + 'post_date' => '\'0000-00-00 00:00:00\'', + 'post_status' => '\'publish\'', + 'comment_status' => '\'open\'', + 'ping_status' => '\'open\'', + 'post_password' => '\'\'', + 'post_name' => '\'\'', + 'post_modified_gmt' => '\'0000-00-00 00:00:00\'', + 'post_modified' => '\'0000-00-00 00:00:00\'', + 'post_parent' => '\'0\'', + 'guid' => '\'\'', + 'menu_order' => '\'0\'', + 'post_type' => '\'post\'', + 'post_mime_type' => '\'\'', + 'comment_count' => '\'0\'' + ), + $wpdb->prefix.'term_relationships' => array( + 'term_order' => '0' + ), + $wpdb->prefix.'term_taxonomy' => array( + 'taxonomy' => '\'\'', + 'parent' => '0', + 'count' => '0' + ), + $wpdb->prefix.'terms' => array( + 'name' => '\'\'', + 'slug' => '\'\'', + 'term_group' => '0' + ), + $wpdb->prefix.'users' => array( + 'user_login' => '\'\'', + 'user_pass' => '\'\'', + 'user_nicename' => '\'\'', + 'user_email' => '\'\'', + 'user_url' => '\'\'', + 'user_registered' => '\'0000-00-00 00:00:00\'', + 'user_activation_key' => '\'\'', + 'user_status' => '\'0\'', + 'display_name' => '\'\'', + // for network install + 'spam' => '\'0\'', + 'deleted' => '\'0\'' + ), + $wpdb->prefix.'usermeta' => array( + 'user_id' => '\'0\'', + 'meta_key' => 'NULL', + ), + // for network install + $wpdb->prefix.'blog_versions' => array( + 'blog_id' => '\'0\'', + 'db_version' => '\'\'', + 'last_updated' => '\'0000-00-00 00:00:00\'' + ), + $wpdb->prefix.'blogs' => array( + 'site_id' => '\'0\'', + 'domain' => '\'\'', + 'path' => '\'\'', + 'registered' => '\'0000-00-00 00:00:00\'', + 'last_updated' => '\'0000-00-00 00:00:00\'', + 'public' => '\'1\'', + 'mature' => '\'0\'', + 'spam' => '\'0\'', + 'deleted' => '\'0\'', + 'lang_id' => '\'0\'' + ), + $wpdb->prefix.'registration_log' => array( + 'email' => '\'\'', + 'IP' => '\'\'', + 'blog_id' => '\'0\'', + 'date_registered' => '\'0000-00-00 00:00:00\'' + ), + $wpdb->prefix.'signups' => array( + 'domain' => '\'\'', + 'path' => '\'\'', + 'user_login' => '\'\'', + 'user_email' => '\'\'', + 'registered' => '\'0000-00-00 00:00:00\'', + 'activated' => '\'0000-00-00 00:00:00\'', + 'active' => '\'0\'', + 'activation_key' => '\'\'', + ), + $wpdb->prefix.'site' => array( + 'domain' => '\'\'', + 'path' => '\'\'' + ), + $wpdb->prefix.'sitemeta' => array( + 'site_id' => '\'0\'', + 'meta_key' => 'NULL', + ) + ); + $tables = $wpdb->tables('all'); + foreach ($tables as $table) { + $col_infos = $wpdb->get_results("SHOW COLUMNS FROM $table"); + foreach ($col_infos as $col) { + if (array_key_exists($col->Field, $columns_to_check[$table]) && $col->Default != $columns_to_check[$table][$col->Field]) { + $results_table[$table] = 'damaged'; + break; + } + } + } + if (empty($results_table)) { + return true; + } else { + return $results_table; + } + } + private function do_fix_database() { + global $wpdb, $wp_version, $utils; + $global_schema_to_change = array( + $wpdb->prefix.'commentmeta' => array( + "comment_id bigint(20) unsigned NOT NULL default '0'", + "meta_key varchar(255) default NULL", + "meta_value longtext" + ), + $wpdb->prefix.'comments' => array( + "comment_post_ID bigint(20) unsigned NOT NULL default '0'", + "comment_author_email varchar(100) NOT NULL default ''", + "comment_author_url varchar(200) NOT NULL default ''", + "comment_author_IP varchar(100) NOT NULL default ''", + "comment_date datetime NOT NULL default '0000-00-00 00:00:00'", + "comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00'", + "comment_karma int(11) NOT NULL default '0'", + "comment_approved varchar(20) NOT NULL default '1'", + "comment_agent varchar(255) NOT NULL default ''", + "comment_type varchar(20) NOT NULL default ''", + "comment_parent bigint(20) unsigned NOT NULL default '0'", + "user_id bigint(20) unsigned NOT NULL default '0'" + ), + $wpdb->prefix.'links' => array( + "link_url varchar(255) NOT NULL default ''", + "link_name varchar(255) NOT NULL default ''", + "link_image varchar(255) NOT NULL default ''", + "link_target varchar(25) NOT NULL default ''", + "link_description varchar(255) NOT NULL default ''", + "link_visible varchar(20) NOT NULL default 'Y'", + "link_owner bigint(20) unsigned NOT NULL default '1'", + "link_rating int(11) NOT NULL default '0'", + "link_updated datetime NOT NULL default '0000-00-00 00:00:00'", + "link_rel varchar(255) NOT NULL default ''", + "link_notes mediumtext NOT NULL", + "link_rss varchar(255) NOT NULL default ''" + ), + $wpdb->prefix.'options' => array( + "option_name varchar(64) NOT NULL default ''", + "option_value longtext NOT NULL", + "autoload varchar(20) NOT NULL default 'yes'" + ), + $wpdb->prefix.'postmeta' => array( + "post_id bigint(20) unsigned NOT NULL default '0'", + "meta_key varchar(255) default NULL", + "meta_value longtext" + ), + $wpdb->prefix.'posts' => array( + "post_author bigint(20) unsigned NOT NULL default '0'", + "post_date datetime NOT NULL default '0000-00-00 00:00:00'", + "post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00'", + "post_status varchar(20) NOT NULL default 'publish'", + "comment_status varchar(20) NOT NULL default 'open'", + "ping_status varchar(20) NOT NULL default 'open'", + "post_password varchar(20) NOT NULL default ''", + "post_name varchar(200) NOT NULL default ''", + "post_modified datetime NOT NULL default '0000-00-00 00:00:00'", + "post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00'", + "post_content_filtered longtext NOT NULL", + "post_parent bigint(20) unsigned NOT NULL default '0'", + "guid varchar(255) NOT NULL default ''", + "menu_order int(11) NOT NULL default '0'", + "post_type varchar(20) NOT NULL default 'post'", + "post_mime_type varchar(100) NOT NULL default ''", + "comment_count bigint(20) NOT NULL default '0'" + ), + $wpdb->prefix.'term_relationships' => array( + "term_order int(11) NOT NULL default 0" + ), + $wpdb->prefix.'term_taxonomy' => array( + "taxonomy varchar(32) NOT NULL default ''", + "description longtext NOT NULL", + "parent bigint(20) unsigned NOT NULL default 0", + "count bigint(20) NOT NULL default 0" + ), + $wpdb->prefix.'terms' => array( + "name varchar(200) NOT NULL default ''", + "slug varchar(200) NOT NULL default ''", + "term_group bigint(10) NOT NULL default 0" + ), + $wpdb->prefix.'users' => array( + "user_login varchar(60) NOT NULL default ''", + "user_pass varchar(64) NOT NULL default ''", + "user_nicename varchar(50) NOT NULL default ''", + "user_email varchar(100) NOT NULL default ''", + "user_url varchar(100) NOT NULL default ''", + "user_registered datetime NOT NULL default '0000-00-00 00:00:00'", + "user_activation_key varchar(60) NOT NULL default ''", + "user_status int(11) NOT NULL default '0'", + "display_name varchar(250) NOT NULL default ''" + ), + $wpdb->prefix.'usermeta' => array( + "user_id bigint(20) unsigned NOT NULL default '0'", + "meta_key varchar(255) default NULL", + "meta_value longtext" + ) + ); + + $network_schema_to_change = array( + $wpdb->prefix.'blog_versions' => array( + "blog_id bigint(20) NOT NULL default '0'", + "db_version varchar(20) NOT NULL default ''", + "last_updated datetime NOT NULL default '0000-00-00 00:00:00'" + ), + $wpdb->prefix.'blogs' => array( + "site_id bigint(20) NOT NULL default '0'", + "domain varchar(200) NOT NULL default ''", + "path varchar(100) NOT NULL default ''", + "registered datetime NOT NULL default '0000-00-00 00:00:00'", + "last_updated datetime NOT NULL default '0000-00-00 00:00:00'", + "public tinyint(2) NOT NULL default '1'", + "mature tinyint(2) NOT NULL default '0'", + "spam tinyint(2) NOT NULL default '0'", + "deleted tinyint(2) NOT NULL default '0'", + "lang_id int(11) NOT NULL default '0'" + ), + $wpdb->prefix.'registration_log' => array( + "email varchar(255) NOT NULL default ''", + "IP varchar(30) NOT NULL default ''", + "blog_id bigint(20) NOT NULL default '0'", + "date_registered datetime NOT NULL default '0000-00-00 00:00:00'" + ), + $wpdb->prefix.'signups' => array( + "domain varchar(200) NOT NULL default ''", + "path varchar(100) NOT NULL default ''", + "title longtext NOT NULL", + "user_login varchar(60) NOT NULL default ''", + "user_email varchar(100) NOT NULL default ''", + "registered datetime NOT NULL default '0000-00-00 00:00:00'", + "activated datetime NOT NULL default '0000-00-00 00:00:00'", + "active tinyint(1) NOT NULL default '0'", + "activation_key varchar(50) NOT NULL default ''", + "meta longtext" + ), + $wpdb->prefix.'site' => array( + "domain varchar(200) NOT NULL default ''", + "path varchar(100) NOT NULL default ''" + ), + $wpdb->prefix.'sitemeta' => array( + "site_id bigint(20) NOT NULL default '0'", + "meta_key varchar(255) default NULL", + "meta_value longtext" + ), + $wpdb->prefix.'users' => array( + "user_login varchar(60) NOT NULL default ''", + "spam tinyint(2) NOT NULL default '0'", + "deleted tinyint(2) NOT NULL default '0'" + ) + ); + if (version_compare($wp_version, '3.6', '<')) return false; + $return_val = array(); + $queries = array(); + $results = $this->sanity_check(); + if ($results !== true) { + if (!$this->maintenance_backup()) { + $message = __('Can\'t create backup file.', $domain); + return $message; + } + $tables = array_keys($results); + foreach ($tables as $table) { + if (key_exists($table, $global_schema_to_change)) { + $queries = $global_schema_to_change[$table]; + } + if (key_exists($table, $network_schema_to_change)) { + if (!empty($queries)) { + $queries = array_merge($queries, $network_schema_to_change[$table]); + } else { + $queries = $network_schema_to_change[$table]; + } + } + foreach ($queries as $query) { + $sql = 'ALTER TABLE' . ' ' . $table . ' ' . 'CHANGE COLUMN' . ' ' . $query; + $res = $wpdb->query($sql); + if ($res === false) { + $return_val[] = __('Failed: ', $domain) . $query; + } + } + } + } else { + $message = __('Your database is OK. You don\'t have to restore it.', $domain); + return $message; + } + if (empty($return_val)) { + $message = __('Your database restoration is successfully finished!', $domain); + return $message; + } else { + return $return_val; + } + } + + private function show_columns() { + global $wpdb, $utils; + $domain = $utils->text_domain; + $tables = $wpdb->tables('all'); + if (!isset($_POST['table'])) { + $message = __('Table name is not selected.', $domain); + return $message; + } elseif (!in_array($_POST['table'], $tables)) { + $message = __('There\'s no such table.', $domain); + return $message; + } else { + $table_name = $_POST['table']; + $results = $wpdb->get_results("SHOW COLUMNS FROM $table_name"); + return $results; + } + } + + private function maintenance_backup() { + $result = array(); + $database_file = FQDB; + $db_name = basename(FQDB); + if (!file_exists($database_file)) { + return false; + } + $today = date("Ymd-His"); + if (!extension_loaded('zip')) { + $backup_file = $database_file . '.' . $today . '.maintenance-backup'; + if (copy($database_file, $backup_file)) { + $result = true; + } else { + $result = false; + } + } else { + $backup_file = $database_file . '.' . $today . '.maintenance-backup.zip'; + $zip = new ZipArchive(); + $res = $zip->open($backup_file, ZipArchive::CREATE | ZipArchive::OVERWRITE); + if ($res === true) { + $zip->addFile($database_file, $db_name); + $result = true; + } else { + $result = false; + } + $zip->close(); + } + return $result; + } + + function show_maintenance_page() { + global $utils, $wpdb; + $domain = $utils->text_domain; + if (is_multisite() && !current_user_can('manage_network_options')) { + die(__('You are not allowed to access this page!', $domain)); + } elseif (!current_user_can('manage_options')) { + die(__('You are not allowed to access this page!', $domain)); + } + if (isset($_GET['page']) && $_GET['page'] == 'maintenance') : ?> + +
+

+

+

+ + +

+

+ +

+

+ +

+

+ +

+ +
+ + + +
+ + +

+

+ +

+ tables('all'); + ?> +
+ + + + +
+ + +
+ do_fix_database(); + if (is_array($fix_results)) { + $title = '

'. __('Results', $domain) . '

'; + echo '
'; + echo $title; + echo '
    '; + foreach ($fix_results as $result) { + echo '
  • ' . $result . '
  • '; + } + echo '
'; + echo '
'; + } else { + $title = '

'. __('Results', $domain) . '

'; + echo '
'; + echo $title; + echo '

'.$fix_results.'

'; + echo '
'; + } + } + if (isset($_POST['sanity-check'])) { + check_admin_referer('sqliteintegration-database-manip-stats'); + if (is_multisite() && !current_user_can('manage_network_options')) { + die(__('You are not allowed to do this operation!', $domain)); + } elseif (!current_user_can('manage_options')) { + die(__('You are not allowed to do this operation!', $domain)); + } + $check_results = $this->sanity_check(); + if ($check_results !== true) { + $title = '

'. __('Checked Results', $domain) . '

'; + echo '
'; + echo $title; + echo '
    '; + foreach ($check_results as $table => $damaged) { + $message = __(' needs restoring.', $domain); + echo '
  • ' . $table . '' . $message . '
  • '; + } + echo '
'; + echo '
'; + } else { + $title = '

'. __('Checked Results', $domain) . '

'; + $message = __('Your database is OK. You don\'t have to restore it.', $domain); + echo '
'; + echo $title; + echo '

'.$message.'

'; + echo '
'; + } + } + if (isset($_POST['show-columns'])) { + check_admin_referer('sqliteintegration-database-manip-stats'); + if (is_multisite() && !current_user_can('manage_network_options')) { + die(__('You are not allowed to do this operation!', $domain)); + } elseif (!current_user_can('manage_options')) { + die(__('You are not allowed to do this operation!', $domain)); + } + $results = $this->show_columns(); + if (is_array($results)) { + $title = '

'. sprintf(__('Columns In %s', $domain), $_POST['table']) . '

'; + $column_header = __('Column', $domain); + $type_header = __('Type', $domain); + $null_header = __('Null', $domain); + $default_header = __('Default', $domain); + echo '
'; + echo $title; + echo ''; + echo ''; + $counter = 0; + foreach ($results as $column) { + echo (($counter % 2) == 1) ? '' : ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + $counter++; + } + echo '
'. $column_header . ''. $type_header . '' . $null_header . '' . $default_header . '
' . $column->Field . '' . $column->Type . '' . $column->Null . '' . $column->Default . '
'; + } else { + $title = '

'. __('Columns Info', $domain) . '

'; + echo '
'; + echo $title; + echo '

' . $results; + echo '

'; + } + } + } +} +?> \ No newline at end of file diff --git a/utilities/documentation.php b/utilities/documentation.php index 8fe9f7b..0454d84 100644 --- a/utilities/documentation.php +++ b/utilities/documentation.php @@ -1,8 +1,7 @@ +
@@ -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.5.1 and 3.6 beta).', $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); ?> @@ -86,7 +86,7 @@ class SQLiteIntegrationDocument {

-
    + diff --git a/utilities/patch.php b/utilities/patch.php index d359289..4b8e2f7 100644 --- a/utilities/patch.php +++ b/utilities/patch.php @@ -3,7 +3,7 @@ * This file contains PatchUtils class * * @package SQLite Integration - * @since 1.1 + * @author Kojima Toshiyasu * */ class PatchUtils { @@ -34,6 +34,8 @@ class PatchUtils { * @return boolean|array */ private function apply_patches() { + global $utils; + $domain = $utils->text_domain; $installed_plugins = array(); $file_names = array(); $output = array(); @@ -103,6 +105,8 @@ class PatchUtils { * @return boolean|array */ private function delete_patch_files() { + global $utils; + $domain = $utils->text_domain; $file_names = array(); $rm_results = array(); if (isset($_POST['plugin_checked'])) { @@ -110,18 +114,16 @@ class PatchUtils { } else { return false; } - $command = 'rm -f'; - foreach ($file_names as $file) { - if (chdir(SQLitePatchDir)) { - exec("$command $file", $output, $retval); - } else { - $rm_results[$file] = __('Error!: patches directory is not accessible.', $domain); - } - if ($retval > 0) { - $rm_results[$file] = sprintf(__('Error! Messages: %s', $domain), $output); - } else { - $rm_results[$file] = sprintf(__('File %s is deleted.', $domain), $file); - } + if (chdir(SQLitePatchDir)) { + foreach ($file_names as $file) { + if (unlink($file)) { + $rm_results[$file] = sprintf(__('File %s is deleted.', $domain), $file); + } else { + $rm_results[$file] = sprintf(__('Error! File %s is not deleted.', $domain), $file); + } + } + } else { + $rm_results[$file] = __('Error!: patches directory is not accessible.', $domain); } return $rm_results; } @@ -130,6 +132,8 @@ class PatchUtils { * No return values. */ private function upload_file() { + global $utils; + $domain = $utils->text_domain; if (!file_exists(SQLitePatchDir) || !is_dir(SQLitePatchDir)) { mkdir(SQLitePatchDir, 0705, true); } @@ -198,7 +202,7 @@ class PatchUtils { } echo '
'; } else { - $message = __('Error! Please remove files manually'); + $message = __('Error! Please remove files manually', $domain); echo '
'.$message.'
'; } } @@ -218,6 +222,7 @@ class PatchUtils { +
diff --git a/utilities/plugin_lists.json b/utilities/plugin_lists.json index 5055e89..39240a5 100644 --- a/utilities/plugin_lists.json +++ b/utilities/plugin_lists.json @@ -22,7 +22,14 @@ "compat":"Checked", "class":"compatible" }, - + + { + "name":"Better Delete Revision", + "compat":"No", + "reason":"DELETE with JOIN/etc", + "class":"incompatible" + }, + { "name":"Better Related Posts", "compat":"No", @@ -111,6 +118,14 @@ "class":"compatible" }, + { + "name":"FeedWordPress", + "compat":"Needs patch", + "patch_url":"http://dogwood.skr.jp/wordpress/plugins/", + "reason":"MySQL specific function", + "class":"workaround" + }, + { "name":"Google Analyticator", "compat":"Checked", @@ -162,6 +177,34 @@ "class":"compatible" }, + { + "name":"Mathjax Latex", + "compat":"Checked", + "class":"compatible" + }, + + { + "name":"MP6", + "compat":"Checked", + "class":"compatible" + }, + + { + "name":"NewStatPress", + "compat":"Needs Patch", + "patch_url":"http://dogwood.skr.jp/wordpress/plugins/", + "reason":"MySQL specific data", + "class":"workaround" + }, + + { + "name":"NextGEN Gallery", + "compat":"Needs patch", + "patch_url":"http://dogwood.skr.jp/wordpress/plugins/", + "reason":"MySQL specific function", + "class":"workaround" + }, + { "name":"Optimize Database after Deleting Revisions", "compat":"Probably No", @@ -175,6 +218,12 @@ "class":"compatible" }, + { + "name":"Redirection", + "compat":"Checked", + "class":"compatible" + }, + { "name":"Related Posts", "compat":"Checked", @@ -237,12 +286,20 @@ { "name":"Wordpress Popular Posts", + "compat":"Needs Patch", + "patch_url":"http://dogwood.skr.jp/wordpress/plugins/", + "reason":"MySQL specific query", + "class":"workaround" + }, + + { + "name":"WordPress Related Posts", "compat":"Checked", "class":"compatible" }, { - "name":"WordPress Related Posts", + "name":"WP Emmet", "compat":"Checked", "class":"compatible" }, @@ -264,7 +321,13 @@ "compat":"Checked", "class":"compatible" }, - + + { + "name":"WP-PostViews", + "compat":"Checked", + "class":"compatible" + }, + { "name":"WP-reCAPTCHA", "compat":"Checked", diff --git a/utilities/utility.php b/utilities/utility.php index a122b2d..f2b8295 100644 --- a/utilities/utility.php +++ b/utilities/utility.php @@ -2,7 +2,7 @@ /** * * @package SQLite Integration - * @author kjm + * @author Kojima Toshiyasu * */ class SQLiteIntegrationUtils { @@ -198,7 +198,7 @@ class SQLiteIntegrationUtils { $db_file = FQDB; if (file_exists($db_file)) { $size = filesize($db_file); - clearstatcache(false, $db_file); + clearstatcache(true, $db_file); return $this->convert_to_formatted_number($size); } } @@ -329,6 +329,79 @@ class SQLiteIntegrationUtils { } } + /** + * function to parse FQDBDIR and return backup database files + */ + private function get_backup_files() { + $db_name = basename(FQDB); + $names_to_exclude = array('.', '..', '.htaccess', 'debug.txt', '.ht.sqlite', $db_name); + $backup_files = array(); + if (is_dir(FQDBDIR)) { + if ($dir_handle = opendir(FQDBDIR)) { + while (($file_name = readdir($dir_handle)) !== false) { + if (in_array($file_name, $names_to_exclude)) continue; + $backup_files[] = $file_name; + } + } + } + return $backup_files; + } + + /** + * function to create backup file + */ + private function backup_db() { + $result = array(); + $database_file = FQDB; + $db_name = basename(FQDB); + if (!file_exists($database_file)) { + return false; + } + $today = date("Ymd"); + if (!extension_loaded('zip')) { + $backup_file = $database_file . '.' . $today . '.back'; + if (copy($database_file, $backup_file)) { + $result['success'] = basename($backup_file) . __(' was created.', $domain); + } else { + $result['error'] = basename($backup_file) . __(' was not created.', $domain); + } + } else { + $backup_file = $database_file . '.' . $today . '.zip'; + $zip = new ZipArchive(); + $res = $zip->open($backup_file, ZipArchive::CREATE | ZipArchive::OVERWRITE); + if ($res === true) { + $zip->addFile($database_file, $db_name); + $result['success'] = basename($backup_file) . __(' was created.', $domain); + } else { + $result['error'] = basename($backup_file) . __(' was not created.', $domain); + } + $zip->close(); + } + return $result; + } + + private function delete_backup_db() { + global $utils; + $domain = $utils->text_domain; + $file_names = array(); + $results = array(); + if (isset($_POST['backup_checked'])) { + $file_names = $_POST['backup_checked']; + } else { + return false; + } + if (chdir(FQDBDIR)) { + foreach ($file_names as $file) { + if (unlink($file)) { + $results[$file] = sprintf(__('File %s was deleted.', $domain), $file); + } else { + $results[$file] = sprintf(__('Error! File was not deleted.', $domain), $file); + } + } + } + return $results; + } + function welcome() { $domain = $this->text_domain; if (isset($_GET['page']) && $_GET['page'] == 'sqlite-integration') :?> @@ -366,6 +439,10 @@ class SQLiteIntegrationUtils { + + + +
@@ -390,6 +467,7 @@ class SQLiteIntegrationUtils { +
@@ -608,6 +686,35 @@ class SQLiteIntegrationUtils { echo '
'.$messages.'
'; } } + if (isset($_POST['backup_db'])) { + check_admin_referer('sqliteintegration-backup-manip-stats'); + $results = $this->backup_db(); + if ($results === false) { + $message = __('Couldn\'t find your database file.'); + echo '
'.$message.'
'; + } elseif (is_array($results) && array_key_exists('success', $results)) { + echo '
'.$results['success'].'
'; + } else { + echo '
'.$results['error'].'
'; + } + } + if (isset($_POST['delete_backup_files'])) { + check_admin_referer('sqliteintegration-backup-manip-stats'); + $results = $this->delete_backup_db(); + if ($results === false) { + $message = __('Please select backup file(s).', $domain); + echo '
'.$message.'
'; + } elseif (is_array($results) && count($results) > 0) { + echo '
'; + foreach ($results as $key => $val) { + echo $val.'
'; + } + echo '
'; + } else { + $message = __('Error! Please remove file(s) manyally.', $domain); + echo '
'.$message.'
'; + } + } if (isset($_GET['page']) && $_GET['page'] == 'setting-file') :?>
@@ -632,7 +740,43 @@ class SQLiteIntegrationUtils {

-

+

+

+ +

+

+ +

+ get_backup_files();?> +
+ + + + + + + + + + + + + + + + + + +
+

+ + +

+
+

@@ -641,7 +785,7 @@ class SQLiteIntegrationUtils { wp_nonce_field('sqlitewordpress-log-reset-stats'); } ?> -