Download the PHP package peroxide/api-skeleton without Composer

On this page you can find all versions of the php package peroxide/api-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api-skeleton

Peroxide: API-Skeleton

API skeleton: Built on top of Slim and OpenSwoole, our API skeleton is designed for microservices projects, prioritizing both performance and simplicity.

How to install

Using composer to install the skeleton:

Or

Please note: Running Composer without the --ignore-platform-reqs flag may result in errors if you haven't installed the OpenSwoole PHP extension.

Setup

Create your local .env file


To start the local server, you'll need Docker and Compose up and running under your system user. No fancy commands needed, just make sure Docker and Compose are good to go.

To run as docker compose

Testing

Health check route

Create your code

Router

Routes can be declared on config/routes.php, you are free to compose your route files like the example:

For more details read Slim 4 Routes resolution page:

https://www.slimframework.com/docs/v4/objects/routing.html

Obs: All routes are managed by methods specified in the router configuration, which utilize callable classes with the '__invoke' method, simple methods, or callable functions.


Our Container

We've developed our straightforward container component, named peroxide/container. With it, injecting dependencies into your classes becomes a breeze: Controllers, UseCases, Commands, DTOs, and Domains in a declarative manner. For further insights, check out the documentation:

https://github.com/Peroxide-PHP/peroxide-container

Container resolution follows the PSR-11 standard, offering the flexibility to adjust the container mechanism according to your preferences, you can even swap it out entirely if needed.


Migrations

We're offering a migration component called Phinx, which is a standalone library for implementing migrations without being tied to any specific frameworks.

Here how to use it:

Example of migration class:

For more details about phinx read: https://book.cakephp.org/phinx/0/en/migrations.html


Seeders

Session under construction...

Quality tools

Code sniffer

CS Fixer

Tests with PHPUnit

PHPStan

Mess Detector

Performance benchmarks

Coming soon...

Attention!

This skeleton server runs on the OpenSwoole runtime, enabling executions through coroutines.

It's crucial to be mindful of socket communications, using PDO with Postgres can block the event loop, while MySQL with PDO is compatible (swoole handles communication for you).

For Postgres, consider utilizing the Postgres Client instead. Be diligent in vetting any other communication methods before implementation to preempt any unforeseen issues down the line.

For more information about blocking event loop please check the documents: https://openswoole.com/

Suggestions or PR's

Feel free to fork the project and submit a pull request to the develop branch. We welcome any suggestions or collaborations you have to offer!


All versions of api-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
slim/slim Version ^4.13
openswoole/core Version 22.1.4
peroxide/container Version ^1.1
robmorgan/phinx Version ^0.16.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package peroxide/api-skeleton contains the following files

Loading the files please wait ....