diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-20 13:45:17 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-20 13:45:17 +0100 |
commit | 5235f87126cc2bca3907daada9f59e0c7c7bc834 (patch) | |
tree | 6b049edd2eca0b74a8acb9ff7ee0c84c93bf1a5c /zend/extensionimpl.h | |
parent | 821e65d876cc0ce2b32471791b02d9f7cc784c99 (diff) |
PHP-CPP now checks whether an already compiled extension is still compatible with the PHP-CPP library. This prevents weird crashes when users update their PHP-CPP library, without recompiling their extensions
Diffstat (limited to 'zend/extensionimpl.h')
-rw-r--r-- | zend/extensionimpl.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/zend/extensionimpl.h b/zend/extensionimpl.h index 0e9a289..0a366ba 100644 --- a/zend/extensionimpl.h +++ b/zend/extensionimpl.h @@ -37,15 +37,16 @@ protected: * @var zend_ini_entry */ zend_ini_entry *_ini = nullptr; - + public: /** * Constructor * @param data Extension object created by the extension programmer * @param name Name of the extension * @param version Version number + * @param apiversion API version number */ - ExtensionImpl(Extension *data, const char *name, const char *version); + ExtensionImpl(Extension *data, const char *name, const char *version, int apiversion); /** * No copy'ing and no moving @@ -58,6 +59,18 @@ public: */ virtual ~ExtensionImpl(); + /** + * The extension name + * @return const char * + */ + const char *name() const; + + /** + * The extension version + * @return const char * + */ + const char *version() const; + /** * Is the object locked (true) or is it still possible to add more functions, * classes and other elements to it? @@ -94,7 +107,7 @@ private: * @param tsrm_ls */ void initialize(TSRMLS_D); - + /** * Function that is called when the extension initializes * @param type Module type @@ -130,6 +143,16 @@ private: * @return int 0 on success */ static int processIdle(int type, int module_number TSRMLS_DC); + + /** + * Function that is called when the PHP engine initializes with a different PHP-CPP + * version for the libphpcpp.so file than the version the extension was compiled for + * @param type Module type + * @param number Module number + * @param tsrm_ls + * @return int 0 on success + */ + static int processMismatch(int type, int module_number TSRMLS_DC); }; /** |