Changeset View
Changeset View
Standalone View
Standalone View
src/moduleutils/PhutilLibraryMapBuilder.php
| Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | /* -( Symbol Analysis and Caching )---------------------------------------- */ | ||||
| * | * | ||||
| * @param string Relative path to the source file to analyze. | * @param string Relative path to the source file to analyze. | ||||
| * @return Future Analysis future. | * @return Future Analysis future. | ||||
| * | * | ||||
| * @task symbol | * @task symbol | ||||
| */ | */ | ||||
| private function buildSymbolAnalysisFuture($file) { | private function buildSymbolAnalysisFuture($file) { | ||||
| $absolute_file = $this->getPath($file); | $absolute_file = $this->getPath($file); | ||||
| return self::newExtractSymbolsFuture( | |||||
| array(), | |||||
| array($absolute_file)); | |||||
| } | |||||
| private static function newExtractSymbolsFuture(array $flags, array $paths) { | |||||
| $bin = dirname(__FILE__).'/../../support/lib/extract-symbols.php'; | $bin = dirname(__FILE__).'/../../support/lib/extract-symbols.php'; | ||||
| return new ExecFuture('php -f %R -- --ugly %R', $bin, $absolute_file); | return new ExecFuture( | ||||
| 'php -f %R -- --ugly %Ls -- %Ls', | |||||
| $bin, | |||||
| $flags, | |||||
| $paths); | |||||
| } | |||||
| public static function newBuiltinMap() { | |||||
| $future = self::newExtractSymbolsFuture( | |||||
| array('--builtins'), | |||||
| array()); | |||||
| list($json) = $future->resolvex(); | |||||
| return phutil_json_decode($json); | |||||
| } | } | ||||
| /* -( Source Management )-------------------------------------------------- */ | /* -( Source Management )-------------------------------------------------- */ | ||||
| /** | /** | ||||
| * Build a map of all source files in a library to hashes of their content. | * Build a map of all source files in a library to hashes of their content. | ||||
| * Returns an array like this: | * Returns an array like this: | ||||
| ▲ Show 20 Lines • Show All 235 Lines • Show Last 20 Lines | |||||