Documentation

This commit is contained in:
Robin Appelman 2017-02-01 14:56:25 +01:00
commit 3f23e989f0
8 changed files with 152 additions and 21 deletions

58
README.md Normal file
View file

@ -0,0 +1,58 @@
# SearchDAV
A sabre/dav plugin to implement rfc5323 SEARCH
## Usage
The plugin implements the DAV specific parts of the rfc but leaves the actual search
implementation to the user of the plugin.
This is done by implementing the `\SearchDAV\Backend\ISearchBackend` interface and passing
it to the plugin during construction.
### Basic usage
```php
$server = new \Sabre\DAV\Server();
$server->addPlugin(new \SearchDAV\DAV\SearchPlugin(new MySearchBackend()));
$server->exec();
```
### Terms
The rfc uses the following terms to describe various part of search handling
- Search scope: the DAV resource that is being queries.
- Search arbiter: the end point to which the SEARCH request can be made.
Note that a single search arbiter can support searching in multiple scopes
- Search grammar: The type of search query that is supported by a scope
rfc5323 requires any implementation to at least implement "basicsearch" which is
also currently the only supported grammar in this plugin
- Search schema: Details on how to use a search grammar,
such as the supported properties that can be searched for
### ISearchBackend
The `ISearchBackend` defines the arbiter end point, which scopes are valid to query,
the search schema that is supported and implements the actual search.
For a full list of methods required and their description see [`ISearchBackend.php`](src/Backend/ISearchBackend.php)
### BasicSearch
The `BasicSearch` class defines the query that was made by the client and consists of four parts:
- select: the properties are requested.
- from: the scope(s) in which the search should be made.
- where: the filter parameters for the search.
- orderBy: how the search results should be ordered.
For further information about these elements see
[`BasicSearch.php`](src/XML/BasicSearch.php), [`Scope.php`](src/XML/Scope.php),
[`Operator.php`](src/XML/Operator.php) and [`Order.php`](src/XML/Order.php)