Add bootstrap.php checking environment (MB_OVERLOAD_STRING).

This commit is contained in:
Andreas Fischer 2015-08-03 17:07:20 +02:00 committed by terrafrost
parent da36b5c91e
commit 29659f877d
3 changed files with 346 additions and 253 deletions

View File

@ -66,15 +66,11 @@
},
"include-path": ["phpseclib/"],
"autoload": {
"psr-0": {
"Crypt": "phpseclib/",
"File": "phpseclib/",
"Math": "phpseclib/",
"Net": "phpseclib/",
"System": "phpseclib/"
},
"files": [
"phpseclib/Crypt/Random.php"
]
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib\\": "phpseclib/"
}
}
}

569
composer.lock generated

File diff suppressed because it is too large Load Diff

16
phpseclib/bootstrap.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**
* Bootstrapping File for phpseclib
*
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
if (extension_loaded('mbstring')) {
// 2 - MB_OVERLOAD_STRING
if (ini_get('mbstring.func_overload') & 2) {
throw new \UnexpectedValueException(
'Overloading of string functions using mbstring.func_overload ' .
'is not supported by phpseclib.'
);
}
}