PHP Server – access points
Pydio is based on the PHP scripting language for the server-side, the main entry point being the /index.php of the root of the installation. Queries parameters are sent via HTTP GET or HTTP POST to the script, and responses can be sent back with various content types, depending on the action. The most common format is currently XML (always encoded in UTF-8) but JSON can be used for some specific actions (particularly in the Settings panel actions), and the downloads trigger “force-download” headers and binary data.
The standard API usage would be calling index.php with at least a get_action parameter. This parameter can be seen as the target service the query is adressing. Additional parameters would then depend on this get_action value. This “actions” are in fact declared by all plugins, through XML files. See the Plugins Architecture paragraph for more details. Below, you can see a trace of the queries sent by the client to the server. The secure_token is a unique token attached to this instance of the GUI, for CSRF protection.
As explained in the Administrator Guide, all these actions can also be triggered from the command line, using PHP CLI and loading the /cmd.php file. Action are in that case passed through the -a parameter, along with a repository id, users credential, and additional action parameters. The output is currently exactly the same as it would though an Http call.
In v5.0.0, we introduced a /rest.php access point to server the API in a more RESTful oriented way. If a “restParams” attribute is declared in the server callbacks in the XML files, and action is available through a REST call via /api/repository_alias/action_name/restParameters. Additional POST/GET parameters can be appended to the request as well.
The configuration option AJXP_CLIENT_DEBUG in the
conf/bootstrap_context.php file is here for that: when set to true, the GUI no more calls the compiled version of the files, but each file separately. Thus you can debug much more easily, and once you’re finished, you compile and refresh your application.
Read more about that in the Web Application Section of that guide.Back to top