From 468441561df674f9df04e53a21d29dd4f1f0c017 Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Mon, 23 Oct 2006 07:21:33 +0200 Subject: synchronize changelog, attic, and external edits The changelog list and the attic now are kept in sync. This allows a changelog entry to be automatically constructed for a page that was manually edited from outside dokuwiki. darcs-hash:20061023052133-05dcb-11b8dbaee1da07fb1875bbe530e88d94871ed65d.gz --- inc/changelog.php | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'inc/changelog.php') diff --git a/inc/changelog.php b/inc/changelog.php index 570c48740..85de8e2aa 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -271,11 +271,7 @@ function getRevisionInfo($id, $rev, $chunk_size=8192) { * backwards in chunks untill the requested number of changelog * lines are recieved. * - * Because there may exist revisions not listed in the changelog - * the found revisions are merged with the ones found in the attic - * * @author Ben Coburn - * @see getRevisionsFromAttic() */ function getRevisions($id, $first, $num, $chunk_size=8192) { global $cache_revinfo; @@ -358,37 +354,7 @@ function getRevisions($id, $first, $num, $chunk_size=8192) { } } - // merge with attic file info - $revs = array_merge($revs,getRevisionsFromAttic($id,false)); - $revs = array_unique($revs); - rsort($revs); - return $revs; } -/** - * Return a list of available and existing page revisons from the attic - * - * @author Andreas Gohr - * @see getRevisions() - */ -function getRevisionsFromAttic($id,$sorted=true){ - $revd = dirname(wikiFN($id,'foo')); - $revs = array(); - $clid = cleanID($id); - if(strrpos($clid,':')) $clid = substr($clid,strrpos($clid,':')+1); //remove path - $clid = utf8_encodeFN($clid); - - if (is_dir($revd) && $dh = opendir($revd)) { - while (($file = readdir($dh)) !== false) { - if (is_dir($revd.'/'.$file)) continue; - if (preg_match('/^'.$clid.'\.(\d+)\.txt(\.gz)?$/',$file,$match)){ - $revs[]=$match[1]; - } - } - closedir($dh); - } - if($sorted) rsort($revs); - return $revs; -} -- cgit v1.2.3