mparaiso/dependencyinjectionserviceprovider
Composer 安装命令:
composer require mparaiso/dependencyinjectionserviceprovider
包简介
Dependency injection service provider for Silex
README 文档
README
author: MParaiso contact: mparaiso@online.fr status: Work in Progress
Configuration
use Mparaiso\Provider\DependencyInjectionServiceProvider;
$app->register(new DependencyInjectionServiceProvider,array(
/* cache configuration (path and a cache class name */
"di.cache"=>array("path"=>__DIR__."/../cache/","class"=>"MyCacheClass"),
/* external variables ( db config , environment variables .... */
"di.params"=>array(
"app.root_dir"=>__DIR__,
"app.debug"=>$app["debug"],
"app.host"=>getenv("SYMFONY__SHORTEN__HOST"),
"app.driver"=>"pdo_mysql",
"app.user"=>getenv("SYMFONY__SHORTEN__USER"),
"app.password"=>getenv("SYMFONY__SHORTEN__PASSWORD"),
"app.dbname"=>getenv("SYMFONY__SHORTEN__DBNAME"),
"app.port"=>getenv("SYMFONY__SHORTEN__PORT"),
),
/* loader type (yaml,annotaions,xml) and file path */
"di.loader.options"=>array(
"type"=>"yaml",
"path"=>__DIR__."/Shorten/Resources/services/config.yml",
)
)
);
Usage
$app["di"]->get("myservice");
统计信息
- 总下载量: 47
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-03-24