From f95c2baf9d7761152c54d2313725e23fa0b7a28e Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Tue, 27 Sep 2016 09:19:53 +0300 Subject: [PATCH 1/2] Cleanup config file There was a report (https://github.com/phpv8/v8js/issues/264) and a fix (https://github.com/phpv8/v8js/commit/90ca5cb14228891939ee653627d408cd931680ff) in v8js about missed natives_blob.bin. While php-v8 is not affected directly, it partially uses v8js config so this is a port of that fix. --- config.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index 852eb9f..ee28f3e 100644 --- a/config.m4 +++ b/config.m4 @@ -76,6 +76,7 @@ if test "$PHP_V8" != "no"; then for static_link_extra_file in $static_link_extra; do AC_MSG_CHECKING([for $static_link_extra_file]) + static_link_dir="" for i in $PHP_V8 $SEARCH_PATH ; do if test -r $i/lib64/$static_link_extra_file; then @@ -90,7 +91,7 @@ if test "$PHP_V8" != "no"; then if test -z "$static_link_dir"; then AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please provide $static_link_extra_file next to the libv8.so, see README.md for details]) + AC_MSG_ERROR([Please provide $static_link_extra_file next to the libv8.so]) fi LDFLAGS="$LDFLAGS $static_link_dir/$static_link_extra_file" From cff2adb616b61c6e23f39967fb5324eca1dfcdcb Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Tue, 27 Sep 2016 10:18:39 +0300 Subject: [PATCH 2/2] Add note about stub files installation [skip ci], closes #10 --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62a60e5..430ac35 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,19 @@ $result = $script->Run($context); echo $result->ToString($context)->Value(), PHP_EOL; ``` -which will output `Hello, World!`. See how it's shorter and more readable than [that C++ version]([v8-hello-world])? +which will output `Hello, World!`. See how it's shorter and more readable than [that C++ version][v8-hello-world]? And it also doesn't limit you from V8 API utilizing to implement more amazing stuff. + +## Stub files + +If you are also using Composer, it is recommended to add the [php-v8-stub][php-v8-stubs] +package as a dev-mode requirement. It provides skeleton definitions and annotations to enable support for auto-completion +in your IDE and other code-analysis tools. + + composer require --dev pinepain/php-v8-stubs + + ## Installation ### Requirements @@ -155,3 +165,4 @@ Copyright (c) 2015-2016 Bogdan Padalko <pinepain@gmail.com> [v8-intro]: https://developers.google.com/v8/intro [php70-v8.rb]: https://github.com/pinepain/php-v8/blob/master/scripts/homebrew/php70-v8.rb [php71-v8.rb]: https://github.com/pinepain/php-v8/blob/master/scripts/homebrew/php71-v8.rb +[php-v8-stubs]: https://github.com/pinepain/php-v8-stubs