laasti/spot-provider

Spot ORM 的联盟/容器服务提供商。

v2.1.1 2016-11-25 14:43 UTC

This package is auto-updated.

Last update: 2024-09-20 22:58:33 UTC


README

Spot ORM 的联盟/容器服务提供商。

安装

composer require laasti/spot-provider

使用

$config = [
    'name' => 'default', //required
    //String DSN
    'dsn' => '',
    //OR, full array
    'adapter'  => '',
    'host'     => '', //required
    'dbname'   => '', //required
    'user'     => '', //required
    'password' => '', //required
    'port'     => '',
    'protocol' => '',
    'socket'   => '',
    'dbsyntax' => '',
];

$container = new League\Container\Container();
$container->add('config.connections', [
    [
        'name' => 'default',
        //...
    ]
]);

$container->addServiceProvider('Laasti\SpotProvider\SpotProvider');

$container->get('Spot\Locator');//OR, $container->get('spot.locator.default');
$container->add('Acme\MyMapper')->withArguments(['Spot\Locator']);
$container->add('Acme\MyMsSqlMapper')->withArguments(['spot.locator.mssql']);

贡献

  1. fork它!
  2. 创建你的功能分支:git checkout -b my-new-feature
  3. 提交你的更改:git commit -am '添加一些功能'
  4. 推送到分支:git push origin my-new-feature
  5. 提交 pull 请求 :D

历史记录

更多信息请查看 CHANGELOG.md。

致谢

作者:Sonia Marquette (@nebulousGirl)

许可证

在 MIT 许可证下发布。请参阅 LICENSE.txt 文件。