summaryrefslogtreecommitdiff
path: root/src/classbase.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 23:28:10 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-02 23:28:10 +0100
commit8f24af4c28e74ef1769aef6ab00c480e09be7453 (patch)
treec73b7de11abbdd8ed2d3f3fa5b63fdd2a1409cb8 /src/classbase.cpp
parentf7dcf5d81fa1e43533c786d9443e5222398dc8b9 (diff)
work in progress to support implementing SPL interfaces, disabled the _self variable in Php::Base because by having each object keeping a reference to itself, the refcounter never reached zero and the object was thus never destructed, checking if we can get a new implementation one way or another
Diffstat (limited to 'src/classbase.cpp')
-rw-r--r--src/classbase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/classbase.cpp b/src/classbase.cpp
index 87a1cd2..c7ade6c 100644
--- a/src/classbase.cpp
+++ b/src/classbase.cpp
@@ -101,7 +101,7 @@ static zend_object_value create_object(zend_class_entry *type TSRMLS_DC)
result.handle = zend_objects_store_put(object, NULL, deallocate_object, clone_object TSRMLS_CC);
// finally, construct the cpp object
- object->cpp = info->construct(Value(result));
+ object->cpp = info->construct(result);
// done
return result;
@@ -215,6 +215,9 @@ void ClassBase::initialize(const std::string &prefix)
// set access types flags for class
_entry->ce_flags = (int)_type;
+ // mark the interfaces as being implemented
+ for (auto &interface : _interfaces) zend_do_implement_interface(_entry, interface);
+
// declare all member variables
for (auto &member : _members) member->initialize(_entry);
}