X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FExtract.php;h=1f84d442b5031d69f929c9d00a428eadb157f9d6;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=daa14d00eb23472729a6aae42812918c2298886a;hpb=13a10b8f20ac7c5927c39d9e80e1a7d515385736;p=friendica.git diff --git a/src/Console/Extract.php b/src/Console/Extract.php index daa14d00eb..1f84d442b5 100644 --- a/src/Console/Extract.php +++ b/src/Console/Extract.php @@ -1,6 +1,6 @@ getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -72,9 +75,8 @@ HELP; $arr = []; $files = array_merge( - ['index.php', 'boot.php'], + ['index.php'], glob('mod/*'), - glob('include/*'), glob('addon/*/*'), $this->globRecursive('src') ); @@ -120,10 +122,10 @@ HELP; $arr[] = $matchtkns[0]; - $s .= '$a->strings[' . $matchtkns[0] . "] = array(\n"; + $s .= '$a->strings[' . $matchtkns[0] . "] = [\n"; $s .= "\t0 => " . $matchtkns[0] . ",\n"; $s .= "\t1 => " . $matchtkns[1] . ",\n"; - $s .= ");\n"; + $s .= "];\n"; } } } @@ -141,9 +143,17 @@ HELP; return 0; } - private function globRecursive($path) { - $dir_iterator = new \RecursiveDirectoryIterator($path); - $iterator = new \RecursiveIteratorIterator($dir_iterator, \RecursiveIteratorIterator::SELF_FIRST); + /** + * Returns an array with found files and directories including their paths. + * + * @param string $path Base path to scan + * + * @return array A flat array with found files and directories + */ + private function globRecursive(string $path): array + { + $dir_iterator = new RecursiveDirectoryIterator($path); + $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); $return = []; foreach ($iterator as $file) {