From ba740d7be75668901429d291feb2119106d91709 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 12 Dec 2016 15:36:46 +0000 Subject: [PATCH] Throw exception if not running on 64 bit system --- README.md | 2 +- src/danog/MadelineProto/MTProto.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58c34a75..fa63cda8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Created by [Daniil Gentili](https://daniil.it), licensed under AGPLv3. PHP implementation of MTProto, based on [telepy](https://github.com/griganton/telepy_old). -This project can run on PHP 7, PHP 5.6 and HHVM. +This project can run on PHP 7, PHP 5.6 and HHVM, only 64 bit systems are supported ATM. Also note that MadelineProto will perform better if a big math extension like gmp o bcmath is installed. diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index b07735bd..8a430123 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -38,6 +38,11 @@ class MTProto extends MTProtoTools public function __construct($settings = []) { + // Detect 64 bit + if (PHP_INT_SIZE < 8) { + throw new Exception('MadelineProto supports only 64 bit systems ATM'); + } + // Detect ipv6 $google = ''; try {