aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/indexer.php
diff options
context:
space:
mode:
Diffstat (limited to 'bin/indexer.php')
-rwxr-xr-xbin/indexer.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/bin/indexer.php b/bin/indexer.php
index 13895c36a..4d19a9515 100755
--- a/bin/indexer.php
+++ b/bin/indexer.php
@@ -1,13 +1,17 @@
#!/usr/bin/php
<?php
-if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../').'/');
+
+use splitbrain\phpcli\CLI;
+use splitbrain\phpcli\Options;
+
+if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__) . '/../') . '/');
define('NOSESSION', 1);
-require_once(DOKU_INC.'inc/init.php');
+require_once(DOKU_INC . 'inc/init.php');
/**
* Update the Search Index from command line
*/
-class IndexerCLI extends DokuCLI {
+class IndexerCLI extends CLI {
private $quiet = false;
private $clear = false;
@@ -15,12 +19,12 @@ class IndexerCLI extends DokuCLI {
/**
* Register options and arguments on the given $options object
*
- * @param DokuCLI_Options $options
+ * @param Options $options
* @return void
*/
- protected function setup(DokuCLI_Options $options) {
+ protected function setup(Options $options) {
$options->setHelp(
- 'Updates the searchindex by indexing all new or changed pages. When the -c option is '.
+ 'Updates the searchindex by indexing all new or changed pages. When the -c option is ' .
'given the index is cleared first.'
);
@@ -41,10 +45,10 @@ class IndexerCLI extends DokuCLI {
*
* Arguments and options have been parsed when this is run
*
- * @param DokuCLI_Options $options
+ * @param Options $options
* @return void
*/
- protected function main(DokuCLI_Options $options) {
+ protected function main(Options $options) {
$this->clear = $options->getOpt('clear');
$this->quiet = $options->getOpt('quiet');
@@ -61,7 +65,7 @@ class IndexerCLI extends DokuCLI {
$data = array();
$this->quietecho("Searching pages... ");
search($data, $conf['datadir'], 'search_allpages', array('skipacl' => true));
- $this->quietecho(count($data)." pages found.\n");
+ $this->quietecho(count($data) . " pages found.\n");
foreach($data as $val) {
$this->index($val['id']);
@@ -100,4 +104,4 @@ class IndexerCLI extends DokuCLI {
// Main
$cli = new IndexerCLI();
-$cli->run(); \ No newline at end of file
+$cli->run();