PHP class to interact with YunoHost API

Hello all,
I have coded a first draft of a PHP class to interact with YunoHost API:
This can be used to manage YunoHost entirely from a PHP page or application (such as a portal to create users).

The Github details different examples such as:

Return the list of users

$ynh = new YNH_API(“YunoHost server IP or hostname”, “admin password”);

if ($ynh->login()) {
$users = $ynh->get("/users");
} else {
print(“Login to YunoHost failed.\n”);

Everything presented here can be done with this PHP class: List of API functions

At the moment it is quite rudimentary: you need to get, post, put, delete manually.
I plan to integrate all API functions later on.

Anyone interested to test and use?


So your php class requires root access level ?

No it just needs the server’s IP or hostname and the YunoHost admin password.
It does not access the server as root, it just uses the YunoHost API (like the web interface)