Giter VIP home page Giter VIP logo

matrix-php-sdk's Introduction

Matrix client SDK for php

Software License

This is a Matrix client-server SDK for php 7.0+, 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 [email protected] instead of using the issue tracker.

Credits

License

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

matrix-php-sdk's People

Contributors

alexbilbie avatar alnutile avatar andylolz avatar arukompas avatar assertchris avatar barryvdh avatar bcrowe avatar bencorlett avatar bradjones1 avatar browner12 avatar clarkeash avatar colinodell avatar dragoonis avatar emanueleminotto avatar frankdejonge avatar gmponos avatar hansott avatar hassankhan avatar jclyons52 avatar jotaelesalinas avatar kdubuc avatar localheinz avatar luizvaz avatar maadhattah avatar marcqualie avatar philsturgeon avatar ravage84 avatar reinink avatar robloach avatar sanmai avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.