Download the PHP package quillstack/di without Composer

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

Quillstack DI Container

Build Status Downloads Coverage Lines of Code StyleCI CodeFactor Packagist License Reliability Rating Maintainability Security Rating Packagist PHP Version Support

Quillstack DI Container is the dependency injection container based on PSR-11: Container interface, and with the main goal: to be fast. You can find the full documentation on the website: \ https://quillstack.org/di

This DI container uses constructors and types of class properties.

Installation

To install this package, run the standard command using Composer:

Usage

You can use Quillstack DI Container when you want:

Simple usage

You can easily start using a DI Container:

Where your ExampleController class looks like:

Dependencies based on interfaces

If you want to define which class should be loaded based on an interface:

You can define your dependencies using interfaces:

When you create the object using the DI container, the type of $logger property will be set to Logger.

Dependencies with parameters

If some of your classes require parameters, define them as an array passed on the second parameter to the container:

Every time you will get a database object, a container will use localhost as a value for $hostname parameter:

Custom instance factories

You can implement your own instance factory. This is especially useful when you want to create many objects in a class family that are very similar in some way.

In our example we want to create different request objects:

First, we had to create RequestInterface as a common interface for all requests.

Next, we have to create an instance factory class. To create it, extend a class with CustomFactoryInterface:

Also, use this configuration array when you create a DI container:

Custom factories are useful for objects you want to create similarly.

Dependencies as objects

In this example, whenever a new class of LoggerInterface will be required as a dependency, a container will use a previously defined object. This object can be created once in a bootstrap file and used in the entire application:

This configuration is helpful if an object should be created once and its instance should be used in other places in the application.

Unit tests

Run tests using a command:

Docker


All versions of di with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/container Version ^2.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 quillstack/di contains the following files

Loading the files please wait ....