icewind / searchdav
sabre/dav plugin to implement rfc5323 SEARCH
Installs: 12 562
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 6
Open Issues: 0
Requires
- php: >=7.3 || >=8.0
- sabre/dav: ^4.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2
- php-parallel-lint/php-parallel-lint: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8
- psalm/phar: ^4.3
README
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
$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
Query
The Query
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
Query.php
, Scope.php
,
Operator.php
and Order.php