[P2-php-svn] [795] expack:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 20日 (水) 06:54:56 JST


Revision: 795
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=795
Author:   rsk
Date:     2010-01-20 06:54:56 +0900 (Wed, 20 Jan 2010)

Log Message:
-----------
expack:
- rev.100120.0700.
- 書き込みデータ(板ごとの設定と書き込みバックアップ)の保存形式を変更。

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/conf/setup_info.php
    p2ex/trunk/lib/P2DataStore/PostDataStore.php

Added Paths:
-----------
    p2ex/trunk/lib/migrators/100120_0700.php

Removed Paths:
-------------
    p2ex/trunk/lib/migrators/100117_0000.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-01-18 20:23:38 UTC (rev 794)
+++ p2ex/trunk/conf/conf.inc.php	2010-01-19 21:54:56 UTC (rev 795)
@@ -7,7 +7,7 @@
 // ƒo[ƒWƒ‡ƒ“î•ñ
 $_conf = array(
     'p2version' => '1.7.29+1.8.x',  // rep2‚̃o[ƒWƒ‡ƒ“
-    'p2expack'  => '100117.0000',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
+    'p2expack'  => '100120.0700',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
     'p2name'    => 'expack',        // rep2‚Ì–¼‘O
 );
 

Modified: p2ex/trunk/conf/setup_info.php
===================================================================
--- p2ex/trunk/conf/setup_info.php	2010-01-18 20:23:38 UTC (rev 794)
+++ p2ex/trunk/conf/setup_info.php	2010-01-19 21:54:56 UTC (rev 795)
@@ -39,7 +39,7 @@
 // ’l‚Í "yymmdd.hhmm" Œ`Ž®‚цƒj[ƒN‚©‚¸‡‚Ƀ\[ƒg‚³‚ê‚Ä‚¢‚È‚¯‚ê‚΂Ȃç‚È‚¢
 $p2_changed_versions = array(
     '100113.1300',
-    '100117.0000',
+    '100120.0700',
 );
 
 /*

Modified: p2ex/trunk/lib/P2DataStore/PostDataStore.php
===================================================================
--- p2ex/trunk/lib/P2DataStore/PostDataStore.php	2010-01-18 20:23:38 UTC (rev 794)
+++ p2ex/trunk/lib/P2DataStore/PostDataStore.php	2010-01-19 21:54:56 UTC (rev 795)
@@ -17,7 +17,8 @@
      */
     static public function getKVS()
     {
-        return self::_getKVS($GLOBALS['_conf']['post_db_path']);
+        return self::_getKVS($GLOBALS['_conf']['post_db_path'],
+                             P2KeyValueStore::CODEC_ARRAYSHIFTJIS);
     }
 
     // }}}

Deleted: p2ex/trunk/lib/migrators/100117_0000.php
===================================================================
--- p2ex/trunk/lib/migrators/100117_0000.php	2010-01-18 20:23:38 UTC (rev 794)
+++ p2ex/trunk/lib/migrators/100117_0000.php	2010-01-19 21:54:56 UTC (rev 795)
@@ -1,66 +0,0 @@
-<?php
-/**
- * rep2expack - ƒo[ƒWƒ‡ƒ“ƒAƒbƒvŽž‚̈ڍsŽx‰‡
- */
-
-// {{{ p2_migrate_100117_0000()
-
-/**
- * •s—v‚É‚È‚Á‚½V’…‚܂Ƃߓǂ݃LƒƒƒbƒVƒ…ƒtƒ@ƒCƒ‹‚ðíœ‚·‚é
- *
- * @param array $core_config rep2ƒRƒA‚̐ݒè
- * @param array $user_config ŒÃ‚¢ƒ†[ƒU[Ý’è
- * @return array V‚µ‚¢ƒ†[ƒU[Ý’è
- */
-function p2_migrate_100117_0000(array $core_config, array $user_config)
-{
-    $pref_dir = $core_config['pref_dir'];
-
-    if (is_dir($pref_dir)) {
-        $current_dir = getcwd();
-        if ($current_dir === false) {
-            $current_dir = P2_BASE_DIR;
-        }
-        if (chdir($pref_dir)) {
-            _100117_0000_glob_unlink('./matome_cache.htm');
-            _100117_0000_glob_unlink('./matome_cache.*.htm');
-            _100117_0000_glob_unlink('./matome_cache.*.lck');
-            chdir($current_dir);
-        }
-    }
-
-    return $user_config;
-}
-
-// }}}
-// {{{ _100117_0000_glob_unlink()
-
-/**
- * glob()‚ÅŒ©‚‚©‚Á‚½ƒtƒ@ƒCƒ‹‚ðíœ‚·‚é
- *
- * @param string $pattern
- * @return void
- */
-function _100117_0000_glob_unlink($pattern)
-{
-    if ($files = glob($pattern, GLOB_NOSORT)) {
-        foreach ($files as $file) {
-            if (is_file($file)) {
-                unlink($file);
-            }
-        }
-    }
-}
-
-// }}}
-
-/*
- * Local Variables:
- * mode: php
- * coding: cp932
- * tab-width: 4
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
-// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:

Copied: p2ex/trunk/lib/migrators/100120_0700.php (from rev 794, p2ex/trunk/lib/migrators/100117_0000.php)
===================================================================
--- p2ex/trunk/lib/migrators/100120_0700.php	                        (rev 0)
+++ p2ex/trunk/lib/migrators/100120_0700.php	2010-01-19 21:54:56 UTC (rev 795)
@@ -0,0 +1,108 @@
+<?php
+/**
+ * rep2expack - ƒo[ƒWƒ‡ƒ“ƒAƒbƒvŽž‚̈ڍsŽx‰‡
+ */
+
+// {{{ p2_migrate_100120_0700()
+
+/**
+ * •s—v‚É‚È‚Á‚½V’…‚܂Ƃߓǂ݃LƒƒƒbƒVƒ…ƒtƒ@ƒCƒ‹‚ðíœ‚µA
+ * ‘‚«ž‚݃f[ƒ^‚Ì•Û‘¶Œ`Ž®‚ð•ÏX‚·‚éB
+ *
+ * @param array $core_config rep2ƒRƒA‚̐ݒè
+ * @param array $user_config ŒÃ‚¢ƒ†[ƒU[Ý’è
+ * @return array V‚µ‚¢ƒ†[ƒU[Ý’è
+ */
+function p2_migrate_100120_0700(array $core_config, array $user_config)
+{
+    _100120_0700_unlink_matome_caches($core_config['pref_dir']);
+    _100120_0700_convert_post_data_store($core_config['post_db_path']);
+
+    return $user_config;
+}
+
+// }}}
+// {{{ _100120_0700_unlink_matome_caches()
+
+/**
+ * •s—v‚É‚È‚Á‚½V’…‚܂Ƃߓǂ݃LƒƒƒbƒVƒ…ƒtƒ@ƒCƒ‹‚ðíœ‚·‚é
+ *
+ * @param string $pattern
+ * @return void
+ */
+function _100120_0700_unlink_matome_caches($pref_dir)
+{
+    if (is_dir($pref_dir)) {
+        $current_dir = getcwd();
+        if ($current_dir === false) {
+            $current_dir = P2_BASE_DIR;
+        }
+        if (chdir($pref_dir)) {
+            _100120_0700_glob_unlink('./matome_cache.htm');
+            _100120_0700_glob_unlink('./matome_cache.*.htm');
+            _100120_0700_glob_unlink('./matome_cache.*.lck');
+            chdir($current_dir);
+        }
+    }
+}
+
+// }}}
+// {{{ _100120_0700_glob_unlink()
+
+/**
+ * glob()‚ÅŒ©‚‚©‚Á‚½ƒtƒ@ƒCƒ‹‚ðíœ‚·‚é
+ *
+ * @param string $pattern
+ * @return void
+ */
+function _100120_0700_glob_unlink($pattern)
+{
+    if ($files = glob($pattern, GLOB_NOSORT)) {
+        foreach ($files as $file) {
+            if (is_file($file)) {
+                unlink($file);
+            }
+        }
+    }
+}
+
+// }}}
+// {{{ _100120_0700_convert_post_data_store()
+
+/**
+ * ‘‚«ž‚݃f[ƒ^‚Ì•Û‘¶Œ`Ž®‚ð•ÏX‚·‚é
+ *
+ * @param string $post_db_path
+ * @return void
+ */
+function _100120_0700_convert_post_data_store($post_db_path)
+{
+    if (!file_exists($post_db_path)) {
+        return;
+    }
+
+    $oldKvs = P2KeyValueStore::getStore($post_db_path,
+                                        P2KeyValueStore::CODEC_SERIALIZING);
+    $newKvs = PostDataStore::getKVS();
+
+    foreach ($oldKvs as $key => $value) {
+        $newKvs->set($key, $value);
+    }
+
+    if ($oldKvs->getTableName() != $newKvs->getTableName()) {
+        $oldKvs->prepare('DROP TABLE $__table')->execute();
+    }
+}
+
+// }}}
+
+/*
+ * Local Variables:
+ * mode: php
+ * coding: cp932
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
+// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:



P2-php-svn メーリングリストの案内
Back to archive index