|
| 1 | +# Welcome to PHongo CRUD |
| 2 | + |
| 3 | +PHongo CRUD is an CRUD API ontop of [Phongo](https://github.com/bjori/phongo). |
| 4 | +Its purpose is to provide standard MongoDB API and follows the MongoDB CRUD API Specification[1] |
| 5 | +that all [MongoDB](http://mongodb.com) supported drivers follow. |
| 6 | + |
| 7 | +PHongo CRUD provides several convenience methods that abstract the core PHongo extension. |
| 8 | +The methods include functionality to insert a single document, counting all documents in |
| 9 | +an collection, and delete documents from a collection. |
| 10 | + |
| 11 | + |
| 12 | +# Installation |
| 13 | + |
| 14 | +As PHongo CRUD is an abstraction layer for PHongo, it naturally requires [PHongo to be |
| 15 | +installed](http://bjori.github.io/phongo/#installation): |
| 16 | + |
| 17 | + $ wget https://github.com/bjori/phongo/releases/download/0.1.2/phongo-0.1.2.tgz |
| 18 | + $ pecl install phongo-0.1.2.tgz |
| 19 | + $ echo "extension=phongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` |
| 20 | + |
| 21 | +The best way to then install PHongo CRUD is via [composer](https://getcomposer.org/) |
| 22 | +by adding the following to |
| 23 | +[composer.json](https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup): |
| 24 | + |
| 25 | +```json |
| 26 | + "repositories": [ |
| 27 | + { |
| 28 | + "type": "vcs", |
| 29 | + "url": "https://github.com/bjori/phongo-crud" |
| 30 | + } |
| 31 | + ], |
| 32 | + "require": { |
| 33 | + "ext-phongo": ">=0.1.2", |
| 34 | + "bjori/phongo-crud": "dev-master" |
| 35 | + } |
| 36 | +``` |
| 37 | + |
| 38 | +and then running |
| 39 | + |
| 40 | +```shell |
| 41 | +$ composer install |
| 42 | +``` |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +## Generated API Docs |
| 47 | + |
| 48 | +If you are just interested in looking at the API provided, checkout the apidoc generated |
| 49 | +documentation on: [http://bjori.github.io/phongo-crud/api/class-MongoDB.Collection.html](http://bjori.github.io/phongo-crud/api/class-MongoDB.Collection.html) |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +## MongoDB Tutorial |
| 54 | + |
| 55 | +MongoDB first-timer? |
| 56 | +Checkout these links to get a quick understanding what MongoDB is, how it works, and |
| 57 | +what the most common terms used with MongoDB mean. |
| 58 | + |
| 59 | + - [MongoDB CRUD Introduction](http://docs.mongodb.org/manual/core/crud-introduction/) |
| 60 | + - [What is a MongoDB Document](http://docs.mongodb.org/manual/core/document/) |
| 61 | + - [MongoDB `dot notation`](http://docs.mongodb.org/manual/core/document/#dot-notation) |
| 62 | + - [MongoDB ObjectId](http://docs.mongodb.org/manual/reference/object-id/) |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +[1] The specification has not been published yet - it is still a Work In Progress |
| 67 | + |
0 commit comments