Updating README
This commit is contained in:
parent
8c300b3e25
commit
13df7ff2ad
84
README.md
84
README.md
|
@ -1,55 +1,70 @@
|
||||||
# PhpMatrixSdk
|
# Matrix client SDK for php
|
||||||
|
|
||||||
[![Latest Version on Packagist][ico-version]][link-packagist]
|
|
||||||
[![Software License][ico-license]](LICENSE.md)
|
[![Software License][ico-license]](LICENSE.md)
|
||||||
[![Build Status][ico-travis]][link-travis]
|
|
||||||
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
|
|
||||||
[![Quality Score][ico-code-quality]][link-code-quality]
|
|
||||||
[![Total Downloads][ico-downloads]][link-downloads]
|
|
||||||
|
|
||||||
**Note:** Replace ```Yoann Celton``` ```aryess``` ```https://github.com/aryess``` ```aryess@github.com``` ```Aryess``` ```PhpMatrixSdk``` ```Later``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE.md](LICENSE.md) and [composer.json](composer.json) files, then delete this line. You can run `$ php prefill.php` in the command line to make all replacements at once. Delete the file prefill.php as well.
|
This is a Matrix client-server SDK for php 7.0+, mostly copied from [matrix-org/matrix-python-sdk][python-pck]
|
||||||
|
|
||||||
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what
|
This package is still a work in progress, and at the current time, not everything has been ported:
|
||||||
PSRs you support to avoid any confusion with users and contributors.
|
- Missing E2E encryption, need php bindings for the OLM library
|
||||||
|
- No live sync, because I'm not going to go into php multithreading
|
||||||
|
- Unit tests for the client (soon)
|
||||||
|
|
||||||
## Structure
|
<aside class="warning">
|
||||||
|
THIS HAS NOT YET BEEN FULLY TESTED
|
||||||
|
</aside>
|
||||||
|
|
||||||
If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.
|
## Installation
|
||||||
|
|
||||||
```
|
### Stable release
|
||||||
bin/
|
|
||||||
config/
|
|
||||||
src/
|
|
||||||
tests/
|
|
||||||
vendor/
|
|
||||||
```
|
|
||||||
|
|
||||||
|
tba
|
||||||
|
|
||||||
## Install
|
### Developement version
|
||||||
|
```shell
|
||||||
Via Composer
|
git clone https://github.com/aryess/matrix-php-sdk.git
|
||||||
|
cd matrix-php-sdk
|
||||||
``` bash
|
composer install
|
||||||
$ composer require Aryess/PhpMatrixSdk
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
Client:
|
||||||
|
```php
|
||||||
|
require('vendor/autoload.php');
|
||||||
|
use Aryess\PhpMatrixSdk\MatrixClient;
|
||||||
|
|
||||||
``` php
|
$client = new MatrixClient("http://localhost:8008");
|
||||||
$skeleton = new Aryess\PhpMatrixSdk();
|
|
||||||
echo $skeleton->echoPhrase('Hello, League!');
|
// New user
|
||||||
|
$token = $client->registerWithPassword("foobar", "monkey");
|
||||||
|
|
||||||
|
// Existing user
|
||||||
|
$token = $client->login("foobar", "monkey");
|
||||||
|
|
||||||
|
$room = $client->createRoom("my_room_alias");
|
||||||
|
$room->sendText("Hello!");
|
||||||
```
|
```
|
||||||
|
|
||||||
## Change log
|
API:
|
||||||
|
```php
|
||||||
|
require('vendor/autoload.php');
|
||||||
|
use Aryess\PhpMatrixSdk\MatrixHttpApi;
|
||||||
|
|
||||||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
|
$matrix = new MatrixHttpApi("http://localhost:8008", $sometoken);
|
||||||
|
|
||||||
## Testing
|
$response = $matrix->sendMessage("!roomid:matrix.org", "Hello!");
|
||||||
|
|
||||||
``` bash
|
|
||||||
$ composer test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##Structure
|
||||||
|
The SDK is split into two modules: ``api`` and ``client``.
|
||||||
|
|
||||||
|
###API
|
||||||
|
This contains the raw HTTP API calls and has minimal business logic. You can
|
||||||
|
set the access token (``token``) to use for requests as well as set a custom
|
||||||
|
transaction ID (``txn_id``) which will be incremented for each request.
|
||||||
|
|
||||||
|
###Client
|
||||||
|
This encapsulates the API module and provides object models such as ``Room``.
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
|
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
|
||||||
|
@ -81,3 +96,4 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
|
||||||
[link-downloads]: https://packagist.org/packages/Aryess/PhpMatrixSdk
|
[link-downloads]: https://packagist.org/packages/Aryess/PhpMatrixSdk
|
||||||
[link-author]: https://github.com/aryess
|
[link-author]: https://github.com/aryess
|
||||||
[link-contributors]: ../../contributors
|
[link-contributors]: ../../contributors
|
||||||
|
[python-pck]: https://github.com/matrix-org/matrix-python-sdk
|
Loading…
Reference in a new issue