summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2010-11-22 21:12:02 +0100
committerMichael Hamann <michael@content-space.de>2010-11-22 21:21:52 +0100
commit98214867894eba512bf47cba3439ccba3968f49b (patch)
tree5b6d8c550180d8a6e0f7962a643182e31e85a27c /lib/exe
parent5e1ee188750eca4ed2f13227ede216598c9669c8 (diff)
downloadrpg-98214867894eba512bf47cba3439ccba3968f49b.tar.gz
rpg-98214867894eba512bf47cba3439ccba3968f49b.tar.bz2
Render metadata when needed
This changes fundamentally when metadata is rendered. This commit introduces a new cache file for every page that just contains a timestamp and is updated whenever the metadata of that page is rendered. Metadata is rendered when p_get_metadata is called and the last rendering has been before a page, metadata, configuration or renderer update or purge is set like in the xhtml renderer cache. Metadata is no longer automatically rendered when the xhtml renderer cache isn't used but will still be rendered when needed as p_get_metadata is called in the cache. Metadata is also no longer rendered in the indexer script when missing as that is already done by pageinfo() before anything else is done so the indexer script won't be called when there is no metadata file.
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/indexer.php46
1 files changed, 0 insertions, 46 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index 3fa81715b..bf5bad2e7 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -34,7 +34,6 @@ $tmp = array(); // No event data
$evt = new Doku_Event('INDEXER_TASKS_RUN', $tmp);
if ($evt->advise_before()) {
runIndexer() or
- metaUpdate() or
runSitemapper() or
sendDigest() or
runTrimRecentChanges() or
@@ -175,51 +174,6 @@ function runIndexer(){
}
/**
- * Will render the metadata for the page if not exists yet
- *
- * This makes sure pages which are created from outside DokuWiki will
- * gain their data when viewed for the first time.
- */
-function metaUpdate(){
- global $ID;
- print "metaUpdate(): started".NL;
-
- if(!$ID) return false;
- $file = metaFN($ID, '.meta');
- echo "meta file: $file".NL;
-
- // rendering needed?
- if (@file_exists($file)) return false;
- if (!page_exists($ID)) return false;
-
- 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(!empty($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);
- p_save_metadata($ID, $meta);
-
- echo "metaUpdate(): finished".NL;
- return true;
-}
-
-/**
* Builds a Google Sitemap of all public pages known to the indexer
*
* The map is placed in the root directory named sitemap.xml.gz - This