diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-10-15 05:54:52 -0700 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-10-15 05:54:52 -0700 |
commit | 61ba30d716dab670a5f2ed0ee2f6650375b2058d (patch) | |
tree | 711db9359015de260071088ef027b020cd95d4b3 /src/function.cpp | |
parent | b2042dbd58c043ab49e9b0dbb51bf8516fe8cea8 (diff) |
Calling custom member methods is now functional
Diffstat (limited to 'src/function.cpp')
-rw-r--r-- | src/function.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/function.cpp b/src/function.cpp index d255518..a4b3fdd 100644 --- a/src/function.cpp +++ b/src/function.cpp @@ -35,7 +35,7 @@ void invoke_function(INTERNAL_FUNCTION_PARAMETERS) Value result(return_value, true); // construct parameters - Parameters params(ZEND_NUM_ARGS()); + Parameters params(this_ptr, ZEND_NUM_ARGS()); // get the result result = function->invoke(*PHPCPP_G(environment), params); @@ -83,8 +83,9 @@ Function::~Function() * * @param entry Entry to be filled * @param classname Optional class name + * @param pub Is this a public property? */ -void Function::fill(zend_function_entry *entry, const char *classname) const +void Function::fill(zend_function_entry *entry, const char *classname, bool pub) const { // fill the members of the entity, and hide a pointer to the current object in the name entry->fname = _ptr; @@ -93,7 +94,7 @@ void Function::fill(zend_function_entry *entry, const char *classname) const entry->num_args = _argc; // there are no flags like deprecated, private or protected - entry->flags = 0; + entry->flags = classname ? (pub ? ZEND_ACC_PUBLIC : ZEND_ACC_PROTECTED) : 0; // we should fill the first argument as well fill((zend_internal_function_info *)entry->arg_info, classname); |