Skip to content

Commit

Permalink
Merge pull request dready92#47 from popojargo/feature/migrateDocToSphinx
Browse files Browse the repository at this point in the history
Migration of the documentation to Sphinx(Using RST with Markdown)
  • Loading branch information
popojargo authored Sep 10, 2017
2 parents fa7d426 + 3f7f1ec commit ac2fcec
Show file tree
Hide file tree
Showing 51 changed files with 4,456 additions and 3,612 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ composer.lock

#Misc
setup.sh


#Doc build files
doc/_build
127 changes: 0 additions & 127 deletions INSTALL.md

This file was deleted.

129 changes: 10 additions & 119 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
[![Latest Stable Version](https://poser.pugx.org/php-on-couch/php-on-couch/version)](https://packagist.org/packages/php-on-couch/php-on-couch)[![Latest Unstable Version](https://poser.pugx.org/php-on-couch/php-on-couch/v/unstable)](//packagist.org/packages/php-on-couch/php-on-couch)[![Build Status](https://travis-ci.org/PHP-on-Couch/PHP-on-Couch.svg?branch=master)](https://travis-ci.org/PHP-on-Couch/PHP-on-Couch)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PHP-on-Couch/PHP-on-Couch/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHP-on-Couch/PHP-on-Couch/?branch=master)[![codecov](https://codecov.io/gh/PHP-on-Couch/PHP-on-Couch/branch/master/graph/badge.svg)](https://codecov.io/gh/PHP-on-Couch/PHP-on-Couch)[![License](https://poser.pugx.org/php-on-couch/php-on-couch/license)](https://packagist.org/packages/php-on-couch/php-on-couch)
[![Latest Stable Version](https://poser.pugx.org/php-on-couch/php-on-couch/version)](https://packagist.org/packages/php-on-couch/php-on-couch)[![Latest Unstable Version](https://poser.pugx.org/php-on-couch/php-on-couch/v/unstable)](//packagist.org/packages/php-on-couch/php-on-couch)[![Build Status](https://travis-ci.org/PHP-on-Couch/PHP-on-Couch.svg?branch=master)](https://travis-ci.org/PHP-on-Couch/PHP-on-Couch)[![Documentation Status](https://readthedocs.org/projects/php-on-couch/badge/?version=latest)](http://php-on-couch.readthedocs.io/en/latest/?badge=latest)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PHP-on-Couch/PHP-on-Couch/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHP-on-Couch/PHP-on-Couch/?branch=master)[![codecov](https://codecov.io/gh/PHP-on-Couch/PHP-on-Couch/branch/master/graph/badge.svg)](https://codecov.io/gh/PHP-on-Couch/PHP-on-Couch)[![License](https://poser.pugx.org/php-on-couch/php-on-couch/license)](https://packagist.org/packages/php-on-couch/php-on-couch)

:fire:For the complete documentation, visit http://php-on-couch.readthedocs.io :fire:



[![Stories in Ready](https://badge.waffle.io/PHP-on-Couch/PHP-on-Couch.png?label=ready&title=Ready)](https://waffle.io/PHP-on-Couch/PHP-on-Couch)
## Table of content
- [Introduction](#introduction)
- [What's new](#whats-new)
- [Changes](#changes)
- [Installation and testing](#installation-and-testing)
- [Components and documentation](#components-and-documentation)
+ [Couch class](#couch-class)
+ [CouchClient class](#couchclient-class)
* [Database functionnalities](#database-functionnalities)
* [Documents functionnalities](#documents-functionnalities)
* [Views functionnalities](#views-functionnalities)
* [Mango Query](#mango-query)
+ [CouchDocument class](#couchdocument-class)
+ [CouchReplicator class](#couchreplicator-class)
+ [CouchAdmin class](#couchadmin-class)
- [Quick-start guide](#quick-start-guide)
- [Example](#example)
- [Community](#community)
Expand All @@ -27,120 +20,20 @@

[PHP On Couch](http://github.com/PHP-on-Couch/PHP-on-Couch/) tries to provide an easy way to work with your [CouchDB](http://couchdb.apache.org) [documents](http://docs.couchdb.org/) with [PHP](http://php.net).

## What's new

Due to the lack of support on the last repository, I forked it and I will make sure it's kept active. Feel free to post any issue or feature request. I'm open for further developments but I don't have a lot of time.

With the new release of 2.0, the master branch will support only this version and the next one.

To access PHP-on-Couch for CouchDB 1.6.1, please visit [this link](https://github.com/PHP-on-Couch/PHP-on-Couch/tree/1.6.1).


## Recent changes

For the complete change list, head over [here](changelist.md)
For the complete change list, head over [here](http://php-on-couch.readthedocs.io/en/stable/overview/changelist/index.html)

## Installation and testing

Install the library using composer : `composer require php-on-couch/php-on-couch`.
You can find more detailed informations about installation [here](INSTALL.md).
You can find more detailed informations about installation [here](http://php-on-couch.readthedocs.io/en/stable/quickstart/installation.html).

To test the the application, see [this topic](TESTING.md).
To test the the application, see [this topic](http://php-on-couch.readthedocs.io/en/stable/quickstart/testing.html).

## Components and documentation

This library has four main classes and a custom [Exception](http://php.net/manual/en/language.exceptions.php) class.

### Couch class
This is the most basic of the three classes, and is responsible for the low level dialog between PHP and the CouchDB server. There should be no need of using it directly.

From version **2.0.2**, you are able to change the HTTP adapter used by the Couch class. For more details, click [here](doc/couch.md).


### CouchClient class

This class maps all the actions the application can do on the CouchDB server. Documentation is split in three main topics :

#### [Database functionnalities](doc/couch_client-database.md)

- List databases
- Create and delete a database
- Retrieve database informations
- Test whether a database exists
- Get uuids
- Get databases changes

#### [Documents functionnalities](doc/couch_client-document.md)

- Fetching documents
- Storing documents
- Copy a document
- Store attachments
- Delete document attachments
- Get all documents

#### [Views functionnalities](doc/couch_client-view.md)

- Calling a view with query options : key, startkey, endkey, limit, stale, ...

#### [Mango Query](doc/couch_client_mango.md)

- Create and manage indexes
- Make complex query with Mango Query

### CouchDocument class

Easing the manipulation of documents, the CouchDocument class uses PHP magic getters and setters. Documentation available [here](doc/couch_document.md).

### CouchReplicator class

A dedicated class to manage replications over different instances of CouchDB databases. Documentation available [here](doc/couch_replicator.md).

### CouchAdmin class

A class to manage users and database/users associations. Documentation available [here](doc/couch_admin.md).

## Quick-start guide

1. PHP-on-Couch package is available under the PHPOnCouch namespace.
2. To start using PHP-on-Couch, you need to import the classes.

**Available high level classes**

| Class name | Description |
| ---------- | ----------- |
| PHPOnCouch\CouchClient | The client to access a CouchDB database |
| PHPOnCouch\CouchAdmin | The class to handle CouchDB admins,user and permissions. |
| PHPOnCouch\CouchReplicator | A class to handle replication with databases. |
| PHPOnCouch\CouchDocument | A class that enhance document handling. Allow to auto-commit changes, replication and more. |

**Example**
```php
use PHPOnCouch\CouchClient;
use PHPOnCouch\CouchDocument;
```

3. Create a client object. You have to tell it the _Data source name_ (dsn) of your CouchDB server, as well as the name of the database you want to work on. The DSN is the URL of your CouchDB server, for example _http://localhost:5984_.

```php
$client = new CouchClient($couchdb_server_dsn, $couchdb_database_name);
```

4. Use it !

```php
try {
$client->createDatabase();
} catch (\PHPOnCouch\Exceptions\CouchException $e) {
echo "Unable to create database : ".$e->getMessage();
}

$doc = new CouchDocument($client);
$doc->set( array('_id'=>'some_doc_id', 'type'=>'story','title'=>"First story") );

$view = $client->limit(10)->descending(true)->getView('some_design_doc','viewname');
```

For the full API document, please visite [this link](http://php-on-couch.readthedocs.io/en/stable/api/index.html)

## Example

Expand Down Expand Up @@ -193,21 +86,19 @@ echo $doc->name; // should echo "Smith"
$doc->name = "Brown"; // set document property "name" to "Brown" and store the updated document in the database
```



## Community

### Contributions

Feel free to make any contributions. All contributions must follow the [code style](codestyle.md) and must also comes with valid and complete tests.
Feel free to make any contributions. All contributions must follow the [code style](http://php-on-couch.readthedocs.io/en/stable/quickstart/codestyle.html) and must also comes with valid and complete tests.

Help is really appreciated to complete add more tests.

### Feedback

[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/PHP-on-Couch/PHP-on-Couch)

Don't hesitate to submit feedback, bugs and feature requests ! My contact address is [alexiscote19@hotmail.com](mailto:alexiscote19@hotmail.com?subject=Feedback)
Don't hesitate to submit feedback, bugs and feature requests ! Our contact address is [phponcouch@gmail.com](mailto:phponcouch@gmail.com?subject=Feedback)


46 changes: 0 additions & 46 deletions TESTING.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions bin/install-doctools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo pip install sphinx sphinx-autobuild sphinx_rtd_theme sphinxcontrib-phpdomain recommonmark
Loading

0 comments on commit ac2fcec

Please sign in to comment.