@@ -6,7 +6,7 @@ PHP extension for V8 JavaScript engine
66
77This extension is for PHP 7 only.
88
9- ** This extension is still under heavy development and it public API may change without any warning. Use at your own risk.**
9+ ** This extension is still under heavy development and its public API may change without any warning. Use at your own risk.**
1010
1111
1212## About
@@ -18,24 +18,24 @@ provides an accurate native V8 C++ API implementation available from PHP.
1818 - provides up-to-date JavaScript engine with recent [ ECMA] ( http://kangax.github.io/compat-table ) features supported;
1919 - accurate native V8 C++ API implementation available from PHP;
2020 - solid experience between native V8 C++ API and V8 API in PHP;
21- - no magic; no assumption ;
22- - does what it asked to do;
21+ - no magic; no assumptions ;
22+ - does what it is asked to do;
2323 - hides complexity with isolates and contexts scope management under the hood;
2424 - provides a both-way interaction with PHP and V8 objects, arrays and functions;
2525 - execution time and memory limits;
2626 - multiple isolates and contexts at the same time;
2727 - it works;
2828
29- With this extension almost all that native V8 C++ API provides can be used. It provides a way to pass php scalars,
30- objects and function to V8 runtime and specify interaction with passed values (objects and functions only, as scalars
31- become js scalars too). While specific functionality will be done in PHP userland rather then in C/C++ this extension,
29+ With this extension almost everything that the native V8 C++ API provides can be used. It provides a way to pass PHP scalars,
30+ objects and functions to the V8 runtime and specify interactions with passed values (objects and functions only, as scalars
31+ become js scalars too). While specific functionality will be done in PHP userland rather than in this C/C++ extension,
3232it lets you get into V8 hacking faster, reduces time costs and gives you a more maintainable solution. And it doesn't
3333make any assumptions for you, so you stay in control, it does exactly what you ask it to do.
3434
3535With php-v8 you can even implement nodejs in PHP. Not sure whether anyone should/will do this anyway, but it's doable.
3636
37- * NOTE: Most, if not all, methods are named like in V8 API - starting from capital letter. This PSR violation done
38- intentionally with the purpose to provide more solid experience between native V8 C++ API and V8 PHP API.*
37+ * NOTE: Most, if not all, methods are named like in the V8 API - starting from capital letter. This PSR violation is done
38+ intentionally with the purpose to provide a more solid experience between the native V8 C++ API and the V8 PHP API.*
3939
4040
4141## Demo
@@ -55,47 +55,46 @@ $result = $script->Run($context);
5555echo $result->ToString($context)->Value(), PHP_EOL;
5656```
5757
58- which will output ` Hello, World! ` . See how it's shorter and readable from [ that C++ version] ( [v8-hello-world] ) ?
58+ which will output ` Hello, World! ` . See how it's shorter and more readable than [ that C++ version] ( [v8-hello-world] ) ?
5959And it also doesn't limit you from V8 API utilizing to implement more amazing stuff.
6060
61-
6261## Installation
6362
6463### Requirements
6564
6665#### V8
67- You will need some fresh v8 Google JavaScript enging version installed. At this time extension tested on 5.4.420.
66+ You will need a recent v8 Google JavaScript engine version installed. At this time the extension is tested on 5.4.420.
6867
69- - For Ubuntu there are [ pinepain/libv8-5.4] ( https://launchpad.net/~pinepain/+archive/ubuntu/libv8-5.4 ) PPA.
70- To install fresh libv8 do :
68+ - For Ubuntu there is the [ pinepain/libv8-5.4] ( https://launchpad.net/~pinepain/+archive/ubuntu/libv8-5.4 ) PPA.
69+ To install libv8:
7170
7271 ```
7372 $ sudo add-apt-repository -y ppa:pinepain/libv8-5.4
7473 $ sudo apt-get update -y
7574 $ sudo apt-get install -y libv8-5.4-dev
7675 ```
77- - For OS X there are [ v8.rb] ( https://github.com/pinepain/php-v8/blob/master/scripts/homebrew/v8.rb ) homebrew formula.
78- To install fresh libv8 do :
76+ - For OS X there is the [ v8.rb] ( https://github.com/pinepain/php-v8/blob/master/scripts/homebrew/v8.rb ) homebrew formula.
77+ To install libv8:
7978
8079 ```
8180 $ brew install https://raw.githubusercontent.com/pinepain/php-v8/master/scripts/homebrew/v8.rb
8281 ```
8382
8483#### PHP 7
8584
86- - For Ubuntu there are [ ondrej/php] ( https://launchpad.net/~ondrej/+archive/ubuntu/php ) PPA by [ Ondřej Surý] ( https://deb.sury.org ) .
85+ - For Ubuntu there is the [ ondrej/php] ( https://launchpad.net/~ondrej/+archive/ubuntu/php ) PPA by [ Ondřej Surý] ( https://deb.sury.org ) .
8786
88- To install fresh ` php7.0 ` do :
87+ To install ` php7.0 ` :
8988
9089 ```
9190 $ sudo add-apt-repository -y ppa:ondrej/php
9291 $ sudo apt-get update -y
9392 $ sudo apt-get install -y php7.0
9493 ```
95- - For OS X there are [ homebrew/homebrew-php] ( https://github.com/Homebrew/homebrew-php ) tap with php70, php71 and large
94+ - For OS X there is the [ homebrew/homebrew-php] ( https://github.com/Homebrew/homebrew-php ) tap with php70, php71 and a large
9695 variety extensions for them.
9796
98- To install fresh ` php70 ` do :
97+ To install ` php70 ` :
9998
10099 ```
101100 $ brew tap homebrew/homebrew-php
@@ -105,18 +104,18 @@ You will need some fresh v8 Google JavaScript enging version installed. At this
105104
106105### Installing php-v8 from packages
107106
108- - For Ubuntu there are [ pinepain/php-v8] ( https://launchpad.net/~pinepain/+archive/ubuntu/php-v8 ) PPA.
107+ - For Ubuntu there is the [ pinepain/php-v8] ( https://launchpad.net/~pinepain/+archive/ubuntu/php-v8 ) PPA.
109108
110- To install fresh ` php-v8 ` :
109+ To install ` php-v8 ` :
111110
112111 ```
113112 $ sudo add-apt-repository -y ppa:pinepain/php-v8
114113 $ sudo apt-get update -y
115114 $ sudo apt-get install -y php-v8
116115 ```
117- - For OS X there are [ php70-v8.rb] [ php70-v8.rb ] and [ php71-v8.rb] [ php71-v8.rb ] homebrew formulas.
116+ - For OS X there are the [ php70-v8.rb] [ php70-v8.rb ] and [ php71-v8.rb] [ php71-v8.rb ] homebrew formulas.
118117
119- To install fresh ` php70-v8 ` do:
118+ To install ` php70-v8 ` do:
120119
121120 ```
122121 $ brew install https://raw.githubusercontent.com/pinepain/php-v8/master/scripts/homebrew/php70-v8.rb
@@ -139,10 +138,10 @@ $ sudo make install
139138
140139## Developers note
141140 - to be able to customize some tests make sure you have ` variables_order = "EGPCS" ` in your php.ini
142- - ` export DEV_TESTS=1 ` allows to run tests that made for development reason (e.g. test some weird behavior or for debugging)
143- - To prevent asking test suite to send results to PHP QA team do ` export NO_INTERACTION=1 `
141+ - ` export DEV_TESTS=1 ` allows to run tests that are made for development reasons (e.g. test some weird behavior or for debugging)
142+ - To prevent the test suite from asking you to send results to the PHP QA team do ` export NO_INTERACTION=1 `
144143
145- - To track memory usage you may want to use ` smem ` , ` pmem ` and even ` lsof ` to see what shared object are loaded
144+ - To track memory usage you may want to use ` smem ` , ` pmem ` or even ` lsof ` to see what shared object are loaded
146145 and ` free ` to display free and used memory in the system.
147146
148147## License
0 commit comments