Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
cda9b54f67 | |
|
c59c06db38 |
1
db.php
1
db.php
|
@ -5,7 +5,6 @@
|
|||
* wordpress/wp-content/db.php
|
||||
*
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*
|
||||
*/
|
||||
|
|
Binary file not shown.
|
@ -211,12 +211,12 @@ msgid ""
|
|||
"SQLite for its database. But PDO for WordPress doesn't seem to be maintained "
|
||||
"any more only to be outdated. SQLite Integration makes use of the basic ideas "
|
||||
"and framework of PDO for WordPress, adds some new features and updates it to "
|
||||
"be able to work with the newest version of WordPress(3.5.1 and 3.6 beta)."
|
||||
"be able to work with the newest version of WordPress(3.6)."
|
||||
msgstr ""
|
||||
"このプラグインは<a href=\"http://wordpress.org/extend/plugins/pdo-for-wordpress/\">"
|
||||
"PDO for WordPress</a>の後継です。PDO for WordPressはWordPressでSQLiteを使えるようにする"
|
||||
"ものでしたが、もうメンテナンスされていないようで、古くなってしまいました。SQLite Integrationは、その基本的な"
|
||||
"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(3.5.1および3.6ベータ)で動作するように"
|
||||
"考えと枠組みを使って、新たな機能を追加し、最新のWordPress(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."
|
||||
|
|
|
@ -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.6)."
|
||||
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
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*/
|
||||
|
||||
|
@ -54,12 +53,14 @@ class PDOSQLiteDriver {
|
|||
$this->_delete_index_hints();
|
||||
$this->_rewrite_regexp();
|
||||
$this->_rewrite_boolean();
|
||||
$this->_fix_date_quoting();
|
||||
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();
|
||||
|
@ -290,20 +291,23 @@ class PDOSQLiteDriver {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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(){
|
||||
|
@ -408,7 +412,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) {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* The class for manipulating ALTER query
|
||||
* newly supports multiple variants
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu
|
||||
*/
|
||||
class AlterQuery {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*/
|
||||
|
||||
|
|
|
@ -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.6
|
||||
Stable tag: 1.2
|
||||
License: GPLv2
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
|
@ -160,16 +160,24 @@ wp-config.phpの準備が終わったら、次のステップに進みます。
|
|||
|
||||
たぶん、もっとあるでしょう。
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.1 (2013-07-24) =
|
||||
* DROP INDEX 単独のクエリが動作していなかったのを修正しました。
|
||||
* shutdown_hook で descructor を実行していたのをやめました。
|
||||
* LOCATE() 関数を使えるようにしました。
|
||||
|
||||
= 1.0 (2013-07-07) =
|
||||
最初のリリース。
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
SQLite Integrationのアップグレードに失敗するようなら、FTPを使っての手動アップグレードを試してみてください。
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 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) =
|
||||
* 最初のリリース。
|
||||
|
|
23
readme.txt
23
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.6
|
||||
Stable tag: 1.2
|
||||
License: GPLv2
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
|
@ -152,16 +152,23 @@ These are other examples:
|
|||
|
||||
Probably there are more, I'm afraid.
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
When auto upgrading of SQLite Integration fails, please try manual upgrade via FTP.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 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 desctructor() from shutdown_hook.
|
||||
* Removed destruct() from shutdown_hook.
|
||||
* Enabled LOCATE() function in the query string.
|
||||
|
||||
= 1.0 (2013-07-07) =
|
||||
First release version of the plugin.
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
When auto upgrading of SQLite Integration fails, Please try manual upgrade via FTP.
|
||||
* First release version of the plugin.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Kojima Toshiyasu, Justin Adie
|
||||
*/
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Plugin Name: SQLite Integration
|
|||
Plugin URI: http://wordpress.org/extend/plugins/sqlite-integration
|
||||
Description: SQLite Integration is the plugin that enables WordPress to use SQLite. If you don't have MySQL and want to build a WordPress website, it's for you.
|
||||
Author: Kojima Toshiyasu
|
||||
Version: 1.1
|
||||
Version: 1.2
|
||||
Author URI: http://dogwood.skr.jp
|
||||
Text Domain: sqlite-integration
|
||||
Domain Path: /languages
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @package SQLite Integration
|
||||
* @version 1.1
|
||||
* @author Toshiyasu Kojima
|
||||
* @author Kojima Toshiyasu
|
||||
*
|
||||
*/
|
||||
/**
|
||||
|
@ -38,7 +37,7 @@ class SQLiteIntegrationDocument {
|
|||
|
||||
<h3><?php _e('Features', $domain);?></h3>
|
||||
<p>
|
||||
<?php _e('This plugin is a successor to <a href="http://wordpress.org/extend/plugins/pdo-for-wordpress/">PDO for WordPress</a>, 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); ?>
|
||||
<?php _e('This plugin is a successor to <a href="http://wordpress.org/extend/plugins/pdo-for-wordpress/">PDO for WordPress</a>, which enabled WordPress to use SQLite for its database. But PDO for WordPress doesn\'t seem to be maintained any more only to be outdated. SQLite Integration makes use of the basic ideas and framework of PDO for WordPress, adds some new features and updates it to be able to work with the newest version of WordPress(3.6).', $domain); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php _e('<a href="http://www.sqlite.org/">SQLite Web Page</a> 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); ?>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -111,6 +111,12 @@
|
|||
"class":"compatible"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"FeedWordPress",
|
||||
"compat":"Checked",
|
||||
"class":"compatible"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Google Analyticator",
|
||||
"compat":"Checked",
|
||||
|
@ -247,6 +253,12 @@
|
|||
"class":"compatible"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"WP Emmet",
|
||||
"compat":"Checked",
|
||||
"class":"compatible"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"WP Multibyte Patch",
|
||||
"compat":"Checked",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
*
|
||||
* @package SQLite Integration
|
||||
* @author kjm
|
||||
* @author Kojima Toshiyasu
|
||||
*
|
||||
*/
|
||||
class SQLiteIntegrationUtils {
|
||||
|
|
Loading…
Reference in New Issue