Download the PHP package dotkernel/api without Composer
On this page you can find all versions of the php package dotkernel/api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dotkernel/api
More information about dotkernel/api
Files in dotkernel/api
Informations about the package api
Dotkernel API
Dotkernel API is a PHP skeleton app for building REST APIs using Laminas and Mezzio components and implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.
Dotkernel API is an alternative for legacy Laminas API Tools (formerly Apigility) applications and is based on Enrico Zimuel's Zend Expressive API - Skeleton example.
Live demo.
Documentation
Documentation is available at: https://docs.dotkernel.org/api-documentation/
Badges
Getting Started
Clone the project
Using your terminal, navigate inside the directory you want to download the project files into. Make sure that the directory is empty before proceeding to the download process. Once there, run the following command:
Install the project dependencies
Development mode
Do not enable development mode in production!
If you're installing the project for development, you should enable development mode by running:
You can disable development mode by running:
You can check the development status by running:
Prepare config files
- duplicate
config/autoload/cors.local.php.dist
asconfig/autoload/cors.local.php
<- if your API is consumed by another application, make sure configure theallowed_origins
- duplicate
config/autoload/local.php.dist
asconfig/autoload/local.php
- optional: to run/create tests, duplicate
config/autoload/local.test.php.dist
asconfig/autoload/local.test.php
<- this creates a new in-memory database that your tests will run on
Setup database
Use an existing empty one or create a new MariaDB/MySQL database.
Recommended collation:
utf8mb4_general_ci
.
With a database created, fill out the database connection params in config/autoload/local.php
under $databases['default']
.
Creating migrations
Create a new migration by running:
The new migration file will be placed in src/Core/src/App/src/Migration/
.
Running migrations
Execute a new migration by running:
This command will prompt you to confirm that you want to run it:
WARNING! You are about to execute a migration in database "
<database>
" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]:
Hit Enter
to confirm the operation.
Executing fixtures
Fixtures are used to seed the database with initial values and must be executed after migrating the database.
To list all the fixtures, run:
This will output all the fixtures in the order of execution.
To execute all fixtures, run:
To execute a specific fixture, run:
More details on how fixtures work can be found in dotkernel/dot-data-fixtures
documentation.
Mail configuration
If your application sends emails, you must configure an outgoing mail server under config/autoload/mail.global.php
.
Test the installation
Run the following command in your project's directory to start PHPs built-in server:
Running command
composer serve
will do the same thing, but the server will time out after a couple of minutes.
Sending a GET request to the application's home page should output the following message:
All versions of api with dependencies
ext-gd Version *
ext-json Version *
dotkernel/dot-cache Version ^4.3
dotkernel/dot-cli Version ^3.9.0
dotkernel/dot-data-fixtures Version ^1.4.0
dotkernel/dot-dependency-injection Version ^1.2
dotkernel/dot-errorhandler Version ^4.0.0
dotkernel/dot-mail Version ^5.3.0
dotkernel/dot-response-header Version ^3.5.0
dotkernel/dot-router Version ^1.0.5
laminas/laminas-authentication Version ^2.18
laminas/laminas-component-installer Version ^3.5.0
laminas/laminas-config-aggregator Version ^1.18.0
laminas/laminas-hydrator Version ^4.16.0
laminas/laminas-inputfilter Version ^2.31.0
laminas/laminas-stdlib Version ^3.20.0
mezzio/mezzio Version ^3.20.1
mezzio/mezzio-authentication-oauth2 Version ^2.11.0
mezzio/mezzio-authorization-acl Version ^1.11.0
mezzio/mezzio-authorization-rbac Version ^1.8.0
mezzio/mezzio-cors Version ^1.13.0
mezzio/mezzio-fastroute Version ^3.12.0
mezzio/mezzio-hal Version ^2.10.1
mezzio/mezzio-helpers Version ^5.18
mezzio/mezzio-problem-details Version ^1.15.0
ramsey/uuid Version ^4.5.0
ramsey/uuid-doctrine Version ^2.1.0
roave/psr-container-doctrine Version ^5.2.2
symfony/filesystem Version ^7.2.0
zircote/swagger-php Version ^5.0.7