summaryrefslogtreecommitdiff
path: root/zend/extensionimpl.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 22:51:12 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 22:51:12 +0200
commit43cfaa8a4730ea1fa7d9c01f58ddcf6f42b4fb46 (patch)
tree19a42d30fb2d416f2c10fea158eef2f35203611e /zend/extensionimpl.h
parent35fd3ccbeb4def71b4d8a59dfbb5c31201b099b9 (diff)
introduced common directory that will contain implementation files that are used for hhvm and zend, and introduced hhvm file for the implementation of hhvmcpp
Diffstat (limited to 'zend/extensionimpl.h')
-rw-r--r--zend/extensionimpl.h105
1 files changed, 6 insertions, 99 deletions
diff --git a/zend/extensionimpl.h b/zend/extensionimpl.h
index cc37354..e58ce66 100644
--- a/zend/extensionimpl.h
+++ b/zend/extensionimpl.h
@@ -15,16 +15,10 @@ namespace Php {
/**
* Class definition
*/
-class ExtensionImpl
+class ExtensionImpl : public ExtensionBase
{
protected:
/**
- * Pointer to the extension object that is filled by the extension programmer
- * @var Extension
- */
- Extension *_data;
-
- /**
* The information that is passed to the Zend engine
*
* Although it would be slightly faster to not make this a pointer, this
@@ -34,32 +28,7 @@ protected:
* @var zend_module_entry
*/
zend_module_entry _entry;
-
- /**
- * Callback that is called after the engine is initialized and before the
- * pageviews are going to be handled
- * @var Callback
- */
- Callback _onStartup;
-
- /**
- * Callback that is called in front of each request
- * @var Callback
- */
- Callback _onRequest;
-
- /**
- * Callback that is called right after each request
- * @var Callback
- */
- Callback _onIdle;
-
- /**
- * Callback that is called right before the engine is closing down
- * @var Callback
- */
- Callback _onShutdown;
-
+
public:
/**
* Constructor
@@ -81,68 +50,6 @@ public:
virtual ~ExtensionImpl();
/**
- * Register a function to be called when the PHP engine is ready
- *
- * The callback will be called after all extensions are loaded, and all
- * functions and classes are available, but before the first pageview/request
- * is handled. You can register this callback if you want to be notified
- * when the engine is ready, for example to initialize certain things.
- *
- * @param callback
- */
- void onStartup(const Callback &callback)
- {
- // copy callback
- _onStartup = callback;
- }
-
- /**
- * Register a function to be called when the PHP engine is going to stop
- *
- * The callback will be called right before the process is going to stop.
- * You can register a function if you want to clean up certain things.
- *
- * @param callback
- */
- void onShutdown(const Callback &callback)
- {
- // copy callback
- _onShutdown = callback;
- }
-
- /**
- * Register a callback that is called at the beginning of each pageview/request
- *
- * You can register a callback if you want to initialize certain things
- * at the beginning of each request. Remember that the extension can handle
- * multiple requests after each other, and you may want to set back certain
- * global variables to their initial variables in front of each request
- *
- * @param callback
- */
- void onRequest(const Callback &callback)
- {
- // copy callback
- _onRequest = callback;
- }
-
- /**
- * Register a callback that is called to cleanup things after a pageview/request
- *
- * The callback will be called after _each_ request, so that you can clean up
- * certain things and make your extension ready to handle the next request.
- * This method is called onIdle because the extension is idle in between
- * requests.
- *
- * @param callback
- */
- void onIdle(const Callback &callback)
- {
- // copy callback
- _onIdle = callback;
- }
-
- /**
* Retrieve the module entry
*
* This is the memory address that should be exported by the get_module()
@@ -175,7 +82,7 @@ private:
* @param tsrm_ls
* @return int 0 on success
*/
- static int onStartup(int type, int module_number TSRMLS_DC);
+ static int processStartup(int type, int module_number TSRMLS_DC);
/**
* Function that is called when the extension is about to be stopped
@@ -184,7 +91,7 @@ private:
* @param tsrm_ls
* @return int
*/
- static int onShutdown(int type, int module_number TSRMLS_DC);
+ static int processShutdown(int type, int module_number TSRMLS_DC);
/**
* Function that is called when a request starts
@@ -193,7 +100,7 @@ private:
* @param tsrm_ls
* @return int 0 on success
*/
- static int onRequest(int type, int module_number TSRMLS_DC);
+ static int processRequest(int type, int module_number TSRMLS_DC);
/**
* Function that is called when a request is ended
@@ -202,7 +109,7 @@ private:
* @param tsrm_ls
* @return int 0 on success
*/
- static int onIdle(int type, int module_number TSRMLS_DC);
+ static int processIdle(int type, int module_number TSRMLS_DC);
};
/**