BugTrack/2196
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* ページ名を変更すると最新の~件のところに変更前のページ...
- ページ: [[BugTrack]]
- 投稿者: [[cookie]]
- 優先順位: 低
- 状態: 完了
- カテゴリー: 本体バグ
- 投稿日: 2006-09-11 (月) 00:46:40
- バージョン: 1.4.7
- リリース予定バージョン: 1.5.2
#contents
** メッセージ [#ya3ea665]
1.4.7 にしてからページ名の変更((renameプラグイン))を行う...
変更前のページ名のほうは当然存在しないのでクリックすると...
1.4.6 では発生していませんでした。
おそらく 1.4.7 で recent.dat まわりの変更をした影響だと思...
***関連 [#ic255c98]
-[[BugTrack2/151]]
--------
**コメント [#rb80780e]
- 観察とコメントをありがとうございます。これは恐らくその...
-- 対象としては recent.dat, およびRecentChanges、RecentD...
- [[official:質問箱3/592]] に以下の指摘あり。 -- &new{20...
-- 「名前変更」時、変更が recent.dat に反映されていないよ...
if (($update == '' || check_non_list($update)) && $remov...
return; // No need
check_non_list($update)) の $update が ':RenameLog' のた...
-- lastmodified_add() は、$remove のページをリストから消...
しかも、$update が$non_listの対象外でリストのページ数が足...
対処療法で済ますのなら重い処理になりますが、
page_write(PLUGIN_RENAME_LOGPAGE, join('', $postdata));
+ put_lastmodified();
こうすれば全てのページ名を置換えてログをとった後に必ずput...
変更前のページ名をリストから消すだけでもいい((両方残るか...
- decode() の多さに惑わされてました。自分にはどうにもでき...
[[cvs:plugin/rename.inc.php]] (1.35)をベースに
// Phase four: Rename them, Log them, Redirect
function plugin_rename_phase4($pages, $files, $exists)
{
global $now, $_rename_messages;
- if (plugin_rename_getvar('exist') == '')
- foreach ($exists as $key=>$arr)
+ if (plugin_rename_getvar('exist') != '1') {
+ foreach ($exists as $key=>$arr) {
unset($files[$key]);
+ unset($pages[$key]);
+ }
+ }
set_time_limit(0);
foreach ($files as $page=>$arr) {
foreach ($arr as $old=>$new) {
if (isset($exists[$page][$old]) && $exists[$page][$o...
unlink($new);
rename($old, $new);
-
- // Update link database (BugTrack/327) arino
- links_update($old);
- links_update($new);
}
}
(中略)
if (! empty($exists)) {
+ if (plugin_rename_getvar('exist') != '1') {
$postdata[] = "\n" . $_rename_messages['msg_result']...
foreach ($exists as $page=>$arr) {
$postdata[] = '-' . decode($page) .
$_rename_messages['msg_arrow'] . decode($pages[$pa...
foreach ($arr as $ofile=>$nfile)
$postdata[] = '--' . $ofile .
$_rename_messages['msg_arrow'] . $nfile . "\n";
}
$postdata[] = '----' . "\n";
+ } else {
+ (上書きしなかった時のメッセージ(検討課題))
+ }
}
- foreach ($pages as $old=>$new)
- $postdata[] = '-' . decode($old) .
- $_rename_messages['msg_arrow'] . decode($new) . "\n";
+ foreach ($pages as $old=>$new) {
+ $old_page = decode($old);
+ $new_page = decode($new)
+
+ $postdata[] = '-' . $old_page .
+ $_rename_messages['msg_arrow'] . $new_page . "\n";
+
+ lastmodified_add('', $old_page);
+
+ links_update($old_page);
+ links_update($new_page);
+ }
// At this time, collision detection is not implemented
page_write(PLUGIN_RENAME_LOGPAGE, join('', $postdata));
$page = plugin_rename_getvar('page');
if ($page == '') $page = PLUGIN_RENAME_LOGPAGE;
// Redirection
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurle...
exit;
}
まず最初のif文の条件変更ですが、「パスワード入力時点では...
「パスワード入力時点で判明していて、'そのページを処理しな...
次にそのif文の中身ですが、置換えをキャンセルしたページま...
3番目に[[BugTrack/327]]で追加されたlinks_update() の処理...
最後にforeach ($pages as $old=>$new) の部分ですが、ページ...
検討課題としてif (! empty($exists)) の中の処理で、「上書...
一部非表示にしたのに、結局前よりも長くなったしまった。 --...
-- 混乱が抜けきっていなかったせいだ~(とごまかしてみる)...
- 対応しました。ページ名変更時にrecent.datを削除します。[...
#comment
** 関連?: $non_list の対象ページを削除した時に、必ずRecen...
-元の見出し: RecentDeleted のタイムスタンプがおかしい
-関連: [[official:質問箱4/84]]
- RecentChanges のメモを非表示にしました。 -- &new{2007-0...
//- [[official:質問箱4/84]] で指摘された現象が、また発生...
// RecentChanges
// Last-modified: 2007-05-20 (日) 12:28:01
//
// 2007-05-20 (日) 12:28:01 - BugTrack2/208
// 2007-05-20 (日) 07:27:57 - BugTrack2/146
// 2007-05-17 (木) 16:53:27 - RecentDeleted
// 2007-05-19 (土) 14:32:38 - BugTrack2/236
// 2007-05-18 (金) 12:30:16 - TrackBack
// 2007-05-18 (金) 02:33:24 - BugTrack2/235
// 2007-05-17 (木) 21:59:14 - BugTrack2/234
// 2007-05-17 (木) 19:09:22 - BugTrack/421
// 2007-05-17 (木) 18:09:35 - プラグイン/開発者向け
//[[RecentDeleted]] は下のようになっています。
// Last-modified: 2007-05-17 (木) 16:53:27
//
// 2007-05-17 (木) 16:53:27 - BugTrack2/237?
// 2007-05-17 (木) 16:52:59 - 254c0868l3?
//場違いでしたら、移しておいてください。 -- &new{2007-05...
//
//- 今度は[[公式サイト>official:FrontPage]]で起きているの...
// Last-modified: 2007-05-26 (土) 11:43:05
//
// 2007-05-26 (土) 11:43:05 - 自作プラグイン/mathfunc.inc...
// 2007-05-26 (土) 11:16:59 - 人造人間
// 2007-05-26 (土) 11:16:05 - 自作プラグイン/expr.inc.php
// 2007-05-26 (土) 11:09:29 - 自作プラグイン/if.inc.php
// 2007-05-26 (土) 10:41:45 - kahata
// 2007-05-26 (土) 09:55:00 - ParserFunctions
// 2007-05-25 (金) 23:54:38 - RecentDeleted
// 2007-05-26 (土) 09:45:26 - test
// 2007-05-26 (土) 08:57:10 - 自作プラグイン/delpage.inc....
// 2007-05-26 (土) 07:04:17 - 自作プラグイン/vote2.inc.php
// 2007-05-25 (金) 23:47:05 - 自作プラグイン/delpage_digi...
// 2007-05-25 (金) 23:00:06 - 質問箱4/102
//[[official:RecentDeleted]] のメモ
// Last-modified: 2007-05-25 (金) 23:54:38
//
// 2007-05-25 (金) 23:54:37 - PaserFunctions?
// 2007-05-25 (金) 23:50:04 - 携帯アフィリエイト?
//なんでこうなるんだろう。 -- &new{2007-05-26 (土) 12:25...
- もしかしたら、な原因の検証~
lib/file.php (1.80)
function lastmodified_add($update = '', $remove = '')
{
(中略)
// Read (keep the order of the lines)
$recent_pages = $matches = array();
foreach(file_head($file, $maxshow + PKWK_MAXSHOW_ALLOWAN...
if (preg_match('/^([0-9]+)\t(.+)/', $line, $matches))
$recent_pages[$matches[2]] = $matches[1];
// Remove if it exists inside
if (isset($recent_pages[$update])) unset($recent_pages[$...
if (isset($recent_pages[$remove])) unset($recent_pages[$...
// Add to the top: like array_unshift()
if ($update != '')
$recent_pages = array($update => get_filetime($update))...
// Check
$abort = count($recent_pages) < $maxshow;
if (! $abort) {
// Write
ftruncate($fp, 0);
rewind($fp);
foreach ($recent_pages as $_page=>$time)
fputs($fp, $time . "\t" . $_page . "\n");
}
flock($fp, LOCK_UN);
fclose($fp);
if ($abort) {
put_lastmodified(); // Try to (re)create ALL
return;
}
'recent.dat' を修正するときに、更新や削除したページの過去...
その後、更新したページのデータを何も確認せずに、1行目に追...
オートリンク機能を使っていたり、
データリストが$maxshow よりも少ない場合((なんかこの処理の...
作り直しているので問題にはならないですが、~
そうでなかった時、日時関係の確認やソートをせずに追加して...
'recent.dat' を基にして'RecentChanges' を作るので、おかし...
修正の必要がある場所が、ここだけならいいんですけど。 -- ...
- ひとまず、メモ。このサイトで$non_list の対象になるペー...
-- やっと原因がわかったかも。~
lib/file.php (1.86)
// Output to a file
function file_write($dir, $page, $str, $notimestamp = FA...
{
(中略)
// ----
// Delete?
if ($dir == DATA_DIR && $str === '') {
// Page deletion
if (! $file_exists) return; // Ignore null posting for ...
// Update RecentDeleted (Add the $page)
add_recent($page, $whatsdeleted, '', $maxshow_deleted);
// Remove the page
unlink($file);
// Update RecentDeleted, and remove the page from Recen...
lastmodified_add($whatsdeleted, $page);
// Clear is_page() cache
is_page($page, TRUE);
return;
} else if ($dir == DIFF_DIR && $str === " \n") {
上でlastmodified_add() を呼ぶところは、どんな時でも$whats...
$page が$non_list の対象となった時、実際には$whatsdeleted...
というわけで、if (check_non_list($page)) で分岐して、$non...
つまり、recent.dat の仕組みではなく、そこを呼び出すときの...
#comment
終了行:
* ページ名を変更すると最新の~件のところに変更前のページ...
- ページ: [[BugTrack]]
- 投稿者: [[cookie]]
- 優先順位: 低
- 状態: 完了
- カテゴリー: 本体バグ
- 投稿日: 2006-09-11 (月) 00:46:40
- バージョン: 1.4.7
- リリース予定バージョン: 1.5.2
#contents
** メッセージ [#ya3ea665]
1.4.7 にしてからページ名の変更((renameプラグイン))を行う...
変更前のページ名のほうは当然存在しないのでクリックすると...
1.4.6 では発生していませんでした。
おそらく 1.4.7 で recent.dat まわりの変更をした影響だと思...
***関連 [#ic255c98]
-[[BugTrack2/151]]
--------
**コメント [#rb80780e]
- 観察とコメントをありがとうございます。これは恐らくその...
-- 対象としては recent.dat, およびRecentChanges、RecentD...
- [[official:質問箱3/592]] に以下の指摘あり。 -- &new{20...
-- 「名前変更」時、変更が recent.dat に反映されていないよ...
if (($update == '' || check_non_list($update)) && $remov...
return; // No need
check_non_list($update)) の $update が ':RenameLog' のた...
-- lastmodified_add() は、$remove のページをリストから消...
しかも、$update が$non_listの対象外でリストのページ数が足...
対処療法で済ますのなら重い処理になりますが、
page_write(PLUGIN_RENAME_LOGPAGE, join('', $postdata));
+ put_lastmodified();
こうすれば全てのページ名を置換えてログをとった後に必ずput...
変更前のページ名をリストから消すだけでもいい((両方残るか...
- decode() の多さに惑わされてました。自分にはどうにもでき...
[[cvs:plugin/rename.inc.php]] (1.35)をベースに
// Phase four: Rename them, Log them, Redirect
function plugin_rename_phase4($pages, $files, $exists)
{
global $now, $_rename_messages;
- if (plugin_rename_getvar('exist') == '')
- foreach ($exists as $key=>$arr)
+ if (plugin_rename_getvar('exist') != '1') {
+ foreach ($exists as $key=>$arr) {
unset($files[$key]);
+ unset($pages[$key]);
+ }
+ }
set_time_limit(0);
foreach ($files as $page=>$arr) {
foreach ($arr as $old=>$new) {
if (isset($exists[$page][$old]) && $exists[$page][$o...
unlink($new);
rename($old, $new);
-
- // Update link database (BugTrack/327) arino
- links_update($old);
- links_update($new);
}
}
(中略)
if (! empty($exists)) {
+ if (plugin_rename_getvar('exist') != '1') {
$postdata[] = "\n" . $_rename_messages['msg_result']...
foreach ($exists as $page=>$arr) {
$postdata[] = '-' . decode($page) .
$_rename_messages['msg_arrow'] . decode($pages[$pa...
foreach ($arr as $ofile=>$nfile)
$postdata[] = '--' . $ofile .
$_rename_messages['msg_arrow'] . $nfile . "\n";
}
$postdata[] = '----' . "\n";
+ } else {
+ (上書きしなかった時のメッセージ(検討課題))
+ }
}
- foreach ($pages as $old=>$new)
- $postdata[] = '-' . decode($old) .
- $_rename_messages['msg_arrow'] . decode($new) . "\n";
+ foreach ($pages as $old=>$new) {
+ $old_page = decode($old);
+ $new_page = decode($new)
+
+ $postdata[] = '-' . $old_page .
+ $_rename_messages['msg_arrow'] . $new_page . "\n";
+
+ lastmodified_add('', $old_page);
+
+ links_update($old_page);
+ links_update($new_page);
+ }
// At this time, collision detection is not implemented
page_write(PLUGIN_RENAME_LOGPAGE, join('', $postdata));
$page = plugin_rename_getvar('page');
if ($page == '') $page = PLUGIN_RENAME_LOGPAGE;
// Redirection
pkwk_headers_sent();
header('Location: ' . get_script_uri() . '?' . rawurle...
exit;
}
まず最初のif文の条件変更ですが、「パスワード入力時点では...
「パスワード入力時点で判明していて、'そのページを処理しな...
次にそのif文の中身ですが、置換えをキャンセルしたページま...
3番目に[[BugTrack/327]]で追加されたlinks_update() の処理...
最後にforeach ($pages as $old=>$new) の部分ですが、ページ...
検討課題としてif (! empty($exists)) の中の処理で、「上書...
一部非表示にしたのに、結局前よりも長くなったしまった。 --...
-- 混乱が抜けきっていなかったせいだ~(とごまかしてみる)...
- 対応しました。ページ名変更時にrecent.datを削除します。[...
#comment
** 関連?: $non_list の対象ページを削除した時に、必ずRecen...
-元の見出し: RecentDeleted のタイムスタンプがおかしい
-関連: [[official:質問箱4/84]]
- RecentChanges のメモを非表示にしました。 -- &new{2007-0...
//- [[official:質問箱4/84]] で指摘された現象が、また発生...
// RecentChanges
// Last-modified: 2007-05-20 (日) 12:28:01
//
// 2007-05-20 (日) 12:28:01 - BugTrack2/208
// 2007-05-20 (日) 07:27:57 - BugTrack2/146
// 2007-05-17 (木) 16:53:27 - RecentDeleted
// 2007-05-19 (土) 14:32:38 - BugTrack2/236
// 2007-05-18 (金) 12:30:16 - TrackBack
// 2007-05-18 (金) 02:33:24 - BugTrack2/235
// 2007-05-17 (木) 21:59:14 - BugTrack2/234
// 2007-05-17 (木) 19:09:22 - BugTrack/421
// 2007-05-17 (木) 18:09:35 - プラグイン/開発者向け
//[[RecentDeleted]] は下のようになっています。
// Last-modified: 2007-05-17 (木) 16:53:27
//
// 2007-05-17 (木) 16:53:27 - BugTrack2/237?
// 2007-05-17 (木) 16:52:59 - 254c0868l3?
//場違いでしたら、移しておいてください。 -- &new{2007-05...
//
//- 今度は[[公式サイト>official:FrontPage]]で起きているの...
// Last-modified: 2007-05-26 (土) 11:43:05
//
// 2007-05-26 (土) 11:43:05 - 自作プラグイン/mathfunc.inc...
// 2007-05-26 (土) 11:16:59 - 人造人間
// 2007-05-26 (土) 11:16:05 - 自作プラグイン/expr.inc.php
// 2007-05-26 (土) 11:09:29 - 自作プラグイン/if.inc.php
// 2007-05-26 (土) 10:41:45 - kahata
// 2007-05-26 (土) 09:55:00 - ParserFunctions
// 2007-05-25 (金) 23:54:38 - RecentDeleted
// 2007-05-26 (土) 09:45:26 - test
// 2007-05-26 (土) 08:57:10 - 自作プラグイン/delpage.inc....
// 2007-05-26 (土) 07:04:17 - 自作プラグイン/vote2.inc.php
// 2007-05-25 (金) 23:47:05 - 自作プラグイン/delpage_digi...
// 2007-05-25 (金) 23:00:06 - 質問箱4/102
//[[official:RecentDeleted]] のメモ
// Last-modified: 2007-05-25 (金) 23:54:38
//
// 2007-05-25 (金) 23:54:37 - PaserFunctions?
// 2007-05-25 (金) 23:50:04 - 携帯アフィリエイト?
//なんでこうなるんだろう。 -- &new{2007-05-26 (土) 12:25...
- もしかしたら、な原因の検証~
lib/file.php (1.80)
function lastmodified_add($update = '', $remove = '')
{
(中略)
// Read (keep the order of the lines)
$recent_pages = $matches = array();
foreach(file_head($file, $maxshow + PKWK_MAXSHOW_ALLOWAN...
if (preg_match('/^([0-9]+)\t(.+)/', $line, $matches))
$recent_pages[$matches[2]] = $matches[1];
// Remove if it exists inside
if (isset($recent_pages[$update])) unset($recent_pages[$...
if (isset($recent_pages[$remove])) unset($recent_pages[$...
// Add to the top: like array_unshift()
if ($update != '')
$recent_pages = array($update => get_filetime($update))...
// Check
$abort = count($recent_pages) < $maxshow;
if (! $abort) {
// Write
ftruncate($fp, 0);
rewind($fp);
foreach ($recent_pages as $_page=>$time)
fputs($fp, $time . "\t" . $_page . "\n");
}
flock($fp, LOCK_UN);
fclose($fp);
if ($abort) {
put_lastmodified(); // Try to (re)create ALL
return;
}
'recent.dat' を修正するときに、更新や削除したページの過去...
その後、更新したページのデータを何も確認せずに、1行目に追...
オートリンク機能を使っていたり、
データリストが$maxshow よりも少ない場合((なんかこの処理の...
作り直しているので問題にはならないですが、~
そうでなかった時、日時関係の確認やソートをせずに追加して...
'recent.dat' を基にして'RecentChanges' を作るので、おかし...
修正の必要がある場所が、ここだけならいいんですけど。 -- ...
- ひとまず、メモ。このサイトで$non_list の対象になるペー...
-- やっと原因がわかったかも。~
lib/file.php (1.86)
// Output to a file
function file_write($dir, $page, $str, $notimestamp = FA...
{
(中略)
// ----
// Delete?
if ($dir == DATA_DIR && $str === '') {
// Page deletion
if (! $file_exists) return; // Ignore null posting for ...
// Update RecentDeleted (Add the $page)
add_recent($page, $whatsdeleted, '', $maxshow_deleted);
// Remove the page
unlink($file);
// Update RecentDeleted, and remove the page from Recen...
lastmodified_add($whatsdeleted, $page);
// Clear is_page() cache
is_page($page, TRUE);
return;
} else if ($dir == DIFF_DIR && $str === " \n") {
上でlastmodified_add() を呼ぶところは、どんな時でも$whats...
$page が$non_list の対象となった時、実際には$whatsdeleted...
というわけで、if (check_non_list($page)) で分岐して、$non...
つまり、recent.dat の仕組みではなく、そこを呼び出すときの...
#comment
ページ名: