Download the PHP package amber/container without Composer

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

GitHub last commit Latest Stable Version Latest Beta Version PHP from Packagist Build Status Coverage Status Total Downloads GitHub

Container

Simple PHP DI Container.

Instalation

API (Draft)

Basic Usage (PSR-11 compliance)

bind()

Binds an item to the Container's map by a unique key.

bind(string $key, mixed $value) : boolean

param string $key The unique item's key.

param mixed $value The value of the item.

return bool True on success. False if key already exists.

Bind an Service to the container by a unique key.

Or bind a class like this.

get()

Gets an item from the Container's map by its unique key

get(string $key): mixed

param string $key *The unique item's key.

return mixed The value of the item.

has()

Checks for the existance of an item on the Container's map by its unique key.

has(string $key): bool param string $key *The unique item's key. return bool

unbind()

Unbinds an item from the Container's map by its unique key.

unbind(string $key): bool

param string $key *The unique item's key.

return bool true on success, false on failure.

Multiple actions

bindMultiple()

getMultiple()

unbindMultiple()

Advanced Usage

make()

Binds and Gets a Service from the Container's map by its unique key.

make(string $class): mixed

param string $class The item's class.

return mixed The value of the item.

register()

Binds an class to the Container and return the ServiceClass.

register(string $class, string $alias = null): ServiceClass

param string $class The item's class.

param string $alias The item's alias.

return ServiceClass

singleton()

Binds an class to the Container as singleton and return theServiceClassservice.

singleton(string $class, string $alias = null): ServiceClass

param string $class The item's class.

param string $alias The item's alias.

return ServiceClass

getClosureFor()

Gets a closure for a method of the provided class.

getClosureFor(string $class, string $method, array $binds = []): Closure

param string $class The class to instantiate.

param string $method The class method to call.

param array $binds The arguments for the service.

return Closure

More coming soon...


All versions of container with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
amber/collection Version ^0.6@beta
amber/validator Version ^0.1@dev
opis/closure Version ^3.5
psr/container Version ^1.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 amber/container contains the following files

Loading the files please wait ....