summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-30 13:49:23 -0700
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-09-30 13:49:23 -0700
commit777eb276f635c949ccdcf9613ad55d42190cb387 (patch)
treef5451ae464a37414412d122ff6a283f713638dfa /src
parentecfca6b1197658afb85fffd6f6ac9e92311a4b07 (diff)
Work in progress on adding public and protected properties to classes
Diffstat (limited to 'src')
-rw-r--r--src/classinfo.cpp3
-rw-r--r--src/includes.h3
-rw-r--r--src/member.cpp32
3 files changed, 38 insertions, 0 deletions
diff --git a/src/classinfo.cpp b/src/classinfo.cpp
index 7de7522..aa4d67f 100644
--- a/src/classinfo.cpp
+++ b/src/classinfo.cpp
@@ -177,6 +177,9 @@ void _ClassInfo::initialize(TSRMLS_D)
// store pointer to the class in the unused doc_comment member
_entry->info.user.doc_comment = (const char *)this;
+
+ // initialize the entry
+ initialize(_entry);
}
/**
diff --git a/src/includes.h b/src/includes.h
index 5602e06..92de4ab 100644
--- a/src/includes.h
+++ b/src/includes.h
@@ -46,6 +46,9 @@
#include "../include/parameters.h"
#include "../include/function.h"
#include "../include/base.h"
+#include "../include/member.h"
+#include "../include/public.h"
+#include "../include/protected.h"
#include "../include/class.h"
#include "../include/classinfo.h"
#include "../include/extension.h"
diff --git a/src/member.cpp b/src/member.cpp
new file mode 100644
index 0000000..82faf95
--- /dev/null
+++ b/src/member.cpp
@@ -0,0 +1,32 @@
+/**
+ * Member.cpp
+ *
+ * Implementation for class members
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2013 Copernica BV
+ */
+#include "includes.h"
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Internal method to declare the property
+ * @var zend_class_entry
+ */
+void Member::declare(struct _zend_class_entry *entry)
+{
+ std::cout << "declare property " << _name << std::endl;
+
+ // declare the property
+ zend_declare_property(entry, _name.c_str(), _name.size(), _value._val, _public ? ZEND_ACC_PUBLIC : ZEND_ACC_PROTECTED TSRMLS_CC);
+}
+
+/**
+ * End of namespace
+ */
+}
+