summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-04-15 13:45:45 +0200
committerAndreas Gohr <andi@splitbrain.org>2012-04-15 13:45:45 +0200
commitae7c596cf4e6a0a09ebcf01fe8ae98789360c5be (patch)
treef156252e404e9893922cb5d984fdc646644b6c17 /inc/indexer.php
parentf41c79d730286e8e8c95deb88a4c876e08e278a2 (diff)
parent026b314868ee80aca644bf4107f78d8e8052b43e (diff)
downloadrpg-ae7c596cf4e6a0a09ebcf01fe8ae98789360c5be.tar.gz
rpg-ae7c596cf4e6a0a09ebcf01fe8ae98789360c5be.tar.bz2
Merge branch 'master' into htmlmail
* master: (382 commits) Romanian language update Marathi language update Arabic Language Update when there's not enough space for images, make sure they stay proportional (might be FS#2480) added minimal RTL print styles (part of FS#2185) moved plugins' rtl.css to their style.css counterpart (part of FS#2185) removed all browser-specific gradients as the recently (in 42ff6730) introduced svg makes them unnecessary removed comments from accidentally commented lines in tpl_includeFile() removed obsolete template file added tpl_includeFile() to core Make getTitle method in remote interface public Changed an error code in XML-RPC interface. This error hasn't anything to do with the rest of the -32600 errors. BG: language update Korean language update fixed performance issues with gradient in Firefox (which also added gradient support for IE9) (FS#2447) deleted very old (and unused) images added accidentally removed '<?php' back in (was in 57fc5edd) wrapped X-UA-Compatible meta tag with conditional comments added explanation to todo in _forms.css removed problematic 'overflow: hidden' from lists again ('unfixes' FS#1950) ... Conflicts: inc/auth.php inc/load.php
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php28
1 files changed, 15 insertions, 13 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 9d8d6f99b..80d2651c2 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -291,7 +291,6 @@ class Doku_Indexer {
$val_idx = array();
}
-
foreach ($values as $val) {
$val = (string)$val;
if ($val !== "") {
@@ -351,7 +350,7 @@ class Doku_Indexer {
return "locked";
// load known documents
- $pid = $this->getIndexKey('page', '', $page);
+ $pid = $this->addIndexKey('page', '', $page);
if ($pid === false) {
$this->unlock();
return false;
@@ -389,6 +388,7 @@ class Doku_Indexer {
$val_idx = explode(':', $this->getIndexKey($metaname.'_p', '', $pid));
$meta_idx = $this->getIndex($metaname.'_i', '');
foreach ($val_idx as $id) {
+ if ($id === '') continue;
$meta_idx[$id] = $this->updateTuple($meta_idx[$id], $pid, 0);
}
$this->saveIndex($metaname.'_i', '', $meta_idx);
@@ -1174,18 +1174,8 @@ function & idx_get_stopwords() {
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function idx_addPage($page, $verbose=false, $force=false) {
- // check if indexing needed
$idxtag = metaFN($page,'.indexed');
- if(!$force && @file_exists($idxtag)){
- if(trim(io_readFile($idxtag)) == idx_get_version()){
- $last = @filemtime($idxtag);
- if($last > @filemtime(wikiFN($page))){
- if ($verbose) print("Indexer: index for $page up to date".DOKU_LF);
- return false;
- }
- }
- }
-
+ // check if page was deleted but is still in the index
if (!page_exists($page)) {
if (!@file_exists($idxtag)) {
if ($verbose) print("Indexer: $page does not exist, ignoring".DOKU_LF);
@@ -1200,6 +1190,18 @@ function idx_addPage($page, $verbose=false, $force=false) {
@unlink($idxtag);
return $result;
}
+
+ // check if indexing needed
+ if(!$force && @file_exists($idxtag)){
+ if(trim(io_readFile($idxtag)) == idx_get_version()){
+ $last = @filemtime($idxtag);
+ if($last > @filemtime(wikiFN($page))){
+ if ($verbose) print("Indexer: index for $page up to date".DOKU_LF);
+ return false;
+ }
+ }
+ }
+
$indexenabled = p_get_metadata($page, 'internal index', METADATA_RENDER_UNLIMITED);
if ($indexenabled === false) {
$result = false;