public function getCacheVersion() { $version = '2'; $path = xhpast_get_binary_path(); if (Filesystem::pathExists($path)) { $version .= '-' . md5_file($path); } return $version; }
/** * @group xhpast */ function xhpast_get_parser_future($data) { if (!xhpast_is_available()) { throw new Exception(xhpast_get_build_instructions()); } $future = new ExecFuture('%s', xhpast_get_binary_path()); $future->write($data); return $future; }
public final function getCacheVersion() { $parts = array(); $parts[] = $this->getVersion(); $path = xhpast_get_binary_path(); if (Filesystem::pathExists($path)) { $parts[] = md5_file($path); } return implode('-', $parts); }
protected function execute(ConduitAPIRequest $request) { $path = xhpast_get_binary_path(); if (!Filesystem::pathExists($path)) { throw new ConduitException('ERR-NOT-FOUND'); } list($err, $stdout) = exec_manual('%s --version', $path); if ($err) { throw new ConduitException('ERR-COMMAND-FAILED'); } return trim($stdout); }
/** * @group xhpast */ function xhpast_get_parser_future($data) { if (!xhpast_is_available()) { 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; }