summaryrefslogtreecommitdiff
path: root/include/namespace.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-01 10:51:37 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-01 10:51:37 +0100
commita05b25d54df9d42a8fe4632073538ba47eb710ab (patch)
tree30d8aa3bcf304800ba4c02ef8eaffb695bb10a0f /include/namespace.h
parentc8d1519f31baed0fb399dac9333e48e2f9e910ad (diff)
fixed various compile issues and namespace implementation
Diffstat (limited to 'include/namespace.h')
-rw-r--r--include/namespace.h9
1 files changed, 6 insertions, 3 deletions
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);
}
};