From 1c36b3d86f90185519cadaad85251922dc771fe1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 16 May 2014 09:11:15 +0200 Subject: code reformat --- bin/striplangs.php | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'bin/striplangs.php') diff --git a/bin/striplangs.php b/bin/striplangs.php index 8567551ec..6335bc84c 100755 --- a/bin/striplangs.php +++ b/bin/striplangs.php @@ -1,10 +1,13 @@ #!/usr/bin/php setHelp( - 'Remove all languages from the installation, besides the ones specified. English language ' . - 'is never removed!' + 'Remove all languages from the installation, besides the ones specified. English language '. + 'is never removed!' ); $options->registerOption( - 'keep', - 'Comma separated list of languages to keep in addition to English.', - 'k' + 'keep', + 'Comma separated list of languages to keep in addition to English.', + 'k' ); $options->registerOption( - 'english-only', - 'Remove all languages except English', - 'e' + 'english-only', + 'Remove all languages except English', + 'e' ); } @@ -52,16 +55,16 @@ class StripLangsCLI extends DokuCLI { } // Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array - $this->stripDirLangs(realpath(dirname(__FILE__) . '/../inc/lang'), $keep); - $this->processExtensions(realpath(dirname(__FILE__) . '/../lib/plugins'), $keep); - $this->processExtensions(realpath(dirname(__FILE__) . '/../lib/tpl'), $keep); + $this->stripDirLangs(realpath(dirname(__FILE__).'/../inc/lang'), $keep); + $this->processExtensions(realpath(dirname(__FILE__).'/../lib/plugins'), $keep); + $this->processExtensions(realpath(dirname(__FILE__).'/../lib/tpl'), $keep); } /** * Strip languages from extensions * - * @param string $path path to plugin or template dir - * @param array $keep_langs languages to keep + * @param string $path path to plugin or template dir + * @param array $keep_langs languages to keep */ protected function processExtensions($path, $keep_langs) { if(is_dir($path)) { @@ -69,9 +72,9 @@ class StripLangsCLI extends DokuCLI { foreach($entries as $entry) { if($entry != "." && $entry != "..") { - if(is_dir($path . '/' . $entry)) { + if(is_dir($path.'/'.$entry)) { - $plugin_langs = $path . '/' . $entry . '/lang'; + $plugin_langs = $path.'/'.$entry.'/lang'; if(is_dir($plugin_langs)) { $this->stripDirLangs($plugin_langs, $keep_langs); @@ -85,17 +88,17 @@ class StripLangsCLI extends DokuCLI { /** * Strip languages from path * - * @param string $path path to lang dir - * @param array $keep_langs languages to keep + * @param string $path path to lang dir + * @param array $keep_langs languages to keep */ protected function stripDirLangs($path, $keep_langs) { $dir = dir($path); while(($cur_dir = $dir->read()) !== false) { - if($cur_dir != '.' and $cur_dir != '..' and is_dir($path . '/' . $cur_dir)) { + if($cur_dir != '.' and $cur_dir != '..' and is_dir($path.'/'.$cur_dir)) { if(!in_array($cur_dir, $keep_langs, true)) { - io_rmdir($path . '/' . $cur_dir, true); + io_rmdir($path.'/'.$cur_dir, true); } } } -- cgit v1.2.3