HHVM fixes
This commit is contained in:
parent
96f943f78e
commit
092cc44d75
@ -2,9 +2,18 @@
|
||||
|
||||
namespace phpseclib\Math;
|
||||
|
||||
if (PHP_MAJOR_VERSION < 7 && !(class_exists('\Phar') && \Phar::running())) {
|
||||
if (PHP_MAJOR_VERSION < 7 && !(class_exists('\\Phar') && \Phar::running())) {
|
||||
throw new \Exception('MadelineProto requires php 7 to run');
|
||||
}
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$engines = [['PHP64', ['OpenSSL']], ['BCMath', ['OpenSSL']], ['PHP32', ['OpenSSL']]];
|
||||
foreach ($engines as $engine) {
|
||||
try {
|
||||
\phpseclib\Math\BigInteger::setEngine($engine[0], isset($engine[1]) ? $engine[1] : []);
|
||||
break;
|
||||
} catch (\Exception $e) {}
|
||||
}
|
||||
}
|
||||
|
||||
class BigIntegor
|
||||
{
|
||||
|
@ -597,7 +597,7 @@ trait TL
|
||||
stream_get_contents($stream, $resto);
|
||||
}
|
||||
} else {
|
||||
$x = stream_get_contents($stream, $l);
|
||||
$x = $l ? stream_get_contents($stream, $l) : '';
|
||||
$resto = $this->posmod(-($l + 1), 4);
|
||||
if ($resto > 0) {
|
||||
stream_get_contents($stream, $resto);
|
||||
|
@ -32,6 +32,7 @@ composer update
|
||||
cd ..
|
||||
|
||||
$php7to5 convert --copy-all phar7 phar5 >/dev/null
|
||||
find phar5 -type f -exec sed 's/\w* \.\.\./.../' -i {} +
|
||||
|
||||
[ "$TRAVIS_BRANCH" != "master" ] && branch="-$TRAVIS_BRANCH" || branch=""
|
||||
|
||||
|
@ -32,6 +32,7 @@ cp -a ../src vendor/danog/madelineproto
|
||||
cd ..
|
||||
|
||||
$php7to5 convert --copy-all phar7 phar5 >/dev/null
|
||||
find phar5 -type f -exec sed 's/\w* \.\.\./.../' -i {} +
|
||||
|
||||
php makephar.php phar5 madeline.phar $(cat .git/refs/heads/master)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user