summaryrefslogtreecommitdiff
path: root/zend/notimplemented.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 21:53:24 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 21:53:24 +0200
commit35fd3ccbeb4def71b4d8a59dfbb5c31201b099b9 (patch)
tree915223360aed4743aa6127fde4836aa413a260e5 /zend/notimplemented.h
parentda4710512865e6816585ac4ab8edab2fa125e2d8 (diff)
renamed src directory to zend directory, disabled TSRM debug code
Diffstat (limited to 'zend/notimplemented.h')
-rw-r--r--zend/notimplemented.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/zend/notimplemented.h b/zend/notimplemented.h
new file mode 100644
index 0000000..ee99254
--- /dev/null
+++ b/zend/notimplemented.h
@@ -0,0 +1,51 @@
+/**
+ * NotImplemented.h
+ *
+ * Exception that is thrown and catched by the library internally to detect
+ * if a magic method was implemented or not.
+ *
+ * Classes have magic methods (like __unset, __isset, etcetera). These methods
+ * can be implemented by the extension writer, but they do not have to be.
+ *
+ * The default implementation of the methods _could_ be to pass on the method
+ * to the original Zend engine, but the problem is that the magic methods from
+ * the PHP-CPP library do not have the same signature as the functions in the
+ * Zend engine. Passing them on directly is thus not possible.
+ *
+ * For that reason, the default implementation throw an exception that is
+ * immediately caught by the PHP-CPP library, so that it knows that the user
+ * has not overridden the methods, and the default Zend engine magic method
+ * can be called instead
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2014 Copernica BV
+ */
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Class definition
+ */
+class NotImplemented : public std::exception
+{
+public:
+ /**
+ * Constructor
+ */
+ NotImplemented() : std::exception() {}
+
+ /**
+ * Destructor
+ */
+ virtual ~NotImplemented() throw() {}
+
+};
+
+/**
+ * End namespace
+ */
+}
+