0

With ArangoDB-PHP I can easily run AQL querys, but is it possible to use (means "execute") Foxx applications (i.e. when I install foxx/util-sessions-local from https://github.com/arangodb-foxx/util-sessions-local) - how to use the create/update/delete session services by ArangoDB-PHP? Could it be achieved by running AQL or user javascript functions?

A look at ArangoDB-PHP's Transaction class seems to be not the correct solution because it requires read and write collections name ... which I can't provide for more complex Foxx applications.

2
  • Foxx-apps are accessed via HTTP -- use a browser-class, or file_get_contents on hand-mangled URLs or somesuch. Commented Jan 24, 2017 at 13:07
  • Hi Tom, thanks, I know I could build a Foxx service that could be called by browser like clients. I was thinking about some kind of "pre-compiled transactions" callable by AQL. Commented Jan 26, 2017 at 7:49

1 Answer 1

1

To the best of my knowledge, you cannot call a foxx-endpoint from inside of an AQL-transaction -- intended is that you use AQL-transactions in your foxx-endpoint code. So if you need to execute stuff transactional you might need to provide additional endpoints that execute the code in question inside of a transactions action.

To answer the question of the title of your post, there is an easy way to call foxx endpoints with only arangodb-php available (assuming the application returns json-data):

// $connection is your triagens\Arangodb\Connection instance
//       ArangodbClient\Connection in newer versions
$connection->post("/mountpoint/endpoint", $json_body, $headers)->getJson();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.