Based on Laminas API Tools skeleton application.
API documentation is exposed via the /api-tools/documentation
.
Please see the composer.json file.
First, clone the repository:
# git clone https://github.com/mihsar/test-php-heatmap-laminas.git # optionally, specify the directory in which to clone
$ cd path/to/install
At this point, you need to use Composer to install dependencies. Assuming you already have Composer:
$ composer install
Once you have the basic installation, you need to put it in development mode:
$ cd path/to/install
$ composer development-enable
Next you can use the built-in web server in PHP (only for development) as described here
Check the original info here
If you develop or deploy using Docker, we provide configuration for you.
Prepare your development environment using docker compose:
$ git clone https://github.com/mihsar/test-php-heatmap-laminas
$ cd test-php-heatmap-laminas
$ docker-compose build
# Install dependencies via composer, if you haven't already:
$ docker-compose run apigility composer install
# Copy separate local db connection details: username and password
$ docker-compose run apigility cp ./config/autoload/db.local.php.dist ./config/autoload/db.local.php
# Enable development mode:
$ docker-compose run apigility composer development-enable
Start the container:
$ docker-compose up
Access application from https://localhost:8080/
or https://<boot2docker ip>:8080/
if on Windows or Mac.
You may also use the provided Dockerfile
directly if desired. And set up db connection details
in db.global.php and set username and password in db.local.php
.
Or to manipulate development mode:
$ docker-compose run apigility composer development-enable
$ docker-compose run apigility composer development-disable
$ docker-compose run apigility composer development-status
A database service is provided inside docker-compose config, and it should import sql files provided with repo
in ./data/mysql-dump/
. Port 33060 is mapped to access from host as localhost:33060
using
username/password
details provided in docker-composer config.
The app ships with a few basic tests for the endpoints exposed in documentation.
# Run PHPUnit tests:
$ composer test
# You can execute in container as well (make sure `docker-compose up` has run, it needs db connection):
$ docker-compose exec apigility composer test