Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
src/ | 19-Apr-2024 | - | 3,257 | 1,462 | ||
tests/ | 19-Apr-2024 | - | 876 | 708 | ||
.editorconfig | D | 18-Apr-2024 | 312 | 16 | 12 | |
.scrutinizer.yml | D | 18-Apr-2024 | 741 | 32 | 28 | |
.travis.yml | D | 18-Apr-2024 | 819 | 37 | 26 | |
CHANGELOG.md | D | 18-Apr-2024 | 307 | 23 | 14 | |
CODE_OF_CONDUCT.md | D | 18-Apr-2024 | 3.1 KiB | 75 | 56 | |
CONTRIBUTING.md | D | 18-Apr-2024 | 1.3 KiB | 32 | 16 | |
ISSUE_TEMPLATE.md | D | 18-Apr-2024 | 717 | 28 | 15 | |
LICENSE.md | D | 18-Apr-2024 | 1.2 KiB | 23 | 20 | |
PULL_REQUEST_TEMPLATE.md | D | 18-Apr-2024 | 1.8 KiB | 44 | 26 | |
README.md | D | 18-Apr-2024 | 2.4 KiB | 82 | 57 | |
composer.json | D | 18-Apr-2024 | 1.4 KiB | 62 | 61 | |
phpunit.xml.dist | D | 18-Apr-2024 | 943 | 29 | 28 |
README.md
1# Matrix client SDK for PHP 2[![Software License][ico-license]](LICENSE.md) 3[![Software Version][ico-version]](https://packagist.org/packages/meet-kinksters/php-matrix-sdk) 4![Software License][ico-downloads] 5 6This is a Matrix client-server SDK for php 7.4+, initially copied from 7[matrix-org/matrix-python-sdk][python-pck]. 8 9This package is still a work in progress, and at the current time, not everything has been ported: 10- Missing E2E encryption, need php bindings for the OLM library 11- Live sync 12- Unit tests for the client 13 14## Installation 15 16``` 17composer require meet-kinksters/php-matrix-sdk 18``` 19 20## Usage 21Client: 22```php 23require('vendor/autoload.php'); 24use MatrixPhp\MatrixClient; 25 26$client = new MatrixClient("http://localhost:8008"); 27 28// New user 29$token = $client->registerWithPassword("foobar", "monkey"); 30 31// Existing user 32$token = $client->login("foobar", "monkey"); 33 34$room = $client->createRoom("my_room_alias"); 35$room->sendText("Hello!"); 36``` 37 38API: 39```php 40require('vendor/autoload.php'); 41use MatrixPhp\MatrixHttpApi; 42 43$matrix = new MatrixHttpApi("http://localhost:8008", $sometoken); 44 45$response = $matrix->sendMessage("!roomid:matrix.org", "Hello!"); 46``` 47 48##Structure 49The SDK is split into two modules: ``api`` and ``client``. 50 51###API 52This contains the raw HTTP API calls and has minimal business logic. You can 53set the access token (``token``) to use for requests as well as set a custom 54transaction ID (``txn_id``) which will be incremented for each request. 55 56###Client 57This encapsulates the API module and provides object models such as ``Room``. 58 59## Contributing 60 61Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details. 62 63## Security 64 65If you discover any security related issues, please email brad@kinksters.dating 66instead of using the issue tracker. 67 68## Credits 69 70- [Brad Jones](https://github.com/bradjones1) at [Meet Kinksters](https://tech.kinksters.dating) 71- [Yoann Celton](https://github.com/Aryess) (initial port) 72- [All Contributors](https://github.com/meet-kinksters/php-matrix-sdk/graphs/contributors) 73 74## License 75 76[MIT License](LICENSE.md). 77 78[ico-version]: https://img.shields.io/packagist/v/meet-kinksters/php-matrix-sdk.svg?style=flat-square 79[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square 80[ico-downloads]: https://img.shields.io/packagist/dt/meet-kinksters/php-matrix-sdk.svg?style=flat-square 81[python-pck]: https://github.com/matrix-org/matrix-python-sdk 82