Create a PHP wrapper class for the XHPAST binary
Summary:
Create a PhutilXHPASTBinary class which wraps the XHPAST binary, replacing the following functions:
- xhpast_build() is replaced by PhutilXHPASTBinary::build().
- xhpast_get_binary_path is replaced by PhutilXHPASTBinary::getPath().
- xhpast_get_build_instructions is replaced by PhutilXHPASTBinary::getBuildInstructions().
- xhpast_get_parser_future is replaced by PhutilXHPASTBinary::getParserFuture().
- xhpast_is_available is replaced by PhutilXHPASTBinary::isAvailable().
- xhpast_version is replaced by PhutilXHPASTBinary::getVersion().
Additionally improve handling of out-of-date XHPAST, a minor issue I stumbled across this whilst testing D11516. Basically, calling xhpast_is_available() followed by xhpast_build() followed by xhpast_is_available() has somewhat unexpected results.
Test Plan:
Pre-patch, the following code caused an infinite loop. Post-patch, the loop was correctly terminated.
while (!xhpast_is_available()) { echo "Building\n"; xhpast_build(); }
Reviewers: epriestley, Blessed Reviewers
Reviewed By: epriestley, Blessed Reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11517