Download the PHP package mnapoli/simplex without Composer

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

Build Status

Simplex

Simplex is a Pimple 3 fork with full PSR-11 compliance and cross-framework service-provider support.

Simplex is a small dependency injection container for PHP.

Differences with Pimple

Simplex is a fork of Pimple's code. The only differences are the following:

Below is the documentation of Pimple/Simplex.

Installation

Usage

Creating a container is a matter of creating a Container instance:

Defining Services

A service is an object that does something as part of a larger system. Examples of services: a database connection, a templating engine, or a mailer. Almost any global object can be a service.

Services are defined by anonymous functions that return an instance of an object:

Notice that the anonymous function has access to the current container instance, allowing references to other services or parameters.

As objects are only created when you get them, the order of the definitions does not matter.

Using the defined services is also very easy:

Defining Factory Services

By default, each time you get a service, Pimple returns the same instance of it. If you want a different instance to be returned for all calls, wrap your anonymous function with the factory() method

Now, each call to $container['session'] returns a new instance of the session.

Defining Parameters

Defining a parameter allows to ease the configuration of your container from the outside and to store global values:

If you change the session_storage service definition like below:

You can now easily change the cookie name by overriding the session_storage_class parameter instead of redefining the service definition.

Protecting Parameters

Because Pimple sees anonymous functions as service definitions, you need to wrap anonymous functions with the protect() method to store them as parameters:

Modifying Services after Definition

In some cases you may want to modify a service definition after it has been defined. You can use the extend() method to define additional code to be run on your service just after it is created:

The first argument is the name of the service to extend, the second a function that gets access to the object instance and the container.

Service providers

Simplex supports registering cross-framework service providers.

To register service providers, pass an array of service providers as first constructor argument.


All versions of simplex with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
psr/container Version ^1.0
container-interop/service-provider Version ~0.4.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 mnapoli/simplex contains the following files

Loading the files please wait ....