2017-09-05 11:48:35 +02:00
|
|
|
## API client class usage examples
|
2018-08-28 14:44:49 +02:00
|
|
|
|
2021-09-29 10:41:39 +02:00
|
|
|
This directory contains some PHP code examples which demonstrate usage of the PHP API client class and can be used as a
|
|
|
|
good starting point for your own custom code.
|
2017-09-05 11:48:35 +02:00
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
2021-09-29 10:41:39 +02:00
|
|
|
Copy the appropriate example file to your working directory together with a copy of the config.template.php file which
|
|
|
|
should be renamed to config.php. Then update the contents of your new config.php with your controller details and
|
|
|
|
credentials and modify the example file as required to fit your needs.
|
2017-09-05 11:48:35 +02:00
|
|
|
|
2021-09-29 10:41:39 +02:00
|
|
|
Also make sure to update the path for the composer autoloader file (`vendor/autoload.php`) or the file containing the
|
|
|
|
Class itself (`src/Client.php`) in your `require_once()` statement as required.
|
2018-08-19 12:00:19 +02:00
|
|
|
|
2018-11-05 12:18:10 +01:00
|
|
|
#### Executing scripts from the CLI
|
|
|
|
|
2021-09-29 10:41:39 +02:00
|
|
|
Most of the included example scripts can be run from the CLI or shell as follows after the necessary credentials and
|
|
|
|
parameters have been added or updated:
|
2018-11-05 12:18:10 +01:00
|
|
|
|
|
|
|
```sh
|
|
|
|
$ php list_site_health.php
|
|
|
|
```
|
|
|
|
|
|
|
|
NOTE: this does require the `php-cli` module to be installed
|
|
|
|
|
2017-09-05 11:48:35 +02:00
|
|
|
### Contribute
|
|
|
|
|
2021-09-29 10:41:39 +02:00
|
|
|
If you would like to share your own example file(s), please open an issue and include your code there or else create a
|
|
|
|
pull request.
|
2017-09-05 11:48:35 +02:00
|
|
|
|
|
|
|
## Important Disclaimer
|
|
|
|
|
2018-03-13 13:39:38 +01:00
|
|
|
Use these examples at your own risk!
|