diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-08-24 19:44:19 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-08-24 19:44:19 +0200 |
commit | b8a14d96c06d5a8910cb28d28870f0036ae6a461 (patch) | |
tree | 5077e7af0a04ce093dded091747c047b1ad05478 /include | |
parent | d29c1a960798bbfa351b1aa3426d6f0a79ffe92c (diff) |
The extension::initialize() and extension::finalize() methods are called at the appropriate time
Diffstat (limited to 'include')
-rw-r--r-- | include/extension.h | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/include/extension.h b/include/extension.h index 69d5d3c..3a852ac 100644 --- a/include/extension.h +++ b/include/extension.h @@ -13,10 +13,14 @@ */ /** + * Forward declarations + */ +struct _zend_module_entry; + +/** * Set up namespace */ -namespace PhpCpp -{ +namespace PhpCpp { /** * Class definition @@ -26,15 +30,15 @@ class Extension public: /** * Constructor + * @param name Extension name + * @param version EXtension version */ - Extension(); + Extension(const char *name, const char *version); /** * Destructor */ - virtual ~Extension() - { - } + virtual ~Extension(); /** * Initialize the extension. @@ -46,7 +50,7 @@ public: * The method should return true on success, and false on failure (in which * case the extension will not be used) * - * @return boolean + * @return bool */ virtual bool initialize() { @@ -59,12 +63,41 @@ public: * This method gets called after all requests were handled, and right before * the Apache module or CLI script will exit. You can override it to add * your own cleanup code. + * + * @return bool */ - virtual void finalize() + virtual bool finalize() { + return true; } - + + /** + * Internal method to get access to the entry + * @return zend_module_entry + */ + _zend_module_entry *entry(); + private: + /** + * Extension name + * @var char* + */ + const char *_name; + + /** + * Extension version + * @var char* + */ + const char *_version; + + /** + * The information that is passed to the Zend engine + * @var zend_module_entry + */ + _zend_module_entry *_entry; + + + }; |