Throw exception if not running on 64 bit system

This commit is contained in:
Daniil Gentili 2016-12-12 15:36:46 +00:00
parent 1611c0f8ec
commit ba740d7be7
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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 {