Download the PHP package cevantime/sherpa-core without Composer

On this page you can find all versions of the php package cevantime/sherpa-core. 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 sherpa-core

Sherpa Core

A basic core class to build psr compliant applicationswith ease. The code is intentionnally minimal. For a more integrated experience, see Sherpa Framework.

Installation

Sherpa Core is installable via composer

Getting Started

Sherpa use psr-7 for HTTP messages. You can use Zend Diactoros implementation to build your Request in your index file.

Now, you can init the Sherpa Kernel

Now, you can add a little middleware to display a simple 'Hello Sherpa' :

The Kernel will handle the response for the request

When the response is ready, it needs to be emitted !

That's it ! Now visit your index file. You should see "Hello Sherpa !"

Middlewares

Sherpa Core do his best to be compliant with psr7 and psr-15 recommandations. Those recommendations introduces the usage of Message Interface and Middlewares. Piping middlewares in the Kernel is pretty simple :

Accordingly to the specifications, middlewares must return an instance of Psr\Http\Message\ResponseInterface. It can do so by :

Here is a (imaginary) examplen that check if we are visiting an admin uri and prevent user that are not admin to enter !

Optionnally (but it is worth noting it !) an integer can be provided as second param in order to set a priority for the middleware (higher comes before).

Container and Autowiring

Sherpa Core use PHP DI Container as a Dependency Container and Dependency Injector. This package lets you inject any class of your project (even your vendor) with minimal configuration. Every type hinted parameter can be injected. You only need to configure parameters than can't be guessed by type hinting. Classes that are defined using class/interface names as keys will become injectable :

Now a logger is injectable anywhere, including a class middleware :

The Kernel will use di container to inject the middleware in the middleware stack. Thus you can pipe middlewares by only providing their class names.

Conclusion

This kernel is fairly minimal but it is a good starting point to build great applications with full psr compliance. Sherpa Framework is an example of how this kernel can be used.


All versions of sherpa-core with dependencies

PHP Build Version
Package Version
Requires psr/http-message Version ~1.0
psr/http-server-middleware Version ~1.0
psr/http-server-handler Version ~1.0
symfony/event-dispatcher Version ^4.0
zendframework/zend-diactoros Version ~1.0
doctrine/cache Version ~1.4
php-di/php-di Version ^6.0
php Version >=7.2
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 cevantime/sherpa-core contains the following files

Loading the files please wait ....