Download the PHP package dustinfog/canoe-di without Composer

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

CanoeDI

一个非常简单且实用的IoC框架,相对于其他的Ioc框架有如下特点:

  1. 高效: 框架使用了非常实用且高效的算法,使得框架本身对应用的影响微乎其微,且框架提供了C扩展,最大限度的将性能提升到最高。
  2. 配置简单: 大多数情况下几乎不需要额外的配置
  3. 自动装配: 基于PHPDocument的property属性来自动装配
  4. 懒加载: 所有被注入的变量的实例都为即用即取, 不会产生内存垃圾
  5. IDE友好: 因为利用的是PHP的标准规范, 兼容大部分IDE

安装

编译安装,可以得到最大的效率:

而后编辑php.ini

composer安装 (生产环境如果已经编译安装了扩展,此步骤可省略。在开发环境,PHP源码可以让IDE提供代码完成提示,所以仍然推荐执行这一步):

使用

获取实例

基于标注的装配

@uses标注:

uses可以指定属性使用的类或者容器里的实例

Singleton

有时候,我们需要在一个非DI环境里有限的使用DI,这时候每个系统与DI容器的先借点都在调用Context::get()显得很丑陋,框架里提供了一个更加亲民的调用方式:

预先定义

上面的例子都是在运行时来实现自动装配的,但在某些时候可能需要手动预先创建一些定 义,以备后续使,框架提供了简单的支持.

配置

大多数时候,预先定义都是写在配置文件里,可以用下列的方法加载配置:


All versions of canoe-di with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.25
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 dustinfog/canoe-di contains the following files

Loading the files please wait ....