@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve symbol generation scripts

Summary: Currently the symbol generation scripts fail if passed a list containing no files because `explode("\n", $input)` returns `array("")` rather than `array()`. This means that a generic Harbormaster Build Plan with a step which executes `find . -type f -name '*.php' | ./scripts/generate_php_symbols.php` won't work because it fails in repositories that don't contain any PHP code.

Test Plan: Ran `echo | generate_php_symbols` and saw no output instead of an exception.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D19588

+8
+4
scripts/symbols/generate_ctags_symbols.php
··· 39 39 $futures = array(); 40 40 41 41 foreach (explode("\n", trim($input)) as $file) { 42 + if (!strlen($file)) { 43 + continue; 44 + } 45 + 42 46 $file = Filesystem::readablePath($file); 43 47 $futures[$file] = ctags_get_parser_future($file); 44 48 }
+4
scripts/symbols/generate_php_symbols.php
··· 27 27 $futures = array(); 28 28 29 29 foreach (explode("\n", trim($input)) as $file) { 30 + if (!strlen($file)) { 31 + continue; 32 + } 33 + 30 34 $file = Filesystem::readablePath($file); 31 35 $data[$file] = Filesystem::readFile($file); 32 36 $futures[$file] = PhutilXHPASTBinary::getParserFuture($data[$file]);