Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15397404
D9076.id21555.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
873 B
Referenced Files
None
Subscribers
None
D9076.id21555.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 17, 7:57 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705078
Default Alt Text
D9076.id21555.diff (873 B)
Attached To
Mode
D9076: Attempt to automatically build XHPAST.
Attached
Detach File
Event Timeline
Log In to Comment