Download the PHP package kassko/class-resolver without Composer

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

class-resolver

Latest Stable Version Total Downloads Latest Unstable Version

Allows to create an object with dependencies from it's class name.

Installation

You can install this component with composer composer require kassko/class-resolver:some_version

Usage

Use the class-resolver

Imagine, you need to create a cache instance and you have only the cache class name.

In the simpliest case, you can go for such code:

If the cache class has some dependencies, you can use the class-resolver and go through this kind of code:

If you need to handle yourself the case when the class cannot be resolved with the class-resolver, you can go through such code:

Feed the class-resolver

There are severals ways to feed the class-resolver. Each way of feeding has it's own class-resolver implementation.

From a map Kassko\ClassResolver\MapClassResolver

You can use a closure for lazy loading:

From a container by providing the get method, and the has method.

The get method is the method that resolves the service and the has method is the method that checks if the service exists.

From a container adapter that implements Kassko\ClassResolver\ContainerInterface

You can find an adapter in the bundle class-resolver-bundle. This is an adapter for Symfony container.

From a closure

From a factory

From a static factory

From others class-resolver

If no resolver can handle the className, a basic new $className is performed.

You can change this behaviour so that an exception Kassko\ClassResolver\NotResolvedClassException is thrown instead.

Or you can provide your own default resolver implementation to setDefaultResolver() method.


All versions of class-resolver with dependencies

PHP Build Version
Package Version
No informations.
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 kassko/class-resolver contains the following files

Loading the files please wait ....