From 6b66c23718760e739af1a807755f77e3e0f18158 Mon Sep 17 00:00:00 2001 From: kjmtsh Date: Tue, 30 Jul 2013 03:18:31 +0000 Subject: [PATCH] fixed the patch utility for Windows and the manipulation of 'ON DUPLICATE KEY UPDATE' query. git-svn-id: https://plugins.svn.wordpress.org/sqlite-integration/trunk@748127 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- db.php | 1 - functions-5-2.php | 1 - functions.php | 1 - install.php | 1 - languages/sqlite-integration-ja.mo | Bin 43052 -> 43234 bytes languages/sqlite-integration-ja.po | 8 ++++---- languages/sqlite-integration.pot | 4 ++-- pdodb.class.php | 1 - pdoengine.class.php | 1 - query.class.php | 1 - query_alter.class.php | 1 - query_create.class.php | 1 - readme-ja.txt | 25 +++++++++++++++--------- readme.txt | 18 +++++++++++------ schema.php | 1 - utilities/documentation.php | 5 ++--- utilities/patch.php | 30 ++++++++++++++++------------- utilities/utility.php | 2 +- 18 files changed, 54 insertions(+), 48 deletions(-) diff --git a/db.php b/db.php index 3724300..d2d92a5 100644 --- a/db.php +++ b/db.php @@ -5,7 +5,6 @@ * wordpress/wp-content/db.php * * @package SQLite Integration - * @version 1.1 * @author Kojima Toshiyasu, Justin Adie * */ diff --git a/functions-5-2.php b/functions-5-2.php index 6867473..62a8be3 100644 --- a/functions-5-2.php +++ b/functions-5-2.php @@ -1,7 +1,6 @@ FmYAq*HM5wIqzem$Mo|bcl}mZKgkvPgvBwfTV+h~mA#6K_vW4nqpU^zx(q`&#%$!MdVgY9u6dg6A} z3)Es~eAlW^pmyj2cEFn$fp@Skwh7Sp+eP}*2;xLM+HfM$7g>s)jC?EVNNTzn529Y^ zDE7khs2BJbGB|mF$=EhfBnHzl1RdBD>#+}B!ceX+4{1Dy-t^)rj7R;#6l8W~JZc9D zP%p61vI4!S>u>=bJ%X=L_XsvKHx+eBx1nD6LuB>jCTa)np`BS4Z@M=CBQTjS%EC`YeUm z2{)n6C&DVrvz9|~5OublhOTL~=H3)Vrnub%2LaJ8H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 zd7nmgq!J&&I&8;M-@(Ngx?J}^Q@w75>-o)lt*#^F_64le-DmRsFQSB_$Ocdf6T!tg@100O8Oq)8Kj}!0})TX?L zx?t?f?l$e==^IO>oHrI=Q%3%G)CK;v+iU~WiDG-_8LLsrYe_qrL`ig|SSP1Nz$ z`&@^ra4qdWqdGEUKR8FwtzfEw2TjtjpP@)|JPCZ8Byu$@c(+Pq(01R z>w+q0$aq5MjV1N}Sq=VD&+B5MTezkF$p2qXd)3PrLv(kjG~@dI(LU&JvSBctu%G

HJYW(g8qbYV)gK~--CEA#+ zNMmV7WjPt$c)&B>a}u5<>|OuQtd=2>B#>&NqD}fdX+oyz`u(YlB`UE*o2X6=%5c(} zl#-LAlI$Z_h{}HQsK4f3^1ONxZYM#6zhV4kD6a!u)xU4@sZVp`cmIpgdu>T1(Z+e3 zv?tTaT5^PNm-@>aymlqrB>tj1LuDCB@z>nT9C(uylSO0(xk!2vf6@H!BD$AV3P_ef&$Jvd7{7OF54EA=1J-_8#h)(vR@G@;_0*p3@6u9`VifSNT&2 zUnkv2HhGvFBcbE~QAfLzEK);M-XT9BOUZGfGK++eWbyzhBhf@<9JxSNkq)Fnr%j`x zGJxzQlhvTSOUlXnYIx;UyhQqtE@U%#jD(SeWCLj|FH+e;dXpsY;1JI$&m47gJ&g%u z6FEo%Nd^fg=gDefwW$$#!J%2jWo1)Kip$dDJCxP#i#?DW(6csU@YSH&z9S|?y;NF| VTKjRq{5~Aa+;J(mHnX}a_" "PDO for WordPressの後継です。PDO for WordPressはWordPressでSQLiteを使えるようにする" "ものでしたが、もうメンテナンスされていないようで、古くなってしまいました。SQLite Integrationは、その基本的な" -"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.5.1および3.6ベータ)で動作するように" +"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.5.2および3.6ベータ)で動作するように" "したものです。" #: utilities/documentation.php:44 @@ -589,8 +589,8 @@ msgstr "パッチを適用しました。" #: utilities/patch.php:94 utilities/patch.php:121 #, php-format -msgid "Error! Messages: %s" -msgstr "エラー。メッセージは: %s" +msgid "Error! File %s is not deleted." +msgstr "エラー。ファイル%sは削除できませんでした。" #: utilities/patch.php:118 msgid "Error!: patches directory is not accessible." diff --git a/languages/sqlite-integration.pot b/languages/sqlite-integration.pot index c736014..6f6c3bb 100644 --- a/languages/sqlite-integration.pot +++ b/languages/sqlite-integration.pot @@ -195,7 +195,7 @@ msgid "" "SQLite for its database. But PDO for WordPress doesn't seem to be maintained " "any more only to be outdated. SQLite Integration makes use of the basic ideas " "and framework of PDO for WordPress, adds some new features and updates it to " -"be able to work with the newest version of WordPress(3.5.1 and 3.6 beta)." +"be able to work with the newest version of WordPress(3.5.2 and 3.6 beta)." msgstr "" #: utilities/documentation.php:44 @@ -505,7 +505,7 @@ msgstr "" #: utilities/patch.php:94 utilities/patch.php:121 #, php-format -msgid "Error! Messages: %s" +msgid "Error! File %s is not deleted." msgstr "" #: utilities/patch.php:118 diff --git a/pdodb.class.php b/pdodb.class.php index 7f0816f..3f342b9 100644 --- a/pdodb.class.php +++ b/pdodb.class.php @@ -1,7 +1,6 @@

- 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.5.2 and 3.6 beta).', $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); ?> diff --git a/utilities/patch.php b/utilities/patch.php index d359289..40c2159 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); } diff --git a/utilities/utility.php b/utilities/utility.php index a122b2d..14ed133 100644 --- a/utilities/utility.php +++ b/utilities/utility.php @@ -2,7 +2,7 @@ /** * * @package SQLite Integration - * @author kjm + * @author Kojima Toshiyasu * */ class SQLiteIntegrationUtils {