Index: branches/5.3.x/core/kernel/utility/ClassDiscovery/ClassMapBuilder.php =================================================================== diff -u -N -r16163 -r16181 --- branches/5.3.x/core/kernel/utility/ClassDiscovery/ClassMapBuilder.php (.../ClassMapBuilder.php) (revision 16163) +++ branches/5.3.x/core/kernel/utility/ClassDiscovery/ClassMapBuilder.php (.../ClassMapBuilder.php) (revision 16181) @@ -173,7 +173,7 @@ /** * Builds class map. * - * @return void + * @return array * @throws \RuntimeException When PHP parser not found. */ public function build() @@ -184,16 +184,17 @@ throw new \RuntimeException($error_msg); } + $table_output = array(); $scan_path = preg_replace('/^' . preg_quote(FULL_PATH, '/') . '/', '...', $this->scanPath, 1); - echo $this->strPad('path "' . $scan_path . '"', 40); + $table_output[] = $scan_path; // The "Path" column. $this->load(self::CACHE_FILE_STRUCTURE, true); $this->load(self::CACHE_FILE_HASHES, true); $start = microtime(true); $files = $this->scan(); - echo $this->strPad('scanned in ' . sprintf('%.4f', microtime(true) - $start) . 's', 25); + $table_output[] = sprintf('%.4f', microtime(true) - $start) . 's'; // The "Scanned in" column. $start = microtime(true); @@ -203,28 +204,16 @@ $this->parseFile($file); } - echo $this->strPad('parsed in ' . sprintf('%.4f', microtime(true) - $start) . 's', 25); - echo PHP_EOL; + $table_output[] = sprintf('%.4f', microtime(true) - $start) . 's'; // The "Parsed in" column. ksort($this->classToFileMap); ksort($this->fileHashes); ksort($this->classInfo); $this->store(self::CACHE_FILE_STRUCTURE); $this->store(self::CACHE_FILE_HASHES); - } - /** - * Pads text with spaces from right side. - * - * @param string $text Text. - * @param integer $length Pad length. - * - * @return string - */ - protected function strPad($text, $length) - { - return str_pad($text, $length, ' ', STR_PAD_RIGHT); + return $table_output; } /** @@ -385,7 +374,7 @@ // {$at}codingStandardsIgnoreFile /** - * This file is automatically {$at}generated. Use 'php tools/build_class_map.php' to rebuild it. + * This file is automatically {$at}generated. Please use 'in-portal classmap:rebuild' command to rebuild it. */ return {$cache};