Add bootstrap.php checking environment (MB_OVERLOAD_STRING).

This commit is contained in:
Andreas Fischer 2015-08-03 17:07:20 +02:00
parent 772d4df597
commit cd57bf31ae
3 changed files with 20 additions and 1 deletions

View File

@ -61,6 +61,9 @@
},
"include-path": ["phpseclib/"],
"autoload": {
"files": [
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib\\": "phpseclib/"
}

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "b24ab20be15b6312e532ee2ffa18d5fa",
"hash": "98a14889a81b2d6ecbb029483e954dec",
"packages": [],
"packages-dev": [
{

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.'
);
}
}