From 42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 11:30:27 +0200 Subject: Many PHPDocs, some unused and dyn declared vars many PHPDocs some unused variables some dynamically declared variables declared --- bin/gittool.php | 6 +++--- bin/wantedpages.php | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/gittool.php b/bin/gittool.php index 6944dde57..7991a9997 100755 --- a/bin/gittool.php +++ b/bin/gittool.php @@ -101,7 +101,7 @@ class GitToolCLI extends DokuCLI { /** * Tries to install the given extensions using git clone * - * @param $extensions + * @param array $extensions */ public function cmd_clone($extensions) { $errors = array(); @@ -130,7 +130,7 @@ class GitToolCLI extends DokuCLI { /** * Tries to install the given extensions using git clone with fallback to install * - * @param $extensions + * @param array $extensions */ public function cmd_install($extensions) { $errors = array(); @@ -291,7 +291,7 @@ class GitToolCLI extends DokuCLI { * Returns the repository for the given extension * * @param $extension - * @return bool|string + * @return false|string */ private function getSourceRepo($extension) { /** @var helper_plugin_extension_extension $ext */ diff --git a/bin/wantedpages.php b/bin/wantedpages.php index 8fc4ba74f..54bfd4755 100755 --- a/bin/wantedpages.php +++ b/bin/wantedpages.php @@ -61,6 +61,13 @@ class WantedPagesCLI extends DokuCLI { } } + /** + * Determine directions of the search loop + * + * @param string $entry + * @param string $basepath + * @return int + */ protected function dir_filter($entry, $basepath) { if($entry == '.' || $entry == '..') { return WantedPagesCLI::DIR_CONTINUE; @@ -77,6 +84,13 @@ class WantedPagesCLI extends DokuCLI { return WantedPagesCLI::DIR_CONTINUE; } + /** + * Collects recursively the pages in a namespace + * + * @param string $dir + * @return array + * @throws DokuCLI_Exception + */ protected function get_pages($dir) { static $trunclen = null; if(!$trunclen) { @@ -108,6 +122,12 @@ class WantedPagesCLI extends DokuCLI { return $pages; } + /** + * Parse instructions and returns the non-existing links + * + * @param array $page array with page id and file path + * @return array + */ function internal_links($page) { global $conf; $instructions = p_get_instructions(file_get_contents($page['file'])); -- cgit v1.2.3 From 7e8500eea1e53b1de0e0f70400664afa442cd08d Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 2 Oct 2014 14:55:24 +0200 Subject: PHPDocs and some improvements --- bin/gittool.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/gittool.php b/bin/gittool.php index 7991a9997..cbadb5bfa 100755 --- a/bin/gittool.php +++ b/bin/gittool.php @@ -206,12 +206,13 @@ class GitToolCLI extends DokuCLI { * Install extension from the given download URL * * @param string $ext - * @return bool + * @return bool|null */ private function downloadExtension($ext) { /** @var helper_plugin_extension_extension $plugin */ $plugin = plugin_load('helper', 'extension_extension'); if(!$ext) die("extension plugin not available, can't continue"); + $plugin->setExtension($ext); $url = $plugin->getDownloadURL(); @@ -297,6 +298,7 @@ class GitToolCLI extends DokuCLI { /** @var helper_plugin_extension_extension $ext */ $ext = plugin_load('helper', 'extension_extension'); if(!$ext) die("extension plugin not available, can't continue"); + $ext->setExtension($extension); $repourl = $ext->getSourcerepoURL(); -- cgit v1.2.3 From 47914fdf9a86d3ce2b75fc6f7743bc604711e6aa Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 17 Oct 2014 17:25:20 +0200 Subject: -k requires parameter. fixes #902 --- bin/striplangs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/striplangs.php b/bin/striplangs.php index 6335bc84c..82d27d462 100755 --- a/bin/striplangs.php +++ b/bin/striplangs.php @@ -26,7 +26,8 @@ class StripLangsCLI extends DokuCLI { $options->registerOption( 'keep', 'Comma separated list of languages to keep in addition to English.', - 'k' + 'k', + 'langcodes' ); $options->registerOption( 'english-only', -- cgit v1.2.3 From bf00b3965f373b9497752ef97b25d9f29be35ca0 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 9 Feb 2015 10:22:12 +0100 Subject: fix username handling in dwpage CLI tool. closes #1019 --- bin/dwpage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/dwpage.php b/bin/dwpage.php index a777fd3e1..d7f6e9bb8 100755 --- a/bin/dwpage.php +++ b/bin/dwpage.php @@ -28,7 +28,8 @@ class PageCLI extends DokuCLI { $options->registerOption( 'user', 'work as this user. defaults to current CLI user', - 'u' + 'u', + 'username' ); $options->setHelp( 'Utility to help command line Dokuwiki page editing, allow '. @@ -239,6 +240,7 @@ class PageCLI extends DokuCLI { if($this->force) $this->deleteLock($wiki_id); $_SERVER['REMOTE_USER'] = $this->username; + if(checklock($wiki_id)) { $this->error("Page $wiki_id is already locked by another user"); exit(1); @@ -246,7 +248,6 @@ class PageCLI extends DokuCLI { lock($wiki_id); - $_SERVER['REMOTE_USER'] = '_'.$this->username.'_'; if(checklock($wiki_id) != $this->username) { $this->error("Unable to obtain lock for $wiki_id "); var_dump(checklock($wiki_id)); -- cgit v1.2.3