PHP extension for V8 JavaScript engine

Overview

php-v8

PHP extension for V8 JavaScript engine

Build Status GitHub license Docs

This extension requires PHP >= 7.2. Last version that supports PHP 7.1 is v0.2.2 and for PHP 7.0 is v0.1.9.

This extension is still under heavy development and its public API may change without any warning. Use at your own risk.

Work in progress documentation could be found at https://php-v8.readthedocs.io. You can also use tests and stubs as reference.

Why (aka Rationale)

This tool solves following domain problems:

  • execute arbitrary untrusted code from user;
  • provide restricted/experimental api to end-user;
  • allow to use that with scripting/DSL language;
  • limit execution time and used memory;
  • use common language that is familiar to large audience;
  • be well-maintainable and mature.

By accident (not by design) this tool could also be used to:

  • render React/Vue/Angular components in PHP;
  • implement node.js in PHP;
  • increase the number of "why", "why not just <...>" questions.

If you have any other use, feels free to share

About

php-v8 is a PHP 7.x extension that brings V8 JavaScript engine API to PHP with some abstraction in mind and provides an accurate native V8 C++ API implementation available from PHP.

Key features:

  • provides up-to-date JavaScript engine with recent ECMA features supported;
  • accurate native V8 C++ API implementation available from PHP;
  • solid experience between native V8 C++ API and V8 API in PHP;
  • no magic; no assumptions;
  • does what it is asked to do;
  • hides complexity with isolates and contexts scope management under the hood;
  • provides a both-way interaction with PHP and V8 objects, arrays and functions;
  • execution time and memory limits;
  • multiple isolates and contexts at the same time;
  • it works.

With this extension almost everything that the native V8 C++ API provides can be used. It provides a way to pass PHP scalars, objects and functions to the V8 runtime and specify interactions with passed values (objects and functions only, as scalars become js scalars too). While specific functionality will be done in PHP userland rather than in this C/C++ extension, it lets you get into V8 hacking faster, reduces time costs and gives you a more maintainable solution. And it doesn't make any assumptions for you, so you stay in control, it does exactly what you ask it to do.

With php-v8 you can even implement nodejs in PHP. Not sure whether anyone should/will do this anyway, but it's doable.

Demo

Here is a Hello World from V8 Getting Started developers guide page implemented in PHP with php-v8:

<?php
$isolate = new \V8\Isolate();
$context = new \V8\Context($isolate);
$source = new \V8\StringValue($isolate, "'Hello' + ', World!'");

$script = new \V8\Script($context, $source);
$result = $script->run($context);

echo $result->value(), PHP_EOL;

which will output Hello, World!. See how it's shorter and more readable than that C++ version? And it also doesn't limit you from V8 API utilizing to implement more amazing stuff.

Quick start

You can try php-v8 in phpv8/php-v8: docker run -it phpv8/php-v8 bash -c "php test.php"

Stub files

If you are also using Composer, it is recommended to add the php-v8-stub 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 phpv8/php-v8-stubs

High-level wrapper library

There is phpv8/js-sandbox library that provides high-level abstraction on top of php-v8 extension and makes embedding JavaScript in PHP easier.

Installation

Requirements

V8

You will need a recent v8 Google JavaScript engine version installed. At this time v8 >= 6.6.313 required.

PHP

This extension requires PHP >= 7.2. Last version that supports PHP 7.1 is v0.2.2 and for PHP 7.0 is v0.1.9.

OS

This extension works and tested on x64 Linux and macOS. As of written it is Ubuntu 16.04 LTS Xenial Xerus, amd64 and macOS 10.12.5. Windows is not supported at this time.

Quick guide

Ubuntu

$ sudo add-apt-repository -y ppa:ondrej/php
$ sudo add-apt-repository -y ppa:pinepain/php
$ sudo apt-get update -y
$ sudo apt-get install -y php7.2 php-v8
$ php --ri v8

While pinepain/php PPA targets to contain all necessary extensions with dependencies, you may find pinepain/libv8 and pinepain/php standalone PPAs useful.

OS X (homebrew)

$ brew tap homebrew/dupes
$ brew tap homebrew/php
$ brew tap phpv8/tap
$ brew install php72 php72-v8
$ php --ri v8

For macOS php-v8 formulae and dependencies provided by phpv8/tap tap.

Building php-v8 from sources

git clone https://github.com/phpv8/php-v8.git
cd php-v8
phpize && ./configure && make
make test

To install extension globally run

$ sudo make install

Developers note

  • to be able to customize some tests make sure you have variables_order = "EGPCS" in your php.ini

  • export DEV_TESTS=1 allows to run tests that are made for development reasons (e.g. test some weird behavior or for debugging)

  • To prevent the test suite from asking you to send results to the PHP QA team do export NO_INTERACTION=1

  • To run tests with memory leaaks check, install valgrind and do export TEST_PHP_ARGS="-m"

  • To track memory usage you may want to use smem, pmem or even lsof to see what shared object are loaded and free to display free and used memory in the system.

  • pinepain/experimental may contain libv8 version that used in current master branch.

Docker

First, let's build docker image docker build -t phpv8/php-v8 . that we'll use later for development. By default, it contains PHP 7.2, though you can change that by passing --build-arg PHP=MAJOR.MINOR where MAJOR.MINOR version present in ondrej/php PPA.

To start playing with php-v8 in docker, run ```docker run -e TEST_PHP_ARGS -v pwd:/root/php-v8 -it phpv8/php-v8 bash``. Now you can build php-v8 as usual with `phpize && ./configure && make`. Don't forget to run `make test`!

Docs

We use Sphinx to buld docs and Read The Docs to host it.

To rebuild docs locally run in a project root:

virtualenv -p `which python` .virtualenv
source .virtualenv/bin/activate
cd docs
make html

Credits

My thanks to the following people and projects, without whom this extension wouldn't be what it is today. (Please let me know if I've mistakenly omitted anyone.)

  • v8js PHP extension which used as a reference on early stages;
  • Stefan Siegl, for his profound work on v8js PHP extension and for his personal time at helping building V8;
  • all v8js contributors;
  • Jérémy Lal, one of libv8 maintainers for his personal help on building V8 on Ubuntu;
  • John Gardner for dealing with V8 building system changes;
  • @ilovezfs for his help and mentoring on upgrading V8 homebrew formulae.

License

Copyright (c) 2015-2018 Bogdan Padalko <[email protected]>

php-v8 PHP extension is licensed under the MIT license.

Comments
  • Tests is failing on Alpine with V8 >= 5.7.434

    Tests is failing on Alpine with V8 >= 5.7.434

    build.log (master branch)

    It is possible that I have a problem with V8, but V8Js ext works fine.

    How to test

    Dockerfile V8 5.7+ on Alpine

    git clone -b alpine/v8-gn https://github.com/AlexMasterov/dockerfiles.git
    cd dockerfiles/alpine-v8-lib
    

    or you can just take the result: V8 libs /usr/local/v8

    V8_VERSION="5.7.434" \
    V8_LIB_SOURCE="https://www.dropbox.com/s/t42mkk5wrfhcoxd/alpine-v8-lib_${V8_VERSION}.tar.gz"
    curl -fSL --connect-timeout 30 ${V8_LIB_SOURCE} | tar xz -C
    

    or you can just take my the minimum Dockerfile php 7.0.14.

    (RU) Если что, у меня также есть Skype и Telegram. Готов в меру сил оказать содействие в решение.

    opened by AlexMasterov 11
  • v8::Proxy API has changed (V8 6.5.164)

    v8::Proxy API has changed (V8 6.5.164)

    Hello! :no_mouth:

    v8/v8@5b9adade648b6d4fb717bb0348cdee27d15b6355 ([[proxy] Set [[ProxyTarget]] to null during)

    In file included from /tmp/php-v8/src/php_v8_startup_data.h:24:0,
                     from /tmp/php-v8/src/php_v8_isolate.h:18,
                     from /tmp/php-v8/src/php_v8_context.h:18,
                     from /tmp/php-v8/src/php_v8_exceptions.h:16,
                     from /tmp/php-v8/src/php_v8_value.h:18,
                     from /tmp/php-v8/src/php_v8_proxy.h:16,
                     from /tmp/php-v8/src/php_v8_proxy.cc:17:
    /usr/local/v8/include/v8.h: In instantiation of 'v8::Local<T>::Local(v8::Local<S>) [with S = v8::Value; T = v8::Object]':
    /tmp/php-v8/src/php_v8_proxy.cc:70:104:   required from here
    /usr/local/v8/include/v8.h:167:37: error: invalid conversion from 'v8::Value*' to 'v8::Object*' [-fpermissive]
         *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
    /usr/local/v8/include/v8.h:213:5: note: in expansion of macro 'TYPE_CHECK'
         TYPE_CHECK(T, S);
         ^~~~~~~~~~
    
    bug v8:api blocked v8:version 
    opened by AlexMasterov 6
  • Upcoming release plan and breaking changes

    Upcoming release plan and breaking changes

    v0.1.9 (released Sept 1, 2017):

    • no BC breaks;
    • last release that supports PHP 7.0 (issue #30);
    • methods naming moved to camelCase (PR #32).

    v0.2.0 (ETA Sept 14, 2017):

    • BC-breaking API changes;
    • drop PHP 7.0 support and require PHP >= 7.1 (issue #30);
    • constants will be renamed to match PSR-2 standard;
    • snake_case methods will be removed to match PSR-2 standard;
    • method names that overlap with PHP keywords are the subject of renaming;
    • V8\Exception class as well as it methods is the subject of further renaming;

    TL;DR

    Upcoming release v0.1.9 will be the last release that support PHP 7.0. Starting from v0.2.0 release PHP >= 7.1 required. All comments, requests and suggesting about this should go to #30 issue.

    In the upcoming v0.1.9 release I plan to start moving extension public API closer to PHP world which means it become more PSR-2 compatible, especially method names get converted from PascalCase (UpperCamelCase) to typical camelCase (LowerCamelCase) which is not the big issue as PHP is quite lenient to identifiers case. That's not the case for constants, which are often named in camelCase in V8 - I'll rename them to UPPER_UNDERSCORE. Some snake_case methods (notably, HeapStatistics methods will be renamed to camelCase.

    Note, that this list of changes is incomplete, however, I'll try to keep you updated on progress and share further ideas and decisions.

    As I'm also developer and a bit in ops, I know how crucial is to have stable API you can rely on and how BC-breaks hurt business.

    That's why I have an upcoming surprise for you to let you abstract from v8 internals and just get things done. Stay tuned.

    In a while I'll make legacy PPA for those who prefer stability and can't follow current release plan and adapt wild changes.

    meta 
    opened by pinepain 6
  • Question: Module support

    Question: Module support

    Hei, so much respect for this library it's awesome :) I got it to work and wrote a wrapper arround it after lot of experiments and It was educational, will publish it soon. I have a question regarding modules. I want to use modules on the common js way like in node.js. I saw some hints in the php stub about modules, but I don't know how to get it to work. Is this already working? If yes, can you give me any hints how to implement some easy usecases? Thank you very much!

    opened by aight8 5
  • Distinguish number between int and float

    Distinguish number between int and float

    Hi, I have the case where I define javascript code which defines a number and on the PHP side I have to differentiate whether the value is an int or float. At the moment all defined numbers are float. I have looked a bit in the source and the check whether to return an integer or float from a number is already implemented (php_v8_value.cc:268) but commented. Do you have plans to activate this detection? Otherwise I have to perform this check on the PHP side with something like strpos('.', $value) === false ? (int) $value : $value which I think is not the best solution.

    opened by chriskapp 5
  • Calling php methods from js

    Calling php methods from js

    It's not clear to me if is possibile like in v8js to call php methods, inject input data and classes inside the js code or get variables outside to interact more. Is there any documentation?

    question doc 
    opened by danieleratti 4
  • Valgring reports problem after upgrading to v8 6.3

    Valgring reports problem after upgrading to v8 6.3

    After updating some tests become red and reports leaks - https://travis-ci.org/pinepain/php-v8/jobs/271257124.

    ==16592== Conditional jump or move depends on uninitialised value(s)
    ==16592==    at 0x10B2A5A3: v8::internal::MarkCompactCollector::EmptyMarkingWorklist() (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10B3FE69: v8::internal::MarkCompactCollector::RootMarkingVisitor::VisitRootPointers(v8::internal::Root, v8::internal::Object**, v8::internal::Object**) (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10B0549B: v8::internal::Heap::IterateStrongRoots(v8::internal::RootVisitor*, v8::internal::VisitMode) (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10B2A3AC: v8::internal::MarkCompactCollector::MarkRoots(v8::internal::RootVisitor*, v8::internal::ObjectVisitor*) (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10B267AB: v8::internal::MarkCompactCollector::MarkLiveObjects() (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10B262D7: v8::internal::MarkCompactCollector::CollectGarbage() (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10AF79FA: v8::internal::Heap::MarkCompact() (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10AF5E4A: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10AF53A1: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) (in /opt/libv8-6.3/lib/libv8.so)
    ==16592==    by 0x10AF5724: v8::internal::Heap::CollectAllAvailableGarbage(v8::internal::GarbageCollectionReason) (in /opt/libv8-6.3/lib/libv8.so)
    

    I'm not sure was there any changes in v8 internals that affects userland code and thus need some adjustmets or it's a v8 internals issue or it just false-positive. For now I filled a report to v8-users mail lists - https://groups.google.com/forum/#!topic/v8-users/qu1HrjbgRsg.

    While we can workaround this issue by simply suppress this issues with valgringrc, it might be a notice of more deeper problem.

    bug help wanted v8:api 
    opened by pinepain 4
  • PPA releases

    PPA releases

    Hi, I have a short question regarding the php-v8 ppa. Iam using this ppa in a docker image which automatically installs this extension. It uses a fixed version i.e. 0.1.3.1-ppa1~xenial unfortunately if you release a new version it is not possible to install an older version anymore. Basically my docker file looks like:

    ENV PHPV8_VERSION "0.1.3.1-ppa1~xenial"
    
    RUN add-apt-repository -y ppa:pinepain/php
    RUN apt-get update -y
    RUN DEBIAN_FRONTEND=noninteractive apt-get -y install php-v8=${PHPV8_VERSION}
    

    I have updated now my dockerfile to 0.1.6-ppa1~xenial and everything works fine. But is there a way to install older versions so that my dockerfile does not break directly if you release a new version?

    opened by chriskapp 4
  • Uncaught fatal error when snapshot v8 version doesn't match current v8 version

    Uncaught fatal error when snapshot v8 version doesn't match current v8 version

    "# Fatal error in ../../src/snapshot/snapshot-common.cc, line 286"
    "# Version mismatch between V8 binary and snapshot."
    "#   V8 binary version: 6.3.257"
    "#    Snapshot version: 6.3.248"
    "# The snapshot consists of 1482496 bytes and contains 1 context(s)."
    "#"
    "Received signal 4 ILL_ILLOPN 7f6b1a7b28e9"
    
    bug 
    opened by pinepain 3
  • FunctionObject::IsConstructor

    FunctionObject::IsConstructor

    While I want to check if a JS function is a constructor I got this error:

    Error
    Call to undefined method V8\FunctionObject::IsConstructor()
    

    Input:

    class TestClass {
      testMe() {
        console.log('test me!!!');
      }
    }
    
    TestClass
    

    Used the return value.

    opened by aight8 3
  • Stub repo empty

    Stub repo empty

    Hi, first let me say that this project is really great. It looks like the repo for the php stubs (https://github.com/pinepain/php-v8-stubs) is empty so it is not possible to install the stubs through composer. I have played a bit with the extension and build a small lib (https://github.com/apioo/psx-v8) where I would like to use these stubs as composer dev dependency.

    opened by chriskapp 3
  • it is not installing - PHP 7.4 / umbuntu server 18.4

    it is not installing - PHP 7.4 / umbuntu server 18.4

    I am trying to install in PHP 7.4 / umbuntu server 18.4 I type those commands -

    $ sudo add-apt-repository -y ppa:ondrej/php
    $ sudo add-apt-repository -y ppa:pinepain/php
    $ sudo apt-get update -y
    $ sudo apt-get install -y php7.4 php-v8
    
    

    Then

    $ php --ri v8
    show this error
    Extension 'v8' not present.
    
    

    please some one can help me ? I need this extension . thanks

    question external:packaging 
    opened by murilolivorato 1
  • Still maintained?

    Still maintained?

    Hi,

    You've done a great work here. However, I just encountered the notice in js-sandbox repo, so I would like to know if this repo as well will be discontinued or not ?

    opened by ardabeyazoglu 0
Releases(v0.2.2)
  • v0.2.2(Feb 27, 2018)

    I'm excited to announce that starting from this release documentation is available at https://php-v8.readthedocs.io.

    Read The Docs is awesome place to host documentation and Sphinx would help to create decent documentation. Contributors welcomed!

    This is the last version that supports PHP 7.1. For all next versions PHP >= 7.2 required.

    BC-breaking changes:

    • Upgrade v8 version to 6.6.313
    • Remove deprecated and non-working ScriptCompiler cache options
    • Rework PromiseObject
    • Add ValueObject::isBigInt64Array() and ValueObject::isBigUint64Array methods

    Non-breaking changes:

    • Add number of native and detached contexts to HeapStatistics
    • Add support to produce code cache
    • Add ScriptCompiler::OPTION_EAGER_COMPILE option
    • Add support for integer->strings for ObjectValue::GetOwnPropertyNames and `ObjectValue::GetPropertyNames
    • Add {Template,ObjectValue}:setLazyDataProperty() method
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Oct 23, 2017)

    This release brings stability and improvements. It contains some minor BC-breaking changes which should not affect general public. See full change log below for details

    Changelog:

    * - BC-breaking changes

    • * require libv8 >= 6.4.6;
    • * remove UnboundScript::kNoScriptId const and return null in getId() on no data
    • * change ScriptCompiler::cachedDataVersionTag(): int method name and return type to be ScriptCompiler::getCachedDataVersionTag(): float;
    • * remove StartupData::getRawSize() method;
    • fix segfault when invalid startup data passed to isolate;
    • fix external exception lost when it has refcount 1;
    • change script compiler version tag generation to take into account changes to extension internals;
    • add CallbackInfoInterface;
    • add support for ScriptCompiler::kProduceFullCodeCache;
    • add {Isolate,Context}::within() as optimization solution;
    • add StartupData::isRejected();
    • add docs skeleton.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Oct 6, 2017)

    This release introduces many major changes to public API and breaks BC for the sake of more solid and stable API in a further versions.

    PLEASE READ:

    Maintaining this project takes significant amount of time and efforts. If you like my work and want to show your appreciation, please consider supporting me at https://www.patreon.com/pinepain.

    Changes:

    • Drop PHP 7.0 support, #30;
    • Add typehint for $value param in Template::set(), #36;
    • Rename constants to match PSR-2 convention, #34;
    • Make enum classes with constants final, #39 ;
    • Rename HeapStatistics methods to match PSR-2, #38;
    • Rename V8\Exception class and it methods, #33;
    • Add FunctionObject::getScriptId() method;
    • Remove no-data constants and use NULL instead, #40;
    • Refactor ScriptOriginOptions to use bit field, #42;
    • Remove redundant ScriptOrigin::is*() methods, #61;
    • Add missed method to Value stub;
    • Fix improperly adjusted external allocated memory on weak callback call;
    • Add Proxy and Promise builtin support, #55;
    • Add support for regexp dotAll flag, #54;
    • Move RegExpObject\Flags constants under RegExpObject, #64;
    • Move CompileOptions constants under ScriptCompiler, #65;
    • Add Isolate::MemoryPressureNotification() support, #57;
    • Require libv8 >= 6.3.163;
    • Add StackFrame::isWasm(), #53;
    • Get rid of CallbackInfo, #67;
    • Add immutable prototype chains to ObjectTemplate, #58;
    • Add StartupData::warmUpSnapshotDataBlob(), #59;
    • Add missed JSON class support, #56;
    • Add Message::getErrorLevel() method, #52;
    • Rename SymbolValue methods, #41;
    • Rename TryCatch methods, #41;
    • Add missed PrimitiveValue::value() abstract method;
    • Add Isolate::SetRAILMode(), #60;
    • Fix improperly internally constructed RAILMode enum class, #60.

    See https://github.com/pinepain/php-v8/issues/43#issuecomment-333329225 for details

    Source code(tar.gz)
    Source code(zip)
  • v0.1.9(Sep 1, 2017)

  • v0.1.8(Jul 17, 2017)

    This release extends and clarify existent API and does not introduce any BC-breaking changes.

    Changes list:

    • Change V8\Exception::*Error() return type to V8\ObjectValue as the only possible type;
    • Add external exception wiring option to V8\Isolate::ThrowException().
    Source code(tar.gz)
    Source code(zip)
  • v0.1.7(Jul 17, 2017)

  • v0.1.6(May 3, 2017)

    Changes to public API and other important changes which may affect end-user:

    • Enforce Value() method on all V8\Primitive values;
    • Fix segfault when zero args passed to V8\FunctionObject::NewInstance();
    Source code(tar.gz)
    Source code(zip)
  • v0.1.5(Apr 30, 2017)

    This release introduces separate representation for undefined value and fixes some bugs. Please, see change list below for more details.

    * - BC-breaking or potentially BC-breaking changes

    Changes to public API and other important changes which may affect end-user:

    • * Make V8\Isolate::ThrowException() method void;
    • * Remove non-documented V8Isolate::ContextDisposedNotification();
    • * Make V8\Value, V8\PrimitiveValue and V8\NameValue abstract;
    • V8\Isolate time limit affects js runtime only;
    • Introduce separate class for undefined value - V8UndefenedValue;
    • Fix V8\Tempalte::Set() to do not accept non-primitive values;
    • Remove all private properties from V8\Isolate;
    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Apr 22, 2017)

    This release adds low-level optimizations, simplify some internal methods and fix few bugs. For more details see change list below.

    As of this release, V8 >= 6.0.45 required.

    * - BC-breaking or potentially BC-breaking changes

    Changes to public API and other important changes which may affect end-user:

    • Raise libv8 required version to 6.0.45;
    • Add V8\Value::InstanceOf() method;
    • Add V8\ObjectValue::SetNativeDataProperty() method;
    • Add V8\PropertyFilter, V8\KeyCollectionMode and V8\IndexFilter enums;
    • Add property filtering support to V8\ObjectValue::Get{Property,OwnProperty}Names();
    • Consistently expose all well-known symbols on V8\SymbolValue;
    • Setting boolean props on StackFrame with valid type;
    • Remove non-working and non-supporting $attributes argument from V8\StringValue constructor in stubs;
    • * Add V8\ConstructorBehavior and support for it in V8\FunctionTemplate constructor;
    • * Add signature support in V8\FunctionTemplate constructor via $receiver;
    • * Add signature support to Template:SetNativeDataProperty() and ObjectTemplate::SetAccessor() via $receiver;
    • * Remove require $isolate parameter from V8\Value::TypeOf();
    • * Remove deprecated V8\Context::EstimatedSize() method;
    • * Remove deprecated V8\StackTrace\StackTraceOptions;
    • * Remove deprecated V8\StackTrace::AsArray();
    • * Require Context explicitly in V8\Isolate::ThrowException();
    • * Rename V8\Exceptions\GenericException to V8\Exceptions\Exception;
    • * Rename V8\Exceptions\AbstractResourceLimitException to V8\Exceptions\ResourceLimitException;
    • * Check whether returned context is empty in V8\Isolate\GetEnteredContext() instead of checking InContext();
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Mar 5, 2017)

    This release adds low-level optimizations, simplify some internal methods and fix few bugs. For more details see change list below.

    As of this release, V8 >= 5.9.5 required.

    * - BC-breaking or potentially BC-breaking changes

    Changes to public API and other important changes which may affect end-user:

    • * Replace V8\Isolate::GetCurrentContext with V8\Isolate::GetEnteredContext();
    • * Remove V8\ObjectValue::CreationContext(), use V8\ObjectValue::GetContext();
    • Add V8\PropertyCallbackInfo::ShouldThrowOnError() method;
    • Add V8\FunctionCallbackInfo::NewTarget() method;
    • V8\ReturnValue now explicitly holds isolate and context which could be accessed outside of calling context, though ReturnValue::{Get,Set} could be accessed only within calling context as before;
    • Fix potential problems with V8\FunctionCallbackInfo and V8\PropertyCallbackInfo, now they are fully build, properly stores owning isolate and context and could be safely used outside calling scope;
    • Fix leak when V8\ScriptCompiler::CompileFunctionInContext() invoked with arguments or arguments and context extensions;
    • Fix segfault under when abruptly exiting (die(), exit(), uncaught exception) from isolate which entered multiple time or from multiple nested isolates (quite rare use case).
    • Add V8\Exceptions\ValueException to stubs. It support was in extension for ages but for some reason it was missed from stubs.
    • Remove $global_template and $global_object private props from V8\Context. They were never exposed to end-user anyway.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Feb 18, 2017)

    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;
    • Add V8\UnboundScript class;
    • Add V8\ScriptCompiler\CachedData class;
    • Add V8\ScriptCompiler\CompileOptions class;
    • Add V8\ScriptCompiler\Source class;
    • Add V8\ScriptCompiler;
    • Add V8\SymbolValue::GetToPrimitive() method;
    • Add V8\Value::IsNullOrUndefinedl() method;
    • Add more V8\Value::Is*() methods;
    • Add V8\MapObject;
    • Add V8\SetObject;
    • Fix obj and func templates external memory adjusting.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Sep 4, 2016)

    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.

    • add V8\Isolate::IsInUse() method.
    • add V8\AdjustableExternalMemoryInterface interface;
    • add V8\ObjectValue::AdjustExternalAllocatedMemory() method;
    • add V8\ObjectValue::GetExternalAllocatedMemory() method;
    • add V8\FunctionTemplate::AdjustExternalAllocatedMemory() method;
    • add V8\FunctionTemplate::GetExternalAllocatedMemory() method;
    • add V8\ObjectTemplate::AdjustExternalAllocatedMemory() method;
    • add V8\ObjectTemplate::GetExternalAllocatedMemory() method;
    • rewrite callbacks structures to use std containers;
    • use realistic external allocated memory value to notify isolate about based on callbacks structures size and optionally specified by user value.
    • add V8\Value::TypeOf() method;
    • add V8\ObjectValue::IsConstructor() method;
    • add V8\ObjectValue::SetIntegrityLevel() method;
    • add V8\CallbackInfo::InContext() method;
    • add V8\ReturnValue::InContext() method;
    • add V8\ReturnValue::Get() method;
    • add V8\HeapStatistics::malloced_memory() method;
    • add V8\HeapStatistics::peak_malloced_memory() method;
    • properly shutdown in case of OOM;
    • simplify V8\ReturnValue internals and integration with callbacks.

    BC breaking changes:

    • V8\ObjectValue::ForceSet() removed in a favor of V8\ObjectValue::DefineOwnProperty(), V8\ObjectValue::CreateDataProperty() and V8\ObjectValue::CreateDataPropertyIndex().
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Aug 16, 2016)

    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.

    Source code(tar.gz)
    Source code(zip)
Magento 2 Blog Extension is a better blog extension for Magento 2 platform. These include all useful features of Wordpress CMS

Magento 2 Blog extension FREE Magento 2 Better Blog by Mageplaza is integrated right into the Magento backend so you can manage your blog and your e-c

Mageplaza 113 Dec 14, 2022
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 8 | Aws ECS, Google Kubernates, Azure Container Engine

Docker infrastructure for Lumen Description Microservice Lumen is a starting skeleton based on Docker and Lumen Framework. This project helps to devel

Fabrizio Cafolla 218 Sep 25, 2022
Simple yet powerful, PSR-compliant, Symfony-driven PHP Blog engine.

brodaty-blog ✒️ Simple Blog Engine based on pure Markdown files. ?? Works without database, caches HTML templates from Markdown files. ?? Fast and ext

Sebastian 3 Nov 15, 2022
A simple, type-safe, zero dependency port of the javascript fetch WebApi for PHP.

A simple, type-safe, zero dependency port of the javascript fetch WebApi for PHP.

Matias Navarro Carter 105 Jan 4, 2023
This project is very diverse and based upon many languages and libraries such as C++, Python, JavaScript, PHP and MQTT

ADMS-Real-time-project This project is very diverse and based upon many languages and libraries such as C++, Python, JavaScript, PHP and MQTT Advance_

Nitya parikh 1 Dec 1, 2021
Formulário de contato utilizando HTML, CSS, Bootstrap, PHP, Javascript e conexão ao banco de dados MySQL.

Formulário de Contato Tecnologias | Projeto | Licença | ?? Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: HTML CSS PHP JavaSc

Douglas Duarte 3 Feb 10, 2022
Basic User login & signup in php with JavaScript form validations

User login & signup in php User login & signup in PHP-MySQL with JavaScript form validations Project Details : Project Name : User Registration & Logi

Swapnil Zambare 2 Sep 30, 2022
Sistema de apuestas quinielas, sencilla, combinada, doble oportunidad en PHP y JavaScript

Sistema-de-Apuestas-Quinielas Sistema de apuestas quinielas, sencilla, combinada, doble oportunidad en PHP y JavaScript Instrucciones Copiar los archi

Camilo Ortiz 1 May 5, 2022
aqui tienen una plantilla que pueden usar para crear paginas web, contiene html, css, javascript y php

Plantilla-html aqui tienen una plantilla que pueden usar para crear paginas web, contiene html, css, javascript y php. esta plantilla obviamente neces

PEKKA102 3 Sep 19, 2022
HTMX example app that demonstrates how to use HTMX to add javascript interactivity to a serverside rendered PHP app

HTMX examle app This demo app demonstrates how to use HTMX to transform a server side rendered PHP app into a more 'interactive' app with AJAX request

Alexander Morland 3 Dec 11, 2022
Medical Master or "Medic-M" was built to reduce the hassle of buying medicine, provide medicine to the sick in a short time. It is an HTML, CSS, JAVASCRIPT and PHP based system.

Medical Master (Medic-M) | WELCOME TO Medic-M(MEDICAL MASTER) | | Introduction | Medical Master or "Medic-M" was built to reduce the hassle of buying

NILOY KANTI PAUL 5 Oct 8, 2022
A real-time chatting website using HTML, CSS, JavaScript, PHP

ChatApp A real-time chatting website using HTML, CSS, JavaScript, PHP #Features Signup Login Signup & Login Validation Encrypted Password Realtime Mes

Suraj Sahu 6 Oct 18, 2022
Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use.

Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use. This package allows you to use Shiki from PHP.

Spatie 229 Jan 4, 2023
Engine for performing and rendering text diffs

Text_Diff Engine for performing and rendering text diffs This package provides a text-based diff engine and renderers for multiple diff output formats

PEAR - PHP Extension and Application Repository 15 Jan 4, 2022
Open App Engine

Open App Engine

Light App Engine 20 Dec 18, 2022
A simple but extensible economy engine for PocketMine-MP, using label-oriented APIs.

Capital A simple but very extensible economy plugin for PocketMine-MP. How is Capital different from other economy plugins? Capital introduces a label

Jonathan Chan Kwan Yin 37 Dec 19, 2022
Silverstripe-fulltextsearch - Adds external full text search engine support to SilverStripe

FullTextSearch module Adds support for fulltext search engines like Sphinx and Solr to SilverStripe CMS. Compatible with PHP 7.2 Important notes when

Silverstripe CMS 42 Dec 30, 2022
Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch

News ⚠️ Magento versions compatibility : Due to several changes in Magento 2.4.0, we cannot ensure compatibility between ElasticSuite <2.10 and Magent

Smile - Open Source Solutions 724 Dec 30, 2022
Magento 2 Module for Search Engine Optimization

Magento 2 Search Engine Optimization Magento 2 Module to Improve Search Engine Optimization (SEO) on your Magento site. Installation Install the modul

Stämpfli AG 100 Oct 7, 2022