diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-01 10:51:37 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-01 10:51:37 +0100 |
commit | a05b25d54df9d42a8fe4632073538ba47eb710ab (patch) | |
tree | 30d8aa3bcf304800ba4c02ef8eaffb695bb10a0f /include | |
parent | c8d1519f31baed0fb399dac9333e48e2f9e910ad (diff) |
fixed various compile issues and namespace implementation
Diffstat (limited to 'include')
-rw-r--r-- | include/class.h | 4 | ||||
-rw-r--r-- | include/extension.h | 8 | ||||
-rw-r--r-- | include/namespace.h | 9 |
3 files changed, 8 insertions, 13 deletions
diff --git a/include/class.h b/include/class.h index 1ac4f00..72615e5 100644 --- a/include/class.h +++ b/include/class.h @@ -116,9 +116,9 @@ private: } /** - * Extensions have access to the private base class + * Namespaces have access to the private base class */ - friend class Extension; + friend class Namespace; }; /** diff --git a/include/extension.h b/include/extension.h index 72c7d56..f04dc8c 100644 --- a/include/extension.h +++ b/include/extension.h @@ -152,14 +152,6 @@ public: private: /** - * Initialize all functions in this namespace - * @param ns Namespace prefix - * @param entries The array to be filled - * @return int Number of functions that were initialized - */ - size_t initialize(const std::string &ns, zend_function_entry entries[]); - - /** * The information that is passed to the Zend engine * * Although it would be slightly faster to not make this a pointer, this diff --git a/include/namespace.h b/include/namespace.h index 727f1dd..ef625fc 100644 --- a/include/namespace.h +++ b/include/namespace.h @@ -180,7 +180,7 @@ protected: * @param entries The array to be filled * @return int Number of functions that were initialized */ - size_t initialize(const std::string &ns, zend_function_entry entries[]); + size_t initialize(const std::string &ns, struct _zend_function_entry entries[]); /** * Initialize the namespace after it was registered @@ -188,11 +188,14 @@ protected: */ 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(parent+"\\"+_name); + for (auto &c : _classes) c->initialize(prefix); // and loop through the other namespaces - for (auto &n : _namespaces) n->initialize(parent+"\\"+_name); + for (auto &n : _namespaces) n->initialize(prefix); } }; |