cekurte/eloquentbundle

一个用于在Symfony 2中集成Eloquent库的扩展包

安装: 140

依赖者: 0

建议者: 0

安全: 0

星标: 2

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

v1.0.1 2016-05-03 18:58 UTC

This package is auto-updated.

Last update: 2024-09-16 02:20:03 UTC


README

Build Status Code Climate Coverage Status Latest Stable Version License SensioLabsInsight

  • 一个简单连接Eloquent ORM和Symfony 2的桥梁(所有方法均通过php单元测试覆盖),为这个项目做出贡献吧

如果你喜欢这个库,给我一个星标 =)

安装

composer require cekurte/eloquentbundle

之后,在AppKernel中注册该扩展包,如下所示

// app/AppKernel.php

// ...
public function registerBundles()
{
    $bundles = array(
        // ...
        new Cekurte\EloquentBundle\CekurteEloquentBundle(),
        // ...
    );

    // ...
    return $bundles;
}

配置

配置此扩展包的所有引用如下,请将其添加到您的配置文件中。

# app/config/config.yml

# ...
cekurte_eloquent:
    connection:
        driver:     "mysql"           # Default is mysql. Available too: postgres, sqlserver and sqlite.
        host:       "127.0.0.1"       # Required
        database:   "dbname"          # Required
        username:   "user"            # Required
        password:   "pass"            # Optional, default is ""
        charset:    "utf8"            # Optional, default is "utf8"
        collation:  "utf8_unicode_ci" # Optional, default is "utf8_unicode_ci"
        prefix:     ""                # Optional, default is ""

如何使用

请参阅Eloquent ORM文档

贡献

  1. 给我一个星标 =)
  2. 将其Fork
  3. 创建您的功能分支(git checkout -b my-new-feature
  4. 进行更改
  5. 运行测试,如果需要,为您的代码添加新的测试(vendor/bin/phpunit
  6. 提交您的更改(git commit -am 'Added some feature'
  7. 将更改推送到分支(git push origin my-new-feature
  8. 创建新的Pull Request