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£pbNÌo[W + 'p2expack' => '100120.0700', // g£pbNÌ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[WAbvÌÚsx - */ - -// {{{ p2_migrate_100117_0000() - -/** - * svÉÈÁ½V ÜÆßÇÝLbV t@Cðí·é - * - * @param array $core_config rep2RAÌÝè - * @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[WAbvÌÚsx + */ + +// {{{ p2_migrate_100120_0700() + +/** + * svÉÈÁ½V ÜÆßÇÝLbV t@CðíµA + * «Ýf[^ÌÛ¶`®ðÏX·éB + * + * @param array $core_config rep2RAÌÝè + * @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() + +/** + * svÉÈÁ½V ÜÆßÇÝLbV 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: