summaryrefslogtreecommitdiff
path: root/lib/exe/indexer.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-04-30 20:17:40 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-04-30 20:17:40 +0200
commit95dbfe5721704a800c0f108c048ab3cb5e13de3b (patch)
tree3e0fa5f8953292d69f242353853f70891c17b1d9 /lib/exe/indexer.php
parent862763f2e36a5ef7e996bad2579e60b2bd365f39 (diff)
downloadrpg-95dbfe5721704a800c0f108c048ab3cb5e13de3b.tar.gz
rpg-95dbfe5721704a800c0f108c048ab3cb5e13de3b.tar.bz2
metadata enhancements
This adds meta data rendering to the indexer process to build missing meta data in the background. p_get_first_heading was adjusted to make use of the new meta data mechanisms A problem with unitialized arrays in p_set_metadata and PHP5 was fixed (I think) darcs-hash:20060430181740-7ad00-8952fa6beb4fadf6b4321627998442d34febfc8d.gz
Diffstat (limited to 'lib/exe/indexer.php')
-rw-r--r--lib/exe/indexer.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index 28eaa8284..d37fb9c9a 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -21,7 +21,7 @@ sendGIF();
if(!$_REQUEST['debug']) ob_start();
// run one of the jobs
-runIndexer() or runSitemapper();
+runIndexer() or metaUpdate() or runSitemapper();
if(!$_REQUEST['debug']) ob_end_clean();
exit;
@@ -75,6 +75,32 @@ 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(){
+ print "metaUpdate(): started".NL;
+
+ $ID = cleanID($_REQUEST['id']);
+ if(!$ID) return false;
+ $file = metaFN($ID, '.meta');
+
+ // rendering needed?
+ if (@file_exists($file)) return false;
+
+ require_once(DOKU_INC.'inc/parserutils.php');
+
+ $meta = array();
+ $meta = p_render_metadata($ID, $meta);
+ io_saveFile($file, serialize($meta));
+
+ print "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