kuzzleio / kuzzle-sdk
Official PHP SDK for Kuzzle
Installs: 98 032
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 11
Forks: 1
Open Issues: 5
Requires
- php: >=5.4
- ext-curl: *
- ramsey/uuid: ^3.4
Requires (Dev)
- phpdocumentor/phpdocumentor: 2.9.0
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: 2.*
This package is not auto-updated.
Last update: 2022-10-07 00:05:54 UTC
README
Official Kuzzle PHP SDK
About Kuzzle
A backend software, self-hostable and ready to use to power modern apps.
You can access the Kuzzle repository on Github
SDK Documentation
The complete SDK documentation is available here
Installation
This SDK can be used in any project using composer:
composer require kuzzleio/kuzzle-sdk
Basic usage
<?php use \Kuzzle\Kuzzle; use \Kuzzle\Document; $kuzzle = new Kuzzle('localhost'); $collection = $kuzzle->collection('bar', 'foo'); $firstDocument = new Document($collection, 'john', ['name' => 'John', 'age' => 42]); $secondDocument = new Document($collection, 'michael', ['name' => 'Michael', 'age' => 36]); $firstDocument->save(['refresh' => 'wait_for']); $secondDocument->save(['refresh' => 'wait_for']); $result = $collection->search(['sort' => [['age' => 'asc']]]); foreach ($result->getDocuments() as $document) { $content = $document->getContent(); echo "Name: {$content['name']}, age: {$content['age']}\n"; }
Running Tests
php ./vendor/bin/phpcs -p -n --standard=PSR2 src
php ./vendor/bin/phpunit