|
1 |
| -# Welcome to phongo libraries! |
| 1 | +# MongoDB PHP Library |
2 | 2 |
|
3 |
| -phongo libraries is a CRUD API ontop of [Phongo](https://github.com/10gen-labs/mongo-php-driver-prototype). |
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. |
| 3 | +This library provides a high-level abstraction around the lower-level |
| 4 | +[PHP driver](https://github.com/10gen-labs/mongo-php-driver-prototype) (i.e. the |
| 5 | +`mongodb` extension). |
6 | 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. |
| 7 | +While the extension provides a limited API for executing commands, queries, and |
| 8 | +write operations, this library implements an API similar to that of the |
| 9 | +[legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains |
| 10 | +abstractions for client, database, and collection objects, and provides methods |
| 11 | +for CRUD operations and common commands (e.g. index and collection management). |
10 | 12 |
|
| 13 | +If you are developing an application with MongoDB, you should consider using |
| 14 | +this library, or another high-level abstraction, instead of the extension alone. |
11 | 15 |
|
12 |
| -# Installation |
13 |
| - |
14 |
| -As PHongo CRUD is an abstraction layer for PHongo, it naturally requires [PHongo to be |
15 |
| -installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): |
16 |
| - |
17 |
| - $ wget https://github.com/10gen-labs/mongo-php-driver-prototype/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*||"` |
| 16 | +For further information about the architecture of this library and the `mongodb` |
| 17 | +extension, see: |
20 | 18 |
|
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): |
| 19 | + - http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers |
24 | 20 |
|
25 |
| -```json |
26 |
| - "repositories": [ |
27 |
| - { |
28 |
| - "type": "vcs", |
29 |
| - "url": "https://github.com/10gen-labs/mongo-php-library-prototype" |
30 |
| - } |
31 |
| - ], |
32 |
| - "require": { |
33 |
| - "ext-phongo": ">=0.1.2", |
34 |
| - "10gen-labs/mongo-php-library-prototype": "dev-master" |
35 |
| - } |
36 |
| -``` |
| 21 | +# Installation |
37 | 22 |
|
38 |
| -and then running |
| 23 | +As a high-level abstraction for the driver, this library naturally requires that |
| 24 | +the [`mongodb` extension be installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): |
39 | 25 |
|
40 |
| -```shell |
41 |
| -$ composer install |
42 |
| -``` |
| 26 | + $ pecl install mongodb-alpha |
| 27 | + $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` |
43 | 28 |
|
| 29 | +The preferred method of installing this library is with |
| 30 | +[Composer](https://getcomposer.org/) by running the following from your project |
| 31 | +root: |
44 | 32 |
|
| 33 | + $ composer require "mongodb/mongodb=0.2.x-dev" |
45 | 34 |
|
46 | 35 | ## Generated API Docs
|
47 | 36 |
|
48 |
| -If you are just interested in looking at the API provided, checkout the apidoc generated |
49 |
| -documentation on: [http://10gen-labs.github.io/mongo-php-library-prototype/api/class-MongoDB.Collection.html](http://10gen-labs.github.io/mongo-php-library-prototype/api/class-MongoDB.Collection.html) |
50 |
| - |
51 |
| - |
| 37 | +If you are just interested in referencing the API provided by this library, you |
| 38 | +can view generated API documentation [here](./api). |
52 | 39 |
|
53 | 40 | ## MongoDB Tutorial
|
54 | 41 |
|
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 |
| 42 | +If you are a new MongoDB user, these links should help you become more familiar |
| 43 | +with MongoDB and introduce some of the concepts and terms you will encounter in |
| 44 | +this documentation: |
67 | 45 |
|
| 46 | + - [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/) |
| 47 | + - [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/) |
| 48 | + - [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation) |
| 49 | + - [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/) |
0 commit comments