summaryrefslogtreecommitdiff
path: root/zend/functor.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-02-05 22:59:15 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-02-05 22:59:15 +0100
commit7c7121e92b3ebd2763b4b03227eeec09461d8ea9 (patch)
treed4de14152798da46907795e773feac742d27a769 /zend/functor.h
parentba32a85db3f1130d01ccf228e253d2e717c53c70 (diff)
refactored the initialization and shutdown of extension objects (code is moved from a static method to a real member method), and more importantly: fixed initialization of the PhpCpp::Functor class, previously, we created the class an runtime whenever we needed it, but that turned out to be a cause for crashes when php stopped, this has also been solved
Diffstat (limited to 'zend/functor.h')
-rw-r--r--zend/functor.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/zend/functor.h b/zend/functor.h
index 7d5bef5..503a05c 100644
--- a/zend/functor.h
+++ b/zend/functor.h
@@ -46,12 +46,41 @@ public:
return _function(params);
}
+ /**
+ * Get the functor class entry
+ * @return zend_class_entry
+ */
+ static zend_class_entry *entry()
+ {
+ // get the "member"
+ return _entry;
+ }
+
+ /**
+ * Initialize the class
+ * @param tsrmls
+ */
+ static void initialize(TSRMLS_D);
+
+ /**
+ * Shutdown the class
+ * @param tsrmls
+ */
+ static void shutdown(TSRMLS_D);
+
private:
/**
* The std::function that is wrapped in PHP code
* @var std::function
*/
const std::function<Value(Parameters &params)> _function;
+
+ /**
+ * The classentry
+ * @var zend_class_entry
+ */
+ static zend_class_entry *_entry;
+
};
/**