summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-24 19:44:19 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-24 19:44:19 +0200
commitb8a14d96c06d5a8910cb28d28870f0036ae6a461 (patch)
tree5077e7af0a04ce093dded091747c047b1ad05478 /tests
parentd29c1a960798bbfa351b1aa3426d6f0a79ffe92c (diff)
The extension::initialize() and extension::finalize() methods are called at the appropriate time
Diffstat (limited to 'tests')
-rw-r--r--tests/simple/simple.cpp30
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/simple/simple.cpp b/tests/simple/simple.cpp
index 36db294..fbfcbf8 100644
--- a/tests/simple/simple.cpp
+++ b/tests/simple/simple.cpp
@@ -7,6 +7,12 @@
* @copyright 2013 Copernica BV
*/
#include <phpcpp.h>
+#include <iostream>
+
+/**
+ * Namespace to use
+ */
+using namespace std;
/**
* Override the extension class
@@ -17,19 +23,23 @@ public:
/**
* Constructor
*/
- SimpleExtension() : Extension(
- "simple",
- "1.0",
- "Emiel Bruijntjes <emiel.bruijntjes@copernica.com>",
- "http://www.copernica.com",
- "Copyright 2013 Copernica BV")
+ SimpleExtension() : Extension("simple", "1.0")
+ {
+ }
+
+ virtual bool initialize()
{
+ cout << "initialize" << endl;
+ return true;
}
+
+ virtual bool finalize()
+ {
+ cout << "finalize" << endl;
+ return true;
+ }
+
};
-extern "C" {
-
// create the object for the PHP extension
PHP_CPP_EXTENSION(SimpleExtension);
-
-}