0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 15:11:53 +00:00

Write deprecation warning on non-empty $extensions array passed to V8Js::__construct

This commit is contained in:
Stefan Siegl 2017-09-25 14:06:33 +02:00
parent 9734466105
commit 22bcf85348
No known key found for this signature in database
GPG Key ID: B224EC6857AD7F9B
3 changed files with 9 additions and 0 deletions

View File

@ -36,5 +36,7 @@ array(2) {
bool(false)
}
}
Deprecated: V8Js::__construct(): Use of extensions is deprecated, $extensions array passed in %s%eextensions_basic.php on line 8
Hello world!
===EOF===

View File

@ -41,6 +41,8 @@ array(2) {
}
}
Deprecated: V8Js::__construct(): Use of extensions is deprecated, $extensions array passed in %s%eextensions_circular_dependency.php on line 8
Warning: Fatal V8 error in v8::Context::New(): Circular extension dependency in %s on line 8
Fatal error: Uncaught V8JsException: Failed to create V8 context. Check that registered extensions do not have errors. in %s:8

View File

@ -401,6 +401,11 @@ static PHP_METHOD(V8Js, __construct)
if (exts_arr)
{
exts_count = zend_hash_num_elements(Z_ARRVAL_P(exts_arr));
if (exts_count != 0) {
php_error_docref(NULL, E_DEPRECATED, "Use of extensions is deprecated, $extensions array passed");
}
if (v8js_create_ext_strarr(&exts, exts_count, Z_ARRVAL_P(exts_arr)) == FAILURE) {
zend_throw_exception(php_ce_v8js_exception,
"Invalid extensions array passed", 0);