diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-05-16 09:11:15 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-05-16 09:11:15 +0200 |
commit | 1c36b3d86f90185519cadaad85251922dc771fe1 (patch) | |
tree | 30701dd933a5c86f99bd3eb0ca9292a8fa65a3c8 /bin/wantedpages.php | |
parent | e82b082ef3300c5b2d8f03f74873ef31f0b57933 (diff) | |
download | rpg-1c36b3d86f90185519cadaad85251922dc771fe1.tar.gz rpg-1c36b3d86f90185519cadaad85251922dc771fe1.tar.bz2 |
code reformat
Diffstat (limited to 'bin/wantedpages.php')
-rwxr-xr-x | bin/wantedpages.php | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/bin/wantedpages.php b/bin/wantedpages.php index 879291957..8fc4ba74f 100755 --- a/bin/wantedpages.php +++ b/bin/wantedpages.php @@ -1,9 +1,12 @@ #!/usr/bin/php <?php -if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__) . '/../') . '/'); +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'); +/** + * Find wanted pages + */ class WantedPagesCLI extends DokuCLI { const DIR_CONTINUE = 1; @@ -18,12 +21,12 @@ class WantedPagesCLI extends DokuCLI { */ protected function setup(DokuCLI_Options $options) { $options->setHelp( - 'Outputs a list of wanted pages (pages which have internal links but do not yet exist).' + 'Outputs a list of wanted pages (pages which have internal links but do not yet exist).' ); $options->registerArgument( - 'namespace', - 'The namespace to lookup. Defaults to root namespace', - false + 'namespace', + 'The namespace to lookup. Defaults to root namespace', + false ); } @@ -38,7 +41,7 @@ class WantedPagesCLI extends DokuCLI { protected function main(DokuCLI_Options $options) { if($options->args) { - $startdir = dirname(wikiFN($options->args[0] . ':xxx')); + $startdir = dirname(wikiFN($options->args[0].':xxx')); } else { $startdir = dirname(wikiFN('xxx')); } @@ -54,7 +57,7 @@ class WantedPagesCLI extends DokuCLI { sort($wanted_pages); foreach($wanted_pages as $page) { - print $page . "\n"; + print $page."\n"; } } @@ -62,7 +65,7 @@ class WantedPagesCLI extends DokuCLI { if($entry == '.' || $entry == '..') { return WantedPagesCLI::DIR_CONTINUE; } - if(is_dir($basepath . '/' . $entry)) { + if(is_dir($basepath.'/'.$entry)) { if(strpos($entry, '_') === 0) { return WantedPagesCLI::DIR_CONTINUE; } @@ -78,7 +81,7 @@ class WantedPagesCLI extends DokuCLI { static $trunclen = null; if(!$trunclen) { global $conf; - $trunclen = strlen($conf['datadir'] . ':'); + $trunclen = strlen($conf['datadir'].':'); } if(!is_dir($dir)) { @@ -92,11 +95,11 @@ class WantedPagesCLI extends DokuCLI { if($status == WantedPagesCLI::DIR_CONTINUE) { continue; } else if($status == WantedPagesCLI::DIR_NS) { - $pages = array_merge($pages, $this->get_pages($dir . '/' . $entry)); + $pages = array_merge($pages, $this->get_pages($dir.'/'.$entry)); } else { $page = array( - 'id' => pathID(substr($dir . '/' . $entry, $trunclen)), - 'file' => $dir . '/' . $entry, + 'id' => pathID(substr($dir.'/'.$entry, $trunclen)), + 'file' => $dir.'/'.$entry, ); $pages[] = $page; } |