summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2011-05-08 11:44:12 +0200
committerMichael Hamann <michael@content-space.de>2011-05-08 12:16:48 +0200
commit65aa8490874917620bd9a9a773cd0fb7621afb41 (patch)
tree7dd3428e26c9277d1169e6eeb6616d7163a9282f /inc/indexer.php
parent67c15ecea77ff971dcb554de77cf1c25de1140a0 (diff)
downloadrpg-65aa8490874917620bd9a9a773cd0fb7621afb41.tar.gz
rpg-65aa8490874917620bd9a9a773cd0fb7621afb41.tar.bz2
Add more render/cache logic to the metadata code
This adds a new rendering limit of currently 5 pages to the p_get_metadata function. This means that in one request not more than 3 pages will be parsed/rendered. Pages for which the cache can be used aren't counted. This should make the new cache modes safe to use and should provide backwards compatibility while keeping the advantage of rendering metadata on demand (i.e. imagine one included page out of 10 is updated, then the metadata for that page can be rendered, but when you request a purge of the cache not 10 pages are rendered). In this commit most of the changes to the p_get_first_heading function are reverted and the title index is no longer used. This makes the first heading functionality no longer depends on the search index of DokuWiki. Maybe it can be added again later when the indexer provides a proper API for getting metadata values for all or selected pages. The performance of the p_get_first_heading function should be almost back to the performance in Anteater as the simple cache of p_get_metadata is used and also the limit of p_get_metadata is of course applied.
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 64e172b5b..3b4796676 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1197,7 +1197,7 @@ function idx_addPage($page, $verbose=false, $force=false) {
@unlink($idxtag);
return $result;
}
- $indexenabled = p_get_metadata($page, 'internal index', true);
+ $indexenabled = p_get_metadata($page, 'internal index', METADATA_RENDER_UNLIMITED);
if ($indexenabled === false) {
$result = false;
if (@file_exists($idxtag)) {
@@ -1215,8 +1215,8 @@ function idx_addPage($page, $verbose=false, $force=false) {
$body = '';
$metadata = array();
- $metadata['title'] = p_get_metadata($page, 'title', true);
- if (($references = p_get_metadata($page, 'relation references', true)) !== null)
+ $metadata['title'] = p_get_metadata($page, 'title', METADATA_RENDER_UNLIMITED);
+ if (($references = p_get_metadata($page, 'relation references', METADATA_RENDER_UNLIMITED)) !== null)
$metadata['relation_references'] = array_keys($references);
else
$metadata['relation_references'] = array();