mongofill/mongofill
Composer 安装命令:
composer require mongofill/mongofill
包简介
Polyfill of PECL Mongo extension
README 文档
README
Pure PHP implementation of MongoDB driver, with aim to be a drop-in replacement of the official extension, usable under HHVM runtime.
Installation
Recommended way
The recommended way of installing is through the mongofill-hhvm package as HNI extension of HHVM
git clone https://github.com/mongofill/mongofill-hhvm
cd mongofill-hhvm
./build.sh
You can read the full instructions at building-and-installation instructions from the HNI package.
Easy way
The easy way of installing Mongofill is through composer. You can see package information on Packagist.
{
"require": {
"mongofill/mongofill": "dev-master"
}
}
Note: as pure PHP, the phpversion('mongo') will return null and some libraries as Doctrine will not work properly without modifications, so please use the HNI version.
Supported libraries
You can check the current supported libraries at wiki page Supported-Libraries
Community
You can catch us on IRC on Freenode channel #mongofill
Contributing
Please push tests, ensuring compatibility with the official Mongo extension, that are not passing yet, into the "compat/not-passing" branch.
Contributions are greatly appreciated, including corrections of our english ;)
To ensure a consistent code base, you should make sure the code follows the PSR2 coding standards. We suggest use php-cs-fixer with your code before make the pull request with this flags: php-cs-fixer fix . --level=all
Running the PHPUnit tests
Tests are in the test folder.
To run them, you need PHPUnit.
phpunit --configuration phpunit.xml.dist
Running the native mongo-php-driver tests
You can find helper script at test/native/helper.sh. Your system must have installed: mongodb, git, phpize and autotools
cd tests/native/
./helper.sh setup
./helper.sh boot
./helper.sh run
Benchmarking
A small suite of benchmarking is included with the package, you can run the suite with this command:
php ./vendor/bin/athletic -b tests/bootstrap.php -p tests/Mongofill/Benchmarks/
Some results can be find at: https://gist.github.com/mcuadros/9551290
Caveats
Replica Sets & APC
When using a replica set, the Mongofill driver needs to fetch information about the replica set configuration and status. To improve performance, the driver will attempt to use APC (apc_fetch, apc_store) to cache replica set data.
The APC functions should be automatically installed with HHVM, but if you plan on using the Mongofill driver with PHP, you'll need to make sure APC is installed if you want the performance boost.
For PHP 5.5 and higher, this would be the APCu extension. If APC is not installed, replica sets will still function, they just won't be as fast.
mongofill/mongofill 适用场景与选型建议
mongofill/mongofill 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 149.98k 次下载、GitHub Stars 达 133, 最近一次更新时间为 2014 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mongofill/mongofill 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mongofill/mongofill 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 149.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 135
- 点击次数: 16
- 依赖项目数: 3
- 推荐数: 2
其他信息
- 授权协议: MIT
- 更新时间: 2014-03-25