Download the PHP package nimbly/carton without Composer

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

Carton

Latest Stable Version GitHub Workflow Status Codecov branch License

A simple PSR-11 container implementation.

Features

Install

Getting the container

Instantiate container

You can create a new instance of a Container.

Singleton instance

Or use the container singleton getInstance method.

Basic usage

Set an instance

The most basic usage is to just assign an instance to the container itself.

Of course, you don't need to assign objects - it can be anything you like.

Retrieving a value

Grab a value from the container by its key.

NOTE: Retrieving a value that does not exist will throw a NotFoundException.

Checking for instance

You can check for the existance of items registered in the container.

Advanced usage

Singleton builder

The singleton builder will ensure only a single instance is ever returned when it is retrieved from the container.

It also has the added benefit over the set method by lazily instantiating the class. I.e. it will only be created when it is actually needed.

Factory builder

The factory builder will create new instances each time it is retrieved from the container.

Autowiring

You can have instances made for you automatically using the make method - which will attempt to pull dependencies in from the container itself or recursively attempt to make them if not found.

Dependecy injection on instance methods

Calling an instance method couldn't be easier - Carton will attempt to autoresolve dependencies (autowire) for you when making a call to an instance method.

Adding additional containers

You can extend Carton with additional PSR-11 compliant container instances by calling the addContainer method. When Carton attempts to resolve an item, it will always attempt to resolve locally first, and if not found, will loop through any additional containers you have provided.

For example, if you had a configuration manager that implemented ContainerInterface (PSR-11), you could add it to Carton.

Now you can retrieve your configuration data through the container instance.

Service providers

Service providers allow you to organize your application dependencies in a set of classes.

Create service classes that implement ServiceProviderInterface.

Then register your service providers with the container.

You can also register multiple services at once and register services by their class name.


All versions of carton with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/container Version ^2.0
nimbly/resolve Version ^2.1
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 nimbly/carton contains the following files

Loading the files please wait ....