Skip to content

Commit 0509f3c

Browse files
committed
PHP-1327: Initial commit of PHongo CRUD docs
1 parent 40ec47f commit 0509f3c

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ composer.lock
77
php.ini
88
phpunit.xml
99
apigen.phar
10+
site

docs/index.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+

docs/pretty.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
$( document ).ready(function() {
3+
$('pre code').parent().addClass('prettyprint well');
4+
prettyPrint();
5+
});

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
site_name: "PHongo: CRUD - The Create Read Update and Delete interface for PHongo"
2+
repo_url: https://github.com/bjori/phongo-crud
3+
theme: spacelab
4+
pages:
5+
- [index.md, Home]
6+
extra_javascript:
7+
- pretty.js

0 commit comments

Comments
 (0)