Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP7 basic support #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,47 @@
*~
/.project
/.settings
.deps
acinclude.m4
aclocal.m4
config.guess
config.h
config.h.in
config.log
config.nice
config.status
config.sub
configure
configure.in
install-sh
libtool
ltmain.sh
Makefile
Makefile.fragments
Makefile.global
Makefile.objects
missing
mkinstalldirs
run-tests.php
spidermonkey.loT
autom4te.cache/output.0
autom4te.cache/requests
autom4te.cache/traces.0
build/ax_check_compile_flag.m4
build/libtool.m4
build/mkdep.awk
build/scan_makefile_in.awk
build/shtool
.vscode
*.diff
*.log
*.exp
tests/*.sh
tests/*.out
tests/*.php
*.so
*.o
*.lo
*.la
.libs
tmp-php.ini
14 changes: 4 additions & 10 deletions php_spidermonkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ ZEND_END_MODULE_GLOBALS(spidermonkey)
#define PHPJS_START(cx) JS_BeginRequest(cx)
#define PHPJS_END(cx) JS_EndRequest(cx)

// useful for iterating on php hashtables
#define PHPJS_FOREACH(ht) for (zend_hash_internal_pointer_reset(ht); zend_hash_has_more_elements(ht) == SUCCESS; zend_hash_move_forward(ht))
#define PHPJS_FOREACH_ENTRY(ht,dest) if (zend_hash_get_current_data(ht,(void**)& dest) == FAILURE) {\
continue;\
}

/* Used by JSContext to store callbacks */
typedef struct _php_callback {
zend_fcall_info fci;
Expand Down Expand Up @@ -112,10 +106,10 @@ extern zend_class_entry *php_spidermonkey_jsc_entry;

/* this method defined in spidermonkey.c allow us to convert a jsval
* to a zval for PHP use */
void php_jsobject_set_property(JSContext *ctx, JSObject *obj, char *property_name, zval *val TSRMLS_DC);
#define jsval_to_zval(rval, ctx, jval) _jsval_to_zval(rval, ctx, jval, NULL TSRMLS_CC)
void _jsval_to_zval(zval *return_value, JSContext *ctx, JS::MutableHandle<JS::Value> rval, php_jsparent *parent TSRMLS_DC);
void zval_to_jsval(zval *val, JSContext *ctx, jsval *jval TSRMLS_DC);
void php_jsobject_set_property(JSContext *ctx, JSObject *obj, char *property_name, zval *val);
#define jsval_to_zval(rval, ctx, jval) _jsval_to_zval(rval, ctx, jval, NULL)
void _jsval_to_zval(zval *return_value, JSContext *ctx, JS::MutableHandle<JS::Value> rval, php_jsparent *parent);
void zval_to_jsval(zval *val, JSContext *ctx, jsval *jval);

/* init/shutdown functions */
PHP_MINIT_FUNCTION(spidermonkey);
Expand Down
Loading