mirror of
https://github.com/danog/phpseclib.git
synced 2024-11-26 20:35:21 +01:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
8448f63d76
@ -8,6 +8,7 @@ php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
env:
|
||||
global:
|
||||
|
@ -616,7 +616,7 @@ class ASN1
|
||||
}
|
||||
|
||||
// Fail mapping if all input items have not been consumed.
|
||||
return $i < $n? null: $map;
|
||||
return $i < $n ? null: $map;
|
||||
|
||||
// the main diff between sets and sequences is the encapsulation of the foreach in another for loop
|
||||
case self::TYPE_SET:
|
||||
|
@ -803,6 +803,39 @@ class BigInteger
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* __debugInfo() magic method
|
||||
*
|
||||
* Will be called, automatically, when print_r() or var_dump() are called
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function __debugInfo()
|
||||
{
|
||||
$opts = array();
|
||||
switch (MATH_BIGINTEGER_MODE) {
|
||||
case MATH_BIGINTEGER_MODE_GMP:
|
||||
$engine = 'gmp';
|
||||
break;
|
||||
case MATH_BIGINTEGER_MODE_BCMATH:
|
||||
$engine = 'bcmath';
|
||||
break;
|
||||
case MATH_BIGINTEGER_MODE_INTERNAL:
|
||||
$engine = 'internal';
|
||||
$opts[] = PHP_INT_SIZE == 8 ? '64-bit' : '32-bit';
|
||||
}
|
||||
if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_GMP && defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
||||
$opts[] = 'OpenSSL';
|
||||
}
|
||||
if (!empty($opts)) {
|
||||
$engine.= ' (' . implode($opts, ', ') . ')';
|
||||
}
|
||||
return array(
|
||||
'value' => '0x' . $this->toHex(true),
|
||||
'engine' => $engine
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds two BigIntegers.
|
||||
*
|
||||
|
@ -355,4 +355,15 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
||||
'Failed asserting that Alice and Bob share the same BigInteger.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 5.6
|
||||
*/
|
||||
public function testDebugInfo()
|
||||
{
|
||||
$num = new Math_BigInteger(50);
|
||||
$str = print_r($num, true);
|
||||
$this->assertContains('[value] => 0x32', $str);
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
@ -21,10 +21,5 @@ function install_php_extension
|
||||
}
|
||||
|
||||
# runkit
|
||||
if [ "$TRAVIS_PHP_VERSION" == "5.6" ]
|
||||
then
|
||||
git clone https://github.com/adrianguenter/runkit.git
|
||||
else
|
||||
git clone https://github.com/zenovich/runkit.git
|
||||
fi
|
||||
git clone https://github.com/zenovich/runkit.git
|
||||
install_php_extension 'runkit'
|
||||
|
Loading…
Reference in New Issue
Block a user