开发者

Scriptable JavaScript interpreter with bindings for PHP or Python?

Does anyone know of a JavaScript inter开发者_高级运维preter that has bindings to PHP or Python?


You can try pyv8 - Google's v8 engine with Python bindings.


Try QtScript, from the Qt library:

from PyQt4 import QtScript


There's a previous discussion on embedding various languages into PHP.

re: Javascript in particular, Pecl Spidermonkey is mentioned; otherwise, not much to choose from.


At now there is v8js-0.1.3 (beta) pecl package for PHP5.3.3+ You can easily install it like that (debian/ubuntu):

sudo apt-get install libv8-dev
sudo pecl install v8js-beta
sudo bash -c 'echo "extension=v8js.so" > /etc/php5/mods-available/_pecl.v8js.ini'
sudo ln -s ../mods-available/_pecl.v8js.ini /etc/php5/conf.d/30-v8js.ini

I've using _pecl prefix for pecl packages. Of course you can remove or change it as you wish.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜