crodas/activemongo2
Composer 安装命令:
composer require crodas/activemongo2
包简介
Mongo abstraction
README 文档
README
ActiveMongo2 is a very simple, efficient and developer friendly PHP abstraction for MongoDB.
This is a work in progress, but it is being used already in production at some sites.
How does it work?
ActiveMongo2 is not backward compatible with ActiveMongo. ActiveMongo2 generates code to avoid doing any checks at run time. Therefore configuration is a bit more complicated.
// /tmp/mapper.php would be generated $conf = new \ActiveMongo2\Configuration("/tmp/mapper.php"); $conf->addModelPath(__DIR__ . "/app/model"); $conf->development(); // remove this line at production // create mongodb connection $mongo = new \MongoClient; // create the ActiveMongo2 connection $conn = new \ActiveMongo2\Connection($conf, $mongo, 'database');
This configuration would walk checking each *.php file inside __DIR__ . "/app/model", it would be looking for @Persist annotation.
The ActiveMongo2\Connection provides several methods, the most useful is ->getCollection("collection_name").
TODO
- Write docs
统计信息
- 总下载量: 1.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: BSD-4-Clause
- 更新时间: 2013-04-13