Go to file
2022-06-17 15:08:26 +02:00
src fix(typo): add $ to econtent 2022-06-17 15:08:26 +02:00
tests Merge upstream commit '396376ceb9bea3d2fa9a860401da27c267fd9a17' into feature/guzzle7-update 2022-02-19 17:24:57 +01:00
.editorconfig Added end_of_line & some more info about this file 2015-05-14 20:09:24 +02:00
.gitattributes Add phpcs to gitignore and gitattributes file 2018-11-06 23:26:04 +02:00
.gitignore Update composer.json, guzzle and .gitignore 2021-09-18 12:14:53 +02:00
.scrutinizer.yml Use new PHP analysis engine 2018-03-04 19:30:46 +02:00
.travis.yml Removing psr2 enforcing 2018-11-28 19:57:29 +11:00
CHANGELOG.md Prefilling info 2018-11-27 22:01:37 +11:00
CODE_OF_CONDUCT.md Prefilling info 2018-11-27 22:01:37 +11:00
composer.json Merge upstream commit '0f6f2958e9db5e5ea9a5ba014ddcce7c486edf53' into feature/guzzle7-update 2022-04-26 00:19:35 +02:00
CONTRIBUTING.md Prefilling info 2018-11-27 22:01:37 +11:00
ISSUE_TEMPLATE.md Use PHP-specific examples in Issue template 2016-08-23 20:23:08 +02:00
LICENSE.md Prefilling info 2018-11-27 22:01:37 +11:00
phpunit.xml.dist Preparing for tests 2018-11-28 23:22:55 +11:00
PULL_REQUEST_TEMPLATE.md Add note about CI 2016-11-01 10:13:31 +01:00
README.md Update composer.json, guzzle and .gitignore 2021-09-18 12:14:53 +02:00

Matrix client SDK for php

Software License

This is a Matrix client-server SDK for php 7.2.5+, mostly copied from matrix-org/matrix-python-sdk

This package is still a work in progress, and at the current time, not everything has been ported:

  • 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

Installation

composer require aryess/php-matrix-sdk

Usage

Client:

require('vendor/autoload.php');
use Aryess\PhpMatrixSdk\MatrixClient;

$client = new MatrixClient("http://localhost:8008");

// New user
$token = $client->registerWithPassword("foobar", "monkey");

// Existing user
$token = $client->login("foobar", "monkey");

$room = $client->createRoom("my_room_alias");
$room->sendText("Hello!");

API:

require('vendor/autoload.php');
use Aryess\PhpMatrixSdk\MatrixHttpApi;

$matrix = new MatrixHttpApi("http://localhost:8008", $sometoken);

$response = $matrix->sendMessage("!roomid:matrix.org", "Hello!");

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

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email aryess@github.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.