Page MenuHomePhabricator

D9076.diff
No OneTemporary

D9076.diff

diff --git a/src/parser/xhpast/bin/xhpast_parse.php b/src/parser/xhpast/bin/xhpast_parse.php
--- a/src/parser/xhpast/bin/xhpast_parse.php
+++ b/src/parser/xhpast/bin/xhpast_parse.php
@@ -54,10 +54,24 @@
*/
function xhpast_get_parser_future($data) {
if (!xhpast_is_available()) {
- throw new Exception(xhpast_get_build_instructions());
+ try {
+ // Try to build XHPAST automatically. If we can't then just ask the user
+ // to build it themselves.
+ xhpast_build();
+ } catch (CommandException $e) {
+ throw new Exception(xhpast_get_build_instructions());
+ }
}
$future = new ExecFuture('%s', xhpast_get_binary_path());
$future->write($data);
return $future;
}
+
+/**
+ * @group xhpast
+ */
+function xhpast_build() {
+ $root = phutil_get_library_root('phutil');
+ execx('%s', $root.'/../scripts/build_xhpast.sh');
+}

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 4:46 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6281985
Default Alt Text
D9076.diff (873 B)

Event Timeline