Async PHP client/server API for the telegram MTProto protocol https://docs.madelineproto.xyz
Go to file
2016-11-17 20:43:52 +03:00
.vscode Fixed serialization/deserialization, now fixing mess in prime number generation module... 2016-07-18 17:11:37 +02:00
src/danog/MadelineProto Fixed bugs 2016-11-17 20:43:52 +03:00
.gitignore Added APIFactory for calling namespaced mtproto methods, cleaned up testing.php and API.php, moved authorization keys, session_id, seq_no and time delta to the Connection class, added close_and_reopen method to the Connection class, improved DataCenter class, renamed Logging class to Logger, added a bit more logging, added setup_logger, switch_dc, init_authorization methods to the MTProto class, added parameter to disable automatic switching to nearest DC in write_client_info, added a try catch block in the create_auth_key method, fixed switching of DCs in wait_for_response method, added arguments check in the method calling methods, added a message id check in MessageHandler, added method_name_namespaced array in TL for APIFactory, renamed a lot of stuff and removed a few checks in the TL class, moved sendCode test call to testing.php 2016-11-16 17:05:27 +03:00
.travis.yml Fixed prime module, removed dependencies from repository, adapted for hhvm. 2016-08-10 14:51:28 +02:00
composer.json Updated tags 2016-11-17 15:05:31 +03:00
composer.lock Removed useless dependencies, made logging class static, made access to the PHPStruct class static, added default_dc setting in the settings array 2016-11-15 15:39:42 +03:00
CONTRIBUTING.md Create CONTRIBUTING.md 2016-10-03 13:53:56 +02:00
LICENSE Reorganized code 2016-08-08 18:10:13 +02:00
README.md Updated docs 2016-11-17 14:10:22 +03:00
testing.php BTW I'm doing this offline 2016-11-17 14:52:33 +03:00

MadelineProto

StyleCI Build Status

Licensed under AGPLv3.

PHP implementation of MTProto, based on telepy.

This project can run on PHP 7, PHP 5.6 and HHVM.

This is a WIP.

Structure of this project:

src/danog/MadelineProto/
    MTProtoTools/
        AckHandler - Handles acknowledgement of incoming and outgoing mtproto messages
        AuthKeyHandler - Handles generation of the temporary and permanent authorization keys
        CallHandler - Handles synchronous calls to mtproto methods or objects, also basic response management (waits until the socket receives a response)
        Crypt - Handles ige and aes encryption
        Exception - Handles exceptions in the MTProtoTools namespace
        MessageHandler - Handles sending and receiving of mtproto messages (packs TL serialized data with message id, auth key id and encrypts it with Crypt if needed, adds them to the arrays of incoming and outgoing messages)
        MsgIdHandler - Handles message ids (checks if they are valid, adds them to the arrays of incoming and outgoing messages)
        ResponseHandler - Handles the content of responses received, service messages, rpc results, errors, and stores them into the response section of the outgoing messages array)
        SaltHandler - Handles server salts
        SeqNoHandler - Handles sequence numbers (checks validity)
    TL/
        Exception - Handles exceptions in the TL namespace
        TL - Handles TL serialization and deserialization
        TLConstructor - Represents a TL Constructor
        TLMethod - Represents a TL method
    API - Wrapper class that istantiates the MTProto class, sets the error handler, and provides a wrapper for calling mtproto methods directly as class submethods
    APIFactory - Provides a wrapper for calling namespaced mtproto methods directly as class submethods
    Connection - Handles tcp/udp/http connections and wrapping payloads generated by MTProtoTools/MessageHandler into the right message according to the protocol, stores authorization keys, session id and sequence number
    DataCenter - Handles mtproto datacenters (is a wrapper for Connection classes)
    DebugTools - Various debugging tools
    Exception - Handles exceptions in the main namespace
    MTProto - Extends MTProtoTools, handles initial connection, generation of authorization keys, istantiation of classes, writing of client info
    MTProtoTools - Extends all of the classes in MTProtoTools/
    prime.py and getpq.py - prime module (python) for p and q generation
    PrimeModule.php - prime module (php) for p and q generation by wrapping the python module, using wolfram alpha or a built in PHP engine
    RSA - Handles RSA public keys and signatures
    Tools - Various tools (positive modulus, string2bin, python-like range)

This project adheres to the Hacktoberfest event by DigitalOcean.
Browse the issues of this project and help close at least four of them with a pull request to get a free t-shirt!
Check out the Contribution guide first though.