Download the PHP package beige/psr-11 without Composer

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

Beige PSR-11

GitHub license LICENSE Coverage 100%

一个 PSR-11 标准容器

The container implementation of PSR-11.

简介

Beige PSR-11 是一个轻量级的 PSR-11 标准容器。它的目标是将容器的使用变得更加简单和纯粹,它能够接受任意类型的数据,并将 Definition 分离。

安装

使用

引入并创建容器的实例:

读写操作

可以在容器初始化的时候向容器写入数据,数据项的索引必须是字符串类型:

Beige\Psr11\Container 实现了 ArrayAccess 接口,支持以数组的形式操作数据:

如果根据索引无法找到数据,Container 会抛出一个 Beige\Psr11\Exception\NotFoundException 异常

定义 (Definition)

“定义”是一个可调用对象,它定义了生成一个数据的具体过程,并返回数据本身。容器可以利用“定义”来生成最终的数据。这里,我们使用 Beige\Psr11\DefinitionCollection 保存一个定义的集合,传入 container 中:

Beige\Psr11\Container 构造函数的第二个参数可选,接受一个 Beige\Psr11\Interfaces\DefinitionCollectionInterface 接口的实例,当 Container 找不到某个索引的数据时,会查询 DefinitionCollection 中 对这个索引的“定义”,如果存在定义,容器就会利用定义生成具体数据并保存在容器中。Container 将延用 Definition 的索引。

Beige\Psr11\DefinitionCollection 与容器对象一样支持数组形式的操作:

在默认情况下,Container 会把自身传给 Definition 的第一个参数,如上例所示,这样,你就可以在 Definition 内部获取容器中的其他数据,帮助当前的 Definition 生成数据。当然,你也可以定义一个“非常规”的 Definition,并用 Beige\Psr11\Container::make 方法生成数据:

Beige\Psr11\Container::make 方法的第一个参数是 Definition 的索引 (注意:不是容器数据的索引);第二个参数是一个数组,是传给 Definition 的参数列表。 用 make 方法生成的数据会直接返回,且不会保存在容器中,也就是说,每调用一次 make 方法,都会重新生成一次数据!

使用 Definition 可以在需要时才生成数据,省却了不必要的消耗。推荐使用者将初始化消耗较大的数据转化为 Definition.


All versions of psr-11 with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
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 beige/psr-11 contains the following files

Loading the files please wait ....