Download the PHP package psx/dependency without Composer

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

Dependency

About

A simple and fast PSR-11 compatible DI container with features to autowire, tag and inject services. Instead of YAML or config files services are simply defined at a class by adding i.e. a getMyService method.

Usage

Container

It is possible to extend the Container class. All getXXX methods are service definitions which can be accessed through the get method.

Autowire

The following example shows how you can use the autowiring feature:

The autowire resolver checks all arguments of the constructor of the AutowireService class and tries to resolve each type based on the return type of the method definitions in the container. Please take a look at test cases to see a complete example.

It is also possible to provide a factory resolver which allow to resolve i.e. repository classes:

Tags

The following example shows how to get services which are annotated by a specific tag:

To tag you service you need to add the #Tag attribute to your service definition method. Then it is possible to use the tag resolver to receive all services which have added a specific tag.

Compiler

If you have created a large container it is possible to compile this container into an optimized class which improves the performance.

Object builder

The object builder resolves properties with an #Inject attribute and tries to inject the fitting service to the property. If no explicit service name was provided the property name is used. Note usually it is recommended to use simple constructor injection, this class is designed for cases where this is not feasible.

The object builder can use a cache instance to cache all defined service keys in production.

Factory

It is also possible to set services on a container in the "Pimple" way. Through this you can easily extend or overwrite existing containers. Note it is not possible to use theses services for autowiring. In general it is recommended to create a custom container and extend from the default container to add new services.


All versions of dependency with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
psr/cache Version ^1.0|^2.0|^3.0
psr/container Version ^1.1|^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 psx/dependency contains the following files

Loading the files please wait ....