crodas / activemongo2
Mongo abstraction
Installs: 1 519
Dependents: 3
Suggesters: 0
Security: 0
Stars: 7
Watchers: 4
Forks: 0
Open Issues: 0
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-10-12 18:48:20 UTC
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