Re: New extension: spidermonkey
| From: | Christophe Robin | Date: | Fri, 20 Feb 2009 09:11:42 +0000 |
| Subject: | Re: New extension: spidermonkey | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-6138@lists.php.net to get a copy of this message | ||
Alexey Zakhlestin wrote:
On Thu, Feb 19, 2009 at 7:25 PM, Christophe Robin <c.robin@smartphp.org> wrote:Hi, I made the changes on JSRuntime, I just didn't knew how to use extension globals yet, so you just need to do "$ctx = new JSContext();" now and you're ready to go :D As for the license, spidermonkey is LGPL/MPL which are compatible with the PHP license.Hi, I've been working last month on a spidermonkey extension for PHP. It allows to run Javascript scripts and provide them PHP variables, objects and functions. It compile on PHP 5.3 and SpiderMonkey 1.7.0 ( Tested on archlinux and gentoo ). You can check the mod_tests folder for samples. The source is up at: https://ookoo.org/svn/pecl-spidermonkey More info at http://www.bombstrike.org/?p=37 There is no windows support atm.I looked at the blog-post, didn't look at the sources yet. I find the API choice a bit strange. Is "$rt = new JSRuntime();" line really needed? Wouldn't it make sense to create "contexts" directly, skipping this part? Initialization should be put in MINIT (or RINIT). Or am I missing something? Other than that, I'm all for this extension. p.s. You didn't mention the license. Is it php-compatible?