Skip to content

Various documentation updates #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Nov 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
308f53d
Update instructions for building docs locally
jmikola Nov 8, 2016
c614525
PHPLIB-187: Remind users to encode connection URIs
jmikola Nov 8, 2016
6dcaeb7
PHPLIB-195: Document SSL driver options for MongoDB\Client
jmikola Nov 8, 2016
11b6a69
PHPLIB-174: Document that socket paths must be URL-encoded
jmikola Nov 8, 2016
56be18e
Revise tutorial articles
jmikola Nov 9, 2016
c988443
Fix escaping in PHP class references
jmikola Nov 14, 2016
7288472
Use section heading for "See Also" links
jmikola Nov 15, 2016
3cc5732
PHPLIB-234: Use "Return Values" section headings
jmikola Nov 15, 2016
4fd3790
PHPLIB-234: Document exceptions for API methods
jmikola Nov 15, 2016
2201f47
Fix spacing in Database class docs
jmikola Nov 16, 2016
3698343
PHPLIB-235: Document exception classes and interfaces
jmikola Nov 16, 2016
241707f
Revise BSON documentation and fix references
jmikola Nov 16, 2016
faafeec
Revise class documentation and fix references
jmikola Nov 16, 2016
7dc53b8
Fix method refs in Upgrade article
jmikola Nov 16, 2016
3495dc9
PHPLIB-235: Document write result classes
jmikola Nov 16, 2016
cc14abc
PHPLIB-235: Document BSON model classes
jmikola Nov 16, 2016
830148b
PHPLIB-235: Document enumeration model classes
jmikola Nov 16, 2016
47331cb
Add example data to tutorial
jmikola Nov 16, 2016
92617a5
Revise index and upgrade pages in documentation
jmikola Nov 16, 2016
40e8a2c
Remove trailing slash from manual links
jmikola Nov 16, 2016
63952aa
Note that $uriOptions need not be encoded
jmikola Nov 16, 2016
ef3bba8
DOCS-8719: MongoDB\Client example for SSL and auth
jmikola Nov 16, 2016
3828fbc
Refer to connection string manual page in Client constructor
jmikola Nov 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,10 @@ repository:
repository.
* Install [giza](https://pypi.python.org/pypi/giza/), as noted in the tools
README.
* Comment out the following `assets` entry in `config/build_conf.yaml`:
```
- branch: master
path: build/php-library # this is where we'll put the source docs (from the driver repo)
repository: https://github.com/mongodb/mongo-php-library.git
```

* Create a symlink so that `build/php-library` points to your working copy of
the [mongodb/mongo-php-library](https://github.com/mongodb/mongo-php-library)
repository.
* Build the documentation with `giza make html`. You can suppress informational
log messages via the `--level warning` option.
* Sync your working copy of the documentation to the `source/` directory with
`rsync -a --delete /path/to/mongo-php-library/docs/ source/`.
* Build the documentation with `giza make publish`. You can suppress
informational log messages with the `--level warning` option.
* Generated documentation may be found in the `build/master/html` directory.

## Releasing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,99 @@ description: |
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: allow_invalid_hostname
type: boolean
description: |
Disables hostname validation if ``true``. Defaults to ``false``.

Allowing invalid hostnames may expose the driver to a `man-in-the-middle
attack <https://en.wikipedia.org/wiki/Man-in-the-middle_attack>`_.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: ca_dir
type: string
description: |
Path to a correctly hashed certificate directory. The system certificate store
will be used by default.

Falls back to the deprecated ``capath`` SSL context option if not specified.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: ca_file
type: string
description: |
Path to a certificate authority file. The system certificate store will be
used by default.

Falls back to the deprecated ``cafile`` SSL context option if not specified.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: crl_file
type: string
description: |
Path to a certificate revocation list file.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: pem_file
type: string
description: |
Path to a PEM encoded certificate to use for client authentication.

Falls back to the deprecated ``local_cert`` SSL context option if not
specified.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: pem_pwd
type: string
description: |
Passphrase for the PEM encoded certificate (if applicable).

Falls back to the deprecated ``passphrase`` SSL context option if not
specified.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: weak_cert_validation
type: boolean
description: |
Disables certificate validation ``true``. Defaults to ``false``.

Falls back to the deprecated ``allow_self_signed`` SSL context option if not
specified.
interface: phpmethod
operation: ~
optional: true
---
arg_name: option
name: context
type: resource
description: |
:php:`SSL context options <manual/en/context.ssl.php>` to be used as fallbacks
for other driver options (as specified). Note that the driver does not consult
the default stream context.

This option is supported for backwards compatibility, but should be considered
deprecated.
interface: phpmethod
operation: ~
optional: true
...
15 changes: 12 additions & 3 deletions docs/includes/apiargs-MongoDBClient-method-construct-param.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ name: $uri
type: string
description: |
The URI of the standalone, replica set, or sharded cluster to which to
connect. Refer to the :manual:`MongoDB connection string reference
</reference/connection-string>` for formatting.
connect. Refer to :manual:`Connection String URI Format
</reference/connection-string>` in the MongoDB manual for more information.

Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.

Any special characters in the URI components need to be encoded according to
`RFC 3986 <http://www.faqs.org/rfcs/rfc3986.html>`_. This is particularly
relevant to the username and password, which can often include special
characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
socket, the socket path may contain special characters such as slashes and
must be encoded. The :php:`rawurlencode() <rawurlencode>` function may be used
to encode constituent parts of the URI.
interface: phpmethod
operation: ~
optional: true
Expand All @@ -17,7 +25,8 @@ type: array
description: |
Specifies additional URI options, such as authentication credentials or query
string parameters. The options specified in ``$uriOptions`` take precedence
over any analogous options present in the ``$uri`` string.
over any analogous options present in the ``$uri`` string and do not need to
be encoded according to `RFC 3986 <http://www.faqs.org/rfcs/rfc3986.html>`_.

Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
<mongodb-driver-manager.construct>` extension reference and :manual:`MongoDB
Expand Down
33 changes: 33 additions & 0 deletions docs/includes/extracts-error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ref: error-driver-invalidargumentexception
content: |
:php:`MongoDB\\Driver\\Exception\\InvalidArgumentException
<mongodb-driver-exception-invalidargumentexception>` for errors related to the
parsing of parameters or options at the driver level.
---
ref: error-driver-runtimeexception
content: |
:php:`MongoDB\\Driver\\Exception\\RuntimeException
<mongodb-driver-exception-runtimeexception>` for other errors at the driver
level (e.g. connection errors).
---
ref: error-badmethodcallexception-write-result
content: |
:phpclass:`MongoDB\\Exception\\BadMethodCallException` if this method is
called and the write operation used an unacknowledged :manual:`write concern
</reference/write-concern>`.
---
ref: error-invalidargumentexception
content: |
:phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to
the parsing of parameters or options.
---
ref: error-unexpectedvalueexception
content: |
:phpclass:`MongoDB\\Exception\\UnexpectedValueException` if the command
response from the server was malformed.
---
ref: error-unsupportedexception
content: |
:phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
not supported by the selected server (e.g. ``collation``, ``writeConcern``).
...
52 changes: 23 additions & 29 deletions docs/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,25 @@ MongoDB PHP Library

.. default-domain:: mongodb

The |php-library| provides a high-level abstraction
around the lower-level `PHP Driver <https://php.net/mongodb>`_, also
known as the ``mongodb`` extension.

While the ``mongodb`` extension provides a limited API for executing
commands, queries, and write operations, the |php-library|
implements an API similar to that of the `legacy PHP driver
<http://php.net/manual/en/book.mongo.php>`_. The library contains
abstractions for client, database, and collection objects, and provides
methods for CRUD operations and common commands such as index and
The |php-library| provides a high-level abstraction around the lower-level
`PHP Driver <https://php.net/mongodb>`_, also known as the ``mongodb``
extension.

While the ``mongodb`` extension provides a limited API for executing commands,
queries, and write operations, the |php-library| implements an API similar to
that of the `legacy PHP driver <http://php.net/manual/en/book.mongo.php>`_. The
library contains abstractions for client, database, and collection objects, and
provides methods for CRUD operations and common commands such as index and
collection management.

If you are developing a PHP application with MongoDB, you should consider
using this library, or another high-level abstraction, instead of the
extension alone.
If you are developing a PHP application with MongoDB, you should consider using
this library, or another high-level abstraction, instead of the extension alone.

For additional information about the MongoDB PHP Library and the
``mongodb`` extension, see the `Architecture Overview
<http://php.net/manual/en/mongodb.overview.php>`_ article in the
extension documentation. `Derick Rethans <http://derickrethans.nl/>`_
has also written a series of blog posts entitled *New MongoDB Drivers
for PHP and HHVM*:
For additional information about the MongoDB PHP Library and the ``mongodb``
extension, see the `Architecture Overview
<http://php.net/manual/en/mongodb.overview.php>`_ article in the extension
documentation. `Derick Rethans <http://derickrethans.nl/>`_ has also written a
series of blog posts entitled *New MongoDB Drivers for PHP and HHVM*:

- `Part One: History <https://derickrethans.nl/new-drivers.html>`_

Expand All @@ -42,26 +39,23 @@ If you are a new MongoDB user, these links should help you become more familiar
with MongoDB and introduce some of the concepts and terms you will encounter in
this documentation:

- `Introduction to CRUD operations in MongoDB
<http://docs.mongodb.org/manual/core/crud-introduction/>`_
- :manual:`Introduction to CRUD operations in MongoDB </core/crud>`

- `What is a MongoDB document?
<http://docs.mongodb.org/manual/core/document/>`_
- :manual:`What is a MongoDB document? </core/document>`

- `MongoDB's *dot notation* for accessing document properties
<http://docs.mongodb.org/manual/core/document/#dot-notation>`_
- :manual:`Dot notation for accessing document properties
</core/document/#dot-notation>`

- `ObjectId: MongoDB's document identifier
<http://docs.mongodb.org/manual/reference/object-id/>`_
- :manual:`ObjectId: MongoDB's document identifier </reference/object-id/>`

.. class:: hidden

.. toctree::
:titlesonly:

Installation </tutorial/install-php-library>
/tutorial
/upgrade
/reference

.. /getting-started
.. /getting-started
5 changes: 4 additions & 1 deletion docs/reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ Reference

.. toctree::
:titlesonly:

/reference/bson
/reference/class/MongoDBClient
/reference/class/MongoDBDatabase
/reference/class/MongoDBCollection
/reference/class/MongoDBGridFSBucket
/reference/write-result-classes
/reference/enumeration-classes
/reference/exception-classes
Loading