PHP extension for V8 JavaScript engine
This release adds script compilation and caching. Also more new methods added and some internal logic refactored. See detailed changes below.
As of this release, V8 >= 5.8.168 required.
*
- BC-breaking or potentially BC-breaking changes
Changes to public API and other important changes which may affect end-user:
*
Add $is_wasm
and $is_module
options to V8\ScriptOriginOptions
and V8\ScriptOrigin
;*
Remove non-standard V8\Scrip::{getSource,getOrigin}
;*
Remove V8\ObjectValue::{Get,Set,Has,Delete,CreateDataProperty}Indexed
methods;*
Remove non-working V8\Context
extensions support;*
Handle V8\IntegerValue
sub-types when returning values from V8, fixes #19;V8\UnboundScript
class;V8\ScriptCompiler\CachedData
class;V8\ScriptCompiler\CompileOptions
class;V8\ScriptCompiler\Source
class;V8\ScriptCompiler
;V8\SymbolValue::GetToPrimitive()
method;V8\Value::IsNullOrUndefinedl()
method;V8\Value::Is*()
methods;V8\MapObject
;V8\SetObject
;In this PR new methods added and some internal logic refactored.
As of this release, V8 >= 5.4.420 required.
Also, deprecated or soon to be deprecated API calls are removed in this release, see note on BC-breaking changes below.
V8\Isolate::IsInUse()
method.V8\AdjustableExternalMemoryInterface
interface;V8\ObjectValue::AdjustExternalAllocatedMemory()
method;V8\ObjectValue::GetExternalAllocatedMemory()
method;V8\FunctionTemplate::AdjustExternalAllocatedMemory()
method;V8\FunctionTemplate::GetExternalAllocatedMemory()
method;V8\ObjectTemplate::AdjustExternalAllocatedMemory()
method;V8\ObjectTemplate::GetExternalAllocatedMemory()
method;V8\Value::TypeOf()
method;V8\ObjectValue::IsConstructor()
method;V8\ObjectValue::SetIntegrityLevel()
method;V8\CallbackInfo::InContext()
method;V8\ReturnValue::InContext()
method;V8\ReturnValue::Get()
method;V8\HeapStatistics::malloced_memory()
method;V8\HeapStatistics::peak_malloced_memory()
method;V8\ReturnValue
internals and integration with callbacks.BC breaking changes:
This is a first public release.
PHP 7 only (>= 7.0), including PHP 7.1.
This release works best with V8 Google JavaScript engine version 5.2 installed. At this time extension tested using 5.2.371.
For Ubuntu there are pinepain/libv8-5.2 PPA. To install fresh libv8 do:
$ sudo add-apt-repository ppa:pinepain/libv8-5.2 -y
$ sudo apt-get update -q
$ sudo apt-get install -y libv8-5.2-dev
For OS X there are v8.rb homebrew formula. To install fresh libv8 do:
$ brew install https://raw.githubusercontent.com/pinepain/php-v8/v0.1.0/scripts/homebrew/v8.rb
No windows support at this time, though, there should be nothing preventing to add it except of getting how to properly package V8 itself for windows.