diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-05-11 21:14:50 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-05-11 21:14:50 +0200 |
commit | 7421c3cce15c5712b2bfb76cd5dd857771e8b6b8 (patch) | |
tree | 94f8835d3a9a260c10900de23b622beda75d72d4 /lib/exe/indexer.php | |
parent | 4fa2dffce72d182e25295de4947077cf52ba1f2b (diff) | |
download | rpg-7421c3cce15c5712b2bfb76cd5dd857771e8b6b8.tar.gz rpg-7421c3cce15c5712b2bfb76cd5dd857771e8b6b8.tar.bz2 |
more info is gathered on metaupdate in background indexer
The background indexer now gathers info on contributors and modification
dates from the changelog when adding the missing meta info.
A new io_grep function was added which might be useful for other parts in
the Wiki as well.
darcs-hash:20060511191450-7ad00-baba1b48ea03b823c88a480862c612316f159b5a.gz
Diffstat (limited to 'lib/exe/indexer.php')
-rw-r--r-- | lib/exe/indexer.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 05bcb5827..5359e16fc 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -91,10 +91,31 @@ function metaUpdate(){ // rendering needed? if (@file_exists($file)) return false; + if (!@file_exists(wikiFN($ID))) return false; + require_once(DOKU_INC.'inc/common.php'); require_once(DOKU_INC.'inc/parserutils.php'); + global $conf; + + + // gather some additional info from changelog + $info = io_grep($conf['changelog'], + '/^(\d+)\t(\d+\.\d+\.\d+\.\d+)\t'.preg_quote($ID,'/').'\t([^\t]+)\t([^\t\n]+)/', + 0,true); $meta = array(); + if(count($info)){ + $meta['date']['created'] = $info[0][1]; + foreach($info as $item){ + if($item[4] != '*'){ + $meta['date']['modified'] = $item[1]; + if($item[3]){ + $meta['contributor'][$item[3]] = $item[3]; + } + } + } + } + $meta = p_render_metadata($ID, $meta); io_saveFile($file, serialize($meta)); |