Page MenuHomePhabricator

D21718.id51755.diff
No OneTemporary

D21718.id51755.diff

diff --git a/src/moduleutils/PhutilLibraryMapBuilder.php b/src/moduleutils/PhutilLibraryMapBuilder.php
--- a/src/moduleutils/PhutilLibraryMapBuilder.php
+++ b/src/moduleutils/PhutilLibraryMapBuilder.php
@@ -12,7 +12,6 @@
final class PhutilLibraryMapBuilder extends Phobject {
private $root;
- private $quiet = true;
private $subprocessLimit = 8;
private $fileSymbolMap;
@@ -38,19 +37,6 @@
$this->root = $root;
}
- /**
- * Control status output. Use `--quiet` to set this.
- *
- * @param bool If true, don't show status output.
- * @return this
- *
- * @task map
- */
- public function setQuiet($quiet) {
- $this->quiet = $quiet;
- return $this;
- }
-
/**
* Control subprocess parallelism limit. Use `--limit` to set this.
*
@@ -108,12 +94,11 @@
public function buildAndWriteMap() {
$library_map = $this->buildMap();
- $this->log(pht('Writing map...'));
$this->writeLibraryMap($library_map);
}
/**
- * Write a status message to the user, if not running in quiet mode.
+ * Write a status message to the user on stderr.
*
* @param string Message to write.
* @return this
@@ -121,9 +106,7 @@
* @task map
*/
private function log($message) {
- if (!$this->quiet) {
- @fwrite(STDERR, "%s\n", $message);
- }
+ @fprintf(STDERR, "%s\n", $message);
return $this;
}
@@ -239,7 +222,7 @@
try {
Filesystem::writeFile($cache_file, $json);
} catch (FilesystemException $ex) {
- $this->log(pht('Unable to save the cache!'));
+ $this->log(pht('Unable to save the cache: %s', $ex->getMessage()));
}
}
@@ -251,7 +234,6 @@
* @task symbol
*/
public function dropSymbolCache() {
- $this->log(pht('Dropping symbol cache...'));
Filesystem::remove($this->getPathForSymbolCache());
}
@@ -451,14 +433,10 @@
*/
private function analyzeLibrary() {
// Identify all the ".php" source files in the library.
- $this->log(pht('Finding source files...'));
$source_map = $this->loadSourceFileMap();
- $this->log(
- pht('Found %s files.', new PhutilNumber(count($source_map))));
// Load the symbol cache with existing parsed symbols. This allows us
// to remap libraries quickly by analyzing only changed files.
- $this->log(pht('Loading symbol cache...'));
$symbol_cache = $this->loadSymbolCache();
// If the XHPAST binary is not up-to-date, build it now. Otherwise,
@@ -481,23 +459,12 @@
}
$futures[$file] = $this->buildSymbolAnalysisFuture($file);
}
- $this->log(
- pht('Found %s files in cache.', new PhutilNumber(count($symbol_map))));
// Run the analyzer on any files which need analysis.
if ($futures) {
$limit = $this->subprocessLimit;
- $this->log(
- pht(
- 'Analyzing %s file(s) with %s subprocess(es)...',
- phutil_count($futures),
- new PhutilNumber($limit)));
-
$progress = new PhutilConsoleProgressBar();
- if ($this->quiet) {
- $progress->setQuiet(true);
- }
$progress->setTotal(count($futures));
$futures = id(new FutureIterator($futures))
@@ -525,8 +492,6 @@
$this->writeSymbolCache($symbol_map, $source_map);
// Our map is up to date, so either show it on stdout or write it to disk.
- $this->log(pht('Building library map...'));
-
$this->librarySymbolMap = $this->buildLibraryMap($symbol_map);
}
diff --git a/support/lib/rebuild-map.php b/support/lib/rebuild-map.php
--- a/support/lib/rebuild-map.php
+++ b/support/lib/rebuild-map.php
@@ -16,10 +16,6 @@
$args->parseStandardArguments();
$args->parse(
array(
- array(
- 'name' => 'quiet',
- 'help' => pht('Do not write status messages to stderr.'),
- ),
array(
'name' => 'drop-cache',
'help' => pht(
@@ -56,7 +52,6 @@
$root = Filesystem::resolvePath(head($root));
$builder = new PhutilLibraryMapBuilder($root);
-$builder->setQuiet($args->getArg('quiet'));
$builder->setSubprocessLimit($args->getArg('limit'));
if ($args->getArg('drop-cache')) {

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 15, 4:30 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7327939
Default Alt Text
D21718.id51755.diff (4 KB)

Event Timeline