diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-02-03 22:57:45 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-02-03 22:57:45 +0100 |
commit | 3da7921f08ecdda929466921ecc50698f1adf99e (patch) | |
tree | 0e179e504399e874bfd785d0a95eec44b76d5952 /bin/indexer.php | |
parent | 6cf2bbfa12b776cf47cb69ae40fb8862f715ad01 (diff) | |
parent | cc4bb766fdac23358d7b586aa3830b9650eed7a8 (diff) | |
download | rpg-3da7921f08ecdda929466921ecc50698f1adf99e.tar.gz rpg-3da7921f08ecdda929466921ecc50698f1adf99e.tar.bz2 |
Merge branch 'master' into future
* master: (162 commits)
fixed revision JS for images
upgraded SimplePie to 1.3.1 FS#2708
removed obsolete browser plugin (migrate does it)
adjust spacing to match standard 1.4em grid
added comment on use of whitelist vs blacklist
Updated idfilter() function for IIS
use var and remove suggestions when needed Use variable for maximum number of suggestions for quicksearch. And hide suggestions when search field is emptied, or when no suggestion are found.
added 'home' class to first link in hierarchical breadcrumbs
reduced required max width to go into tablet mode
re-added linear gradients for firefox
added missing styling for disabled form elements (FS#2705)
fixed acronyms in italics (FS#2684)
improved print styles (includes fixes for FS#2645 and FS#2707)
basic styles improvements
Greek language update
Use list in acl help text, for more structure
Galician language update
touch the config on save, even if no changes were made
unwind the width narrowing commit
put some whitespace between form submit button and fieldset bottom border
...
Conflicts:
lib/plugins/config/admin.php
lib/plugins/config/settings/config.class.php
Diffstat (limited to 'bin/indexer.php')
-rwxr-xr-x | bin/indexer.php | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/bin/indexer.php b/bin/indexer.php index f6aeb4f0e..6f6b5d9fa 100755 --- a/bin/indexer.php +++ b/bin/indexer.php @@ -5,11 +5,6 @@ if ('cli' != php_sapi_name()) die(); ini_set('memory_limit','128M'); if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/'); require_once(DOKU_INC.'inc/init.php'); -require_once(DOKU_INC.'inc/common.php'); -require_once(DOKU_INC.'inc/pageutils.php'); -require_once(DOKU_INC.'inc/search.php'); -require_once(DOKU_INC.'inc/indexer.php'); -require_once(DOKU_INC.'inc/auth.php'); require_once(DOKU_INC.'inc/cliopts.php'); session_write_close(); @@ -67,10 +62,6 @@ function _usage() { function _update(){ global $conf; - global $INDEXER; - - $INDEXER = idx_get_indexer(); - $data = array(); _quietecho("Searching pages... "); search($data,$conf['datadir'],'search_allpages',array('skipacl' => true)); @@ -82,7 +73,6 @@ function _update(){ } function _index($id){ - global $INDEXER; global $CLEAR; global $QUIET; @@ -92,62 +82,12 @@ function _index($id){ } /** - * lock the indexer system - */ -function _lock(){ - global $conf; - $lock = $conf['lockdir'].'/_indexer.lock'; - $said = false; - while(!@mkdir($lock, $conf['dmode'])){ - if(time()-@filemtime($lock) > 60*5){ - // looks like a stale lock - remove it - @rmdir($lock); - }else{ - if($said){ - _quietecho("."); - }else{ - _quietecho("Waiting for lockfile (max. 5 min)"); - $said = true; - } - sleep(15); - } - } - if($conf['dperm']) chmod($lock, $conf['dperm']); - if($said) _quietecho("\n"); -} - -/** - * unlock the indexer sytem - */ -function _unlock(){ - global $conf; - $lock = $conf['lockdir'].'/_indexer.lock'; - @rmdir($lock); -} - -/** * Clear all index files */ function _clearindex(){ - global $conf; - _lock(); _quietecho("Clearing index... "); - io_saveFile($conf['indexdir'].'/page.idx',''); - io_saveFile($conf['indexdir'].'/title.idx',''); - io_saveFile($conf['indexdir'].'/pageword.idx',''); - io_saveFile($conf['indexdir'].'/metadata.idx',''); - $dir = @opendir($conf['indexdir']); - if($dir!==false){ - while(($f = readdir($dir)) !== false){ - if(substr($f,-4)=='.idx' && - (substr($f,0,1)=='i' || substr($f,0,1)=='w' - || substr($f,-6)=='_w.idx' || substr($f,-6)=='_i.idx' || substr($f,-6)=='_p.idx')) - @unlink($conf['indexdir']."/$f"); - } - } - @unlink($conf['indexdir'].'/lengths.idx'); + idx_get_indexer()->clear(); _quietecho("done.\n"); - _unlock(); } function _quietecho($msg) { |