crodas / activemongo2
Mongo 抽象层
v0.7.2
2016-09-25 06:05 UTC
Requires
- php: >=5.4.0
- crodas/build: ^0.2
- crodas/cli: ^0.1
- crodas/file-util: >=0.1.14
- crodas/notoj: >=1.0.5
- crodas/validator: >=0.2.1
- keyvanakbary/slugifier: ^3.0
Requires (Dev)
- dev-master
- v0.7.2
- v0.7.1
- v0.6.2
- v0.6.1
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.1
- v0.2.1
- v0.1.32
- v0.1.31
- v0.1.30
- v0.1.29
- v0.1.27
- v0.1.26
- v0.1.25
- v0.1.24
- v0.1.23
- v0.1.22
- v0.1.21
- v0.1.20
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-develop
- dev-feature/ignore-updating-same-reference
- dev-php7-easiest-approach
- dev-feature/standarize-api
- dev-feature/new-mongo-driver
- dev-feature/easy-init
- dev-feature/mongodb-native-client
- dev-feature/docs
- dev-feature/tests
- dev-feature/document-locking
- dev-optimistic-locking
- dev-feature/notoj-2
- dev-feature/populate-from-_POST
- dev-feature/new-internal
- dev-feature/better-memory
- dev-feature/reference-deferred
- dev-feature/simple-cache
- dev-feature/splittedreferences
- dev-feature/inheritance
- dev-feature/validator
This package is auto-updated.
Last update: 2024-09-12 18:35:41 UTC
README
ActiveMongo2 是一个非常简单、高效且对开发者友好的 MongoDB PHP 抽象层。
这是一个正在开发中的项目,但已经在一些网站的生产环境中使用。
它是如何工作的?
ActiveMongo2
与 ActiveMongo 不兼容。 ActiveMongo2
生成代码以避免在运行时进行任何检查。因此配置稍微复杂一些。
// /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');
此配置将遍历检查 __DIR__ . "/app/model"
目录下的每个 *.php
文件,寻找 @Persist
注解。
ActiveMongo2\Connection
提供了几个方法,其中最有用的是 ->getCollection("collection_name")
。
待办事项
- 编写文档