amstaffix/silex-mysqli

该包已被废弃且不再维护。未建议替代包。

Pimple 的 MySQLi 服务提供者

1.1.1 2016-07-05 21:41 UTC

This package is not auto-updated.

Last update: 2021-07-14 03:51:17 UTC


README

MySQLi 服务提供者,用于 Pimple 3

Downloads License

要求

  • PHP >= 5.3.3

使用

use Kilte\MySQLi\MySQLiServiceProvider;
use Pimple\Container;

$c = new Container();

$c->register(
    new MySQLiServiceProvider,
    array(
        'mysqli.configuration' => array(
            'host'     => 'localhost',
            'username' => 'root',
            'password' => '1234',
            'database' => 'mysql',
            'charset'  => 'utf8',
        ),
    )
);

现在服务以 $c['mysqli'] 的形式提供。

此提供者提供了扩展的内部 \mysqli 类。

唯一的区别是,默认情况下,query() 方法使用 MYSQLI_USE_RESULT 而不是 MYSQLI_STORE_RESULT

测试

$ composer install
$ vendor/bin/phpunit

变更日志

1.1.0 [31.08.2014]

  • 使服务符合 Pimple 2.1 和 Silex 2.0(由 Alexander Kudryashov 实现)
  • 将依赖项改为 Pimple 而不是 Silex(由 Alexander Kudryashov 实现)
  • 删除异常。使用 mysqli_report 代替

1.0.1 [03.07.2014]

  • 如果配置不存在,则抛出 \LogicException
  • 添加单元测试
  • PSR-4 自动加载

1.0.0 [30.12.2013]

  • 首次发布

贡献

  • 复制此仓库
  • 创建您的功能分支(git checkout -b awesome-feature)
  • 进行更改
  • 如有必要,编写/更新测试
  • 如有必要,更新 README.md
  • 将分支推送到 origin(git push origin awesome-feature)
  • 发送拉取请求
  • ???
  • 盈利!

不要忘记合并上游更改

git remote add upstream https://github.com/AmsTaFFix/silex-mysqli
git checkout master
git pull upstream
git push origin master

现在您可以删除您的分支

git branch -d awesome-feature
git push origin :awesome-feature

许可证

MIT 许可证(MIT)