Download the PHP package ricardoper/slim4-skeleton without Composer

On this page you can find all versions of the php package ricardoper/slim4-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 slim4-skeleton

PHP Slim Framework v4 Skeleton

A super organized (with a sane folder structure) and very customizable skeleton for Slim Framework v4. Use it to start working quickly on a new project.

NOTE: If you want this skeleton with Twig, go to: (https://github.com/ricardoper/slim4-twig-skeleton).

This project use PHP Composer for a fast installation without any trouble.

NOTES:

Table of Contents


How to Install

Run this command from the directory in which you want to install your new Slim Framework v4 Skeleton.

NOTE:

Most Relevant Folders

Global Helpers

Global Helpers for Development Only

Configurations

You can add as many configurations files as you want (/configs). These files will be automatically preload and merged in the container based on selected environment.

If you have an environment called "sandbox" and you want to overwrite some configuration only for this environment, you need to create a subfolder "sandbox" in /configs. Something like that /configs/sandbox. Then create the file that includes the configuration that you need to replace and the respective keys and values inside it.

/configs/logger.php

/configs/local/logger.php

Results of name for the environment:

NOTE: You can see the example in this framework for the local environment.

Configurations Dot Notation

You can use dot notation to get values from configurations.

/configs/example.php

If you want the host value for MySQL type:

Routes

Maps an HTTP request to a request handler (Closures or Controllers).

You can add as many routes files as you want (/app/Routes), but you need to enable these files in /apps/Routes/app.php file.

You can organize this routes as you like. There is a little Demo that you can see how to organize this files.

Controllers

Accepts input and converts it to commands for the Models.

You can add as many Controllers as you want in a cleaning way (/app/Controllers).

After add your Controller, you can enable or disable it in your Routes.

NOTE: To have helpers you must extend the Controllers with ControllerAbstract located in \App\Kernel\Abstracts.

Controllers Helpers

Middlewares

Provide a convenient mechanism for filtering HTTP requests entering your application.

You can add as many Middlewares as you want in a cleaning way (/app/Middlewares).

After add your Middleware, you can enable or disable it in configs/middlewares.php configuration file.

NOTE: Middlewares must respect the MiddlewareInterface located in \Psr\Http\Message.

Enable it in configs/middlewares.php:

Response Emitters

Emits a response, including status line, headers, and the message body, according to the environment.

You can add as many Response Emitters as you want in a cleaning way (/app/Emitters).

After add your Response Emitter, you can enable or disable it globally in configs/emitters.php configuration or you can add it in the Controller for a specific action.

NOTE: Response Emitters must respect the ResponseEmitterInterface located in \App\Kernel\Interfaces.

Enable it in configs/emitters.php:

Models

Manages the data, logic and rules of the application.

You can add as many Models as you want in a cleaning way (/app/Models).

After add your Models, you use it for, for example, in a Controller.

NOTE: To have helpers you must extend the Model with ModelAbstract located in \App\Kernel\Abstracts.

Models Helpers

Services Providers

Define bindings and inject dependencies.

You can add as many Services Providers as you want in a cleaning way (/app/Services).

After add your Services Provider, you can enable or disable it in configs/services.php configuration file.

NOTE: Service Providers must respect the ServiceProviderInterface located in \App\Kernel\Interfaces.

Enable it in configs/services.php:

Handlers

Handles specified behaviors of the application.

You can override the following Handlers in a cleaning way (/app/Handlers):

After add your Handler, you can enable or disable it in configs/app.php configuration file.

Database Support

Medoo is implemented out of box as a Service Provider. The use is optional and is not enabled by default.

To enable database support with Medoo you need to add this library/vendor with Composer:

Once installed you need to enable the Service Provider in configs/services.php:

Now you are ready to use it...

If you need more details, documentation, api reference, please visit Medoo webpage: https://medoo.in/

NOTES:

Exceptions

You have some Exceptions out the box, located in \App\Kernel\Exceptions, than you can use it:

Logging

Logging is enabled by default and you can see all the output in /storage/logs/app-{date}.log.

You can set this parameters in /.env or in /configs/app.php.

Debugging

Debugging is disabled by default. You can set this parameters in /.env or in /configs/app.php.

Demo

This skeleton has a little Demo that you can see all this points in action.

Demo URL's:

Benchmarks

Nothing is free, so let's compare the performance loss with Slim Skeleton.

Machine:
Intel® Core™ i5-8400 CPU @ 2.80GHz × 6
16Gb RAM
SSD

Versions:
Ubuntu 20.04 LTS
Docker v19.03.8
nginx 1.17.10
PHP v7.4.3
Zend OPcache enabled
SIEGE 4.0.4

Bench Details:
25 concurrent connections
500 requests per thread
No delays between requests
Command: siege -c25 -b -r500 "URL"

This Skeleton Slim Skeleton
Transactions 12500 hits 12500 hits
Availability 100.00 % 100.00 %
Elapsed time 9.16 secs 8.80 secs
Data transferred 0.45 MB 0.45 MB
Response time 0.02 secs 0.02 secs
Transaction rate 1364.63 trans/sec 1420.45 trans/sec
Throughput 0.05 MB/sec 0.05 MB/sec
Concurrency 24.49 24.51
Successful transactions 12500 12500
Failed transactions 0 0
Longest transaction 0.05 0.05
Shortest transaction 0.00 0.00



Enjoy the simplicity :oP


All versions of slim4-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
ext-json Version *
psr/log Version ^1.1
slim/slim Version ^4.5
slim/psr7 Version ^1.1
pimple/pimple Version ^3.3
vlucas/phpdotenv Version ^4.1
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 ricardoper/slim4-skeleton contains the following files

Loading the files please wait ....