summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-24 13:43:47 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-24 13:43:47 +0100
commit2fd4198b78358cf2ba527296fafb5b1728e28ea8 (patch)
tree798098f25293908c7fae4e35e8761918460cdb3e /include
parent930ab4880b65885322eb7ca4772b8cdb49a2b0ae (diff)
added tsrm parameter to all methods to make it compile on tsrm platforms
Diffstat (limited to 'include')
-rw-r--r--include/base.h2
-rw-r--r--include/classbase.h124
-rw-r--r--include/exception.h7
-rw-r--r--include/extension.h40
-rw-r--r--include/iterator.h28
-rw-r--r--include/namespace.h14
-rw-r--r--include/parameters.h16
7 files changed, 139 insertions, 92 deletions
diff --git a/include/base.h b/include/base.h
index 97b153d..c26549f 100644
--- a/include/base.h
+++ b/include/base.h
@@ -246,9 +246,11 @@ private:
/**
* Store the object in the zend object cache
* @param entry
+ * @param tsrm_ls
* @return MixedObject
*/
MixedObject *store(struct _zend_class_entry *entry);
+ MixedObject *store(struct _zend_class_entry *entry, void ***tsrm_ls);
/**
* Retrieve the handle
diff --git a/include/classbase.h b/include/classbase.h
index 6a71ecb..f8cfd21 100644
--- a/include/classbase.h
+++ b/include/classbase.h
@@ -132,8 +132,10 @@ public:
* class.
*
* @param ns Namespace name
+ * @param tsrm_ls
*/
- void initialize(const std::string &ns);
+// void initialize(const std::string &ns);
+ void initialize(const std::string &ns, void ***tsrm_ls);
protected:
/**
@@ -318,12 +320,17 @@ private:
* Static member functions to create or clone objects based on this class
* @param entry Pointer to class information
* @param val The object to be cloned
+ * @param tsrm_ls
* @return zend_object_value Object info
*/
- static struct _zend_object_value createObject(struct _zend_class_entry *entry);
- static struct _zend_object_value cloneObject(struct _zval_struct *val);
- static void destructObject(struct _zend_object *object, unsigned int handle);
- static void freeObject(struct _zend_object *object);
+// static struct _zend_object_value createObject(struct _zend_class_entry *entry);
+ static struct _zend_object_value createObject(struct _zend_class_entry *entry, void ***tsrm_ls);
+// static struct _zend_object_value cloneObject(struct _zval_struct *val);
+ static struct _zend_object_value cloneObject(struct _zval_struct *val, void ***tsrm_ls);
+// static void destructObject(struct _zend_object *object, unsigned int handle);
+ static void destructObject(struct _zend_object *object, unsigned int handle, void ***tsrm_ls);
+// static void freeObject(struct _zend_object *object);
+ static void freeObject(struct _zend_object *object, void ***tsrm_ls);
/**
* Static member function that get called when a method or object is called
@@ -332,9 +339,12 @@ private:
* @param return_value_ptr Pointer to the same zval
* @param this_ptr Object being called
* @param return_value_used Is the return value used or not?
+ * @param tsrm_ls
*/
- static void callMethod(int ht, struct _zval_struct *return_value, struct _zval_struct **return_value_ptr, struct _zval_struct *this_ptr, int return_value_used);
- static void callInvoke(int ht, struct _zval_struct *return_value, struct _zval_struct **return_value_ptr, struct _zval_struct *this_ptr, int return_value_used);
+// static void callMethod(int ht, struct _zval_struct *return_value, struct _zval_struct **return_value_ptr, struct _zval_struct *this_ptr, int return_value_used);
+ static void callMethod(int ht, struct _zval_struct *return_value, struct _zval_struct **return_value_ptr, struct _zval_struct *this_ptr, int return_value_used, void ***tsrm_ls);
+// static void callInvoke(int ht, struct _zval_struct *return_value, struct _zval_struct **return_value_ptr, struct _zval_struct *this_ptr, int return_value_used);
+ static void callInvoke(int ht, struct _zval_struct *return_value, struct _zval_struct **return_value_ptr, struct _zval_struct *this_ptr, int return_value_used, void ***tsrm_ls);
/**
* Function that is used to count the number of elements in the object
@@ -342,43 +352,29 @@ private:
* call the count() method
* @param val
* @param count
+ * @param tsrm_ls
* @return int
*/
- static int countElements(struct _zval_struct *object, long *count);
-
- /**
- * Function that is called when the object is used as an array in PHP
- * @param object The object on which it is called
- * @param offset The name of the property
- * @param type The type of the variable???
- * @return zval
- */
- static struct _zval_struct *readDimension(struct _zval_struct *object, struct _zval_struct *offset, int type);
+// static int countElements(struct _zval_struct *object, long *count);
+ static int countElements(struct _zval_struct *object, long *count, void ***tsrm_ls);
/**
* Function that is called when the object is used as an array in PHP
* @param object The object on which it is called
* @param offset The name of the property
* @param value The new value
- * @return zval
- */
- static void writeDimension(struct _zval_struct *object, struct _zval_struct *offset, struct _zval_struct *value);
-
- /**
- * Function that is called when the object is used as an array in PHP
- * @param object The object on which it is called
- * @param member The member to check
+ * @param type The type of the variable???
* @param check_empty ????
- * @return bool
- */
- static int hasDimension(struct _zval_struct *object, struct _zval_struct *member, int check_empty);
-
- /**
- * Function that is called when the object is used as an array in PHP
- * @param object The object on which it is called
- * @param member The member to remove
+ * @return zval
*/
- static void unsetDimension(struct _zval_struct *object, struct _zval_struct *member);
+// static struct _zval_struct *readDimension(struct _zval_struct *object, struct _zval_struct *offset, int type);
+ static struct _zval_struct *readDimension(struct _zval_struct *object, struct _zval_struct *offset, int type, void ***tsrm_ls);
+// static void writeDimension(struct _zval_struct *object, struct _zval_struct *offset, struct _zval_struct *value);
+ static void writeDimension(struct _zval_struct *object, struct _zval_struct *offset, struct _zval_struct *value, void ***tsrm_ls);
+// static int hasDimension(struct _zval_struct *object, struct _zval_struct *offset, int check_empty);
+ static int hasDimension(struct _zval_struct *object, struct _zval_struct *offset, int check_empty, void ***tsrm_ls);
+// static void unsetDimension(struct _zval_struct *object, struct _zval_struct *offset);
+ static void unsetDimension(struct _zval_struct *object, struct _zval_struct *offset, void ***tsrm_ls);
/**
* Retrieve pointer to our own object handlers
@@ -391,9 +387,11 @@ private:
* @param entry The class entry
* @param object The object to iterate over
* @param by_ref ?????
+ * @param tsrm_ls
* @return zend_object_iterator* Pointer to the iterator
*/
- static struct _zend_object_iterator *getIterator(struct _zend_class_entry *entry, struct _zval_struct *object, int by_ref);
+// static struct _zend_object_iterator *getIterator(struct _zend_class_entry *entry, struct _zval_struct *object, int by_ref);
+ static struct _zend_object_iterator *getIterator(struct _zend_class_entry *entry, struct _zval_struct *object, int by_ref, void ***tsrm_ls);
/**
* Function that is called when a property is being read
@@ -401,10 +399,13 @@ private:
* @param offset The name of the property
* @param type The type of the variable???
* @param key ???
+ * @param tsrm_ls
* @return zval
*/
- static struct _zval_struct *readProperty(struct _zval_struct *object, struct _zval_struct *name, int type, const struct _zend_literal *key);
- static struct _zval_struct *readProperty(struct _zval_struct *object, struct _zval_struct *name, int type);
+// static struct _zval_struct *readProperty(struct _zval_struct *object, struct _zval_struct *name, int type, const struct _zend_literal *key);
+ static struct _zval_struct *readProperty(struct _zval_struct *object, struct _zval_struct *name, int type, const struct _zend_literal *key, void ***tsrm_ls);
+// static struct _zval_struct *readProperty(struct _zval_struct *object, struct _zval_struct *name, int type);
+ static struct _zval_struct *readProperty(struct _zval_struct *object, struct _zval_struct *name, int type, void ***tsrm_ls);
/**
* Function that is called when a property is set / updated
@@ -412,28 +413,37 @@ private:
* @param name The name of the property
* @param value The new value
* @param key ???
+ * @param tsrm_ls
* @return zval
*/
- static void writeProperty(struct _zval_struct *object, struct _zval_struct *name, struct _zval_struct *value, const struct _zend_literal *key);
- static void writeProperty(struct _zval_struct *object, struct _zval_struct *name, struct _zval_struct *value);
+// static void writeProperty(struct _zval_struct *object, struct _zval_struct *name, struct _zval_struct *value, const struct _zend_literal *key);
+ static void writeProperty(struct _zval_struct *object, struct _zval_struct *name, struct _zval_struct *value, const struct _zend_literal *key, void ***tsrm_ls);
+// static void writeProperty(struct _zval_struct *object, struct _zval_struct *name, struct _zval_struct *value);
+ static void writeProperty(struct _zval_struct *object, struct _zval_struct *name, struct _zval_struct *value, void ***tsrm_ls);
/**
* Function that is called to check whether a certain property is set
* @param object The object on which it is called
* @param name The name of the property to check
* @param has_set_exists See above
+ * @param tsrm_ls
* @return bool
*/
- static int hasProperty(struct _zval_struct *object, struct _zval_struct *name, int has_set_exists, const struct _zend_literal *key);
- static int hasProperty(struct _zval_struct *object, struct _zval_struct *name, int has_set_exists);
+// static int hasProperty(struct _zval_struct *object, struct _zval_struct *name, int has_set_exists, const struct _zend_literal *key);
+ static int hasProperty(struct _zval_struct *object, struct _zval_struct *name, int has_set_exists, const struct _zend_literal *key, void ***tsrm_ls);
+// static int hasProperty(struct _zval_struct *object, struct _zval_struct *name, int has_set_exists);
+ static int hasProperty(struct _zval_struct *object, struct _zval_struct *name, int has_set_exists, void ***tsrm_ls);
/**
* Function that is called when a property is removed from the project
* @param object The object on which it is called
* @param member The member to remove
+ * @param tsrm_ls
*/
- static void unsetProperty(struct _zval_struct *object, struct _zval_struct *member, const struct _zend_literal *key);
- static void unsetProperty(struct _zval_struct *object, struct _zval_struct *member);
+// static void unsetProperty(struct _zval_struct *object, struct _zval_struct *member, const struct _zend_literal *key);
+ static void unsetProperty(struct _zval_struct *object, struct _zval_struct *member, const struct _zend_literal *key, void ***tsrm_ls);
+// static void unsetProperty(struct _zval_struct *object, struct _zval_struct *member);
+ static void unsetProperty(struct _zval_struct *object, struct _zval_struct *member, void ***tsrm_ls);
/**
* Method that returns information about the function signature of a undefined method
@@ -441,10 +451,13 @@ private:
* @param method
* @param method_len
* @param key
+ * @param tsrm_ls
* @return zend_function
*/
- static union _zend_function *getMethod(struct _zval_struct **object_ptr, char *method, int method_len, const struct _zend_literal *key);
+// static union _zend_function *getMethod(struct _zval_struct **object_ptr, char *method, int method_len, const struct _zend_literal *key);
static union _zend_function *getMethod(struct _zval_struct **object_ptr, char *method, int method_len);
+// static union _zend_function *getMethod(struct _zval_struct **object_ptr, char *method, int method_len, const struct _zend_literal *key, void ***tsrm_ls);
+ static union _zend_function *getMethod(struct _zval_struct **object_ptr, char *method, int method_len, void ***tsrm_ls);
/**
* Method that returns information about the function signature of an undefined static method
@@ -452,9 +465,11 @@ private:
* @param method
* @param method_len
* @param key
+ * @param tsrm_ls
* @return zend_function
*/
- static union _zend_function *getStaticMethod(struct _zend_class_entry *entry, char* method, int method_len);
+// static union _zend_function *getStaticMethod(struct _zend_class_entry *entry, char* method, int method_len);
+ static union _zend_function *getStaticMethod(struct _zend_class_entry *entry, char* method, int method_len, void ***tsrm_ls);
/**
* Method that returns information about the __invoke() method
@@ -462,26 +477,32 @@ private:
* @param entry
* @param func
* @param object_ptr
+ * @param tsrm_ls
* @return int
*/
- static int getClosure(struct _zval_struct *object, struct _zend_class_entry **entry, union _zend_function **func, struct _zval_struct **object_ptr);
+// static int getClosure(struct _zval_struct *object, struct _zend_class_entry **entry, union _zend_function **func, struct _zval_struct **object_ptr);
+ static int getClosure(struct _zval_struct *object, struct _zend_class_entry **entry, union _zend_function **func, struct _zval_struct **object_ptr, void ***tsrm_ls);
/**
* Function to cast the object to a different type
* @param object
* @param retval
* @param type
+ * @param tsrm_ls
* @return int
*/
- static int cast(struct _zval_struct *object, struct _zval_struct *retval, int type);
+// static int cast(struct _zval_struct *object, struct _zval_struct *retval, int type);
+ static int cast(struct _zval_struct *object, struct _zval_struct *retval, int type, void ***tsrm_ls);
/**
* Function to compare two objects
* @param object1
* @param object2
+ * @param tsrm_ls
* @return int
*/
- static int compare(struct _zval_struct *object1, struct _zval_struct *object2);
+// static int compare(struct _zval_struct *object1, struct _zval_struct *object2);
+ static int compare(struct _zval_struct *object1, struct _zval_struct *object2, void ***tsrm_ls);
/**
* Methods that are called to serialize/unserialize an object
@@ -490,10 +511,13 @@ private:
* @param buffer Buffer in which to store the data
* @param buf_len Size of the bufffer
* @param data Structure describing the serialize/unserialize data
+ * @param tsrm_ls
* @return int
*/
- static int serialize(struct _zval_struct *object, unsigned char **buffer, unsigned int *buf_len, struct _zend_serialize_data *data);
- static int unserialize(struct _zval_struct **object, struct _zend_class_entry *entry, const unsigned char *buffer, unsigned int buf_len, struct _zend_unserialize_data *data);
+// static int serialize(struct _zval_struct *object, unsigned char **buffer, unsigned int *buf_len, struct _zend_serialize_data *data);
+ static int serialize(struct _zval_struct *object, unsigned char **buffer, unsigned int *buf_len, struct _zend_serialize_data *data, void ***tsrm_ls);
+// static int unserialize(struct _zval_struct **object, struct _zend_class_entry *entry, const unsigned char *buffer, unsigned int buf_len, struct _zend_unserialize_data *data);
+ static int unserialize(struct _zval_struct **object, struct _zend_class_entry *entry, const unsigned char *buffer, unsigned int buf_len, struct _zend_unserialize_data *data, void ***tsrm_ls);
/**
* Name of the class
diff --git a/include/exception.h b/include/exception.h
index 8475925..7722424 100644
--- a/include/exception.h
+++ b/include/exception.h
@@ -58,12 +58,15 @@ public:
/**
* Process the exception
*
- * This method is called only from withing the PHP-CPP library,
+ * This method is called only from within the PHP-CPP library,
* and will turn the exception into a PHP exception
*
+ * @param tsrm_ls
+ *
* @internal
*/
- virtual void process();
+// virtual void process();
+ virtual void process(void ***tsrm_ls);
};
/**
diff --git a/include/extension.h b/include/extension.h
index ca7e807..9634ae6 100644
--- a/include/extension.h
+++ b/include/extension.h
@@ -181,33 +181,41 @@ private:
* Function that is called when the extension initializes
* @param type Module type
* @param number Module number
+ * @param tsrm_ls
* @return int 0 on success
*/
- static int onStartup(int type, int module_number);
-
+// static int onStartup(int type, int module_number);
+ static int onStartup(int type, int module_number, void ***tsrm_ls);
+
/**
* Function that is called when the extension is about to be stopped
* @param type Module type
* @param number Module number
+ * @param tsrm_ls
* @return int
*/
- static int onShutdown(int type, int module_number);
+// static int onShutdown(int type, int module_number);
+ static int onShutdown(int type, int module_number, void ***tsrm_ls);
- /**
- * Function that is called when a request starts
- * @param type Module type
- * @param number Module number
- * @return int 0 on success
- */
- static int onRequest(int type, int module_number);
+ /**
+ * Function that is called when a request starts
+ * @param type Module type
+ * @param number Module number
+ * @param tsrm_ls
+ * @return int 0 on success
+ */
+// static int onRequest(int type, int module_number);
+ static int onRequest(int type, int module_number, void ***tsrm_ls);
/**
- * Function that is called when a request is ended
- * @param type Module type
- * @param number Module number
- * @return int 0 on success
- */
- static int onIdle(int type, int module_number);
+ * Function that is called when a request is ended
+ * @param type Module type
+ * @param number Module number
+ * @param tsrm_ls
+ * @return int 0 on success
+ */
+// static int onIdle(int type, int module_number);
+ static int onIdle(int type, int module_number, void ***tsrm_ls);
};
/**
diff --git a/include/iterator.h b/include/iterator.h
index 7cc99cb..d5f30c7 100644
--- a/include/iterator.h
+++ b/include/iterator.h
@@ -92,23 +92,29 @@ private:
/**
* Iterator destructor method
* @param iter
+ * @param tsrm_ls
*/
- static void destructor(struct _zend_object_iterator *iter);
+// static void destructor(struct _zend_object_iterator *iter);
+ static void destructor(struct _zend_object_iterator *iter, void ***tsrm_ls);
/**
* Iterator valid function
* Returns FAILURE or SUCCESS
* @param iter
+ * @param tsrm_ls
* @return int
*/
- static int valid(struct _zend_object_iterator *iter);
+// static int valid(struct _zend_object_iterator *iter);
+ static int valid(struct _zend_object_iterator *iter, void ***tsrm_ls);
/**
* Fetch the current item
* @param iter
* @param data
+ * @param tsrm_ls
*/
- static void current(struct _zend_object_iterator *iter, struct _zval_struct ***data);
+// static void current(struct _zend_object_iterator *iter, struct _zval_struct ***data);
+ static void current(struct _zend_object_iterator *iter, struct _zval_struct ***data, void ***tsrm_ls);
/**
* Fetch the key for the current element (optional, may be NULL). The key
@@ -117,8 +123,10 @@ private:
* used.
* @param iter
* @param data
+ * @param tsrm_ls
*/
- static void key(struct _zend_object_iterator *iter, struct _zval_struct *data);
+// static void key(struct _zend_object_iterator *iter, struct _zval_struct *data);
+ static void key(struct _zend_object_iterator *iter, struct _zval_struct *data, void ***tsrm_ls);
/**
* Function to retrieve the current key, php 5.3 style
@@ -126,21 +134,27 @@ private:
* @param str_key
* @param str_key_len
* @param int_key
+ * @param tsrm_ls
* @return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG
*/
- static int key(struct _zend_object_iterator *iter, char **str_key, unsigned int *str_key_len, unsigned long *int_key);
+// static int key(struct _zend_object_iterator *iter, char **str_key, unsigned int *str_key_len, unsigned long *int_key);
+ static int key(struct _zend_object_iterator *iter, char **str_key, unsigned int *str_key_len, unsigned long *int_key, void ***tsrm_ls);
/**
* Step forwards to the next element
* @param iter
+ * @param tsrm_ls
*/
- static void next(struct _zend_object_iterator *iter);
+// static void next(struct _zend_object_iterator *iter);
+ static void next(struct _zend_object_iterator *iter, void ***tsrm_ls);
/**
* Rewind the iterator back to the start
* @param iter
+ * @param tsrm_ls
*/
- static void rewind(struct _zend_object_iterator *iter);
+// static void rewind(struct _zend_object_iterator *iter);
+ static void rewind(struct _zend_object_iterator *iter, void ***tsrm_ls);
/**
* Get access to all iterator functions
diff --git a/include/namespace.h b/include/namespace.h
index 9d6e6f2..55fea05 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -199,18 +199,10 @@ protected:
/**
* Initialize the namespace after it was registered
* @param parent Parent namespace
+ * @param tsrm_ls
*/
- void initialize(const std::string &parent)
- {
- // the namespace to use
- std::string prefix = parent.size() ? parent + "\\" + _name : _name;
-
- // loop through the classes in this namespace
- for (auto &c : _classes) c->initialize(prefix);
-
- // and loop through the other namespaces
- for (auto &n : _namespaces) n->initialize(prefix);
- }
+// void initialize(const std::string &parent);
+ void initialize(const std::string &parent, void ***tsrm_ls);
};
/**
diff --git a/include/parameters.h b/include/parameters.h
index 3a1686a..91fab5a 100644
--- a/include/parameters.h
+++ b/include/parameters.h
@@ -29,25 +29,29 @@ public:
* @param argc Number of arguments
* @param tsrm_ls
*/
- Parameters(struct _zval_struct *this_ptr, int argc);// TSRMLS_DC);
+// Parameters(struct _zval_struct *this_ptr, int argc);
+ Parameters(struct _zval_struct *this_ptr, int argc, void ***tsrm_ls);
/**
* Destructor
*/
virtual ~Parameters() {}
-
+
/**
* The object that is being called
* @return Base
*/
- Base *object();
+ Base *object() const
+ {
+ return _object;
+ }
private:
/**
- * The this pointer
- * @var zval
+ * The base object
+ * @var Base
*/
- struct _zval_struct *_this;
+ Base *_object = nullptr;
};
/**