};
/* }}} */
+PHP_MINIT_FUNCTION(http);
+PHP_MSHUTDOWN_FUNCTION(http);
+PHP_RINIT_FUNCTION(http);
+PHP_RSHUTDOWN_FUNCTION(http);
+PHP_MINFO_FUNCTION(http);
+
/* {{{ http_module_dep */
#if ZEND_EXTENSION_API_NO >= 220050617
static zend_module_dep http_module_deps[] = {
# ifdef HAVE_PHP_SESSION
ZEND_MOD_REQUIRED("session")
# endif
-#ifdef HAVE_ICONV
+# ifdef HAVE_ICONV
ZEND_MOD_REQUIRED("iconv")
-#endif
+# endif
{NULL, NULL, NULL, 0}
};
#endif
HTTP_ARG_VAL(data, 0)
HTTP_END_ARGS;
-#define http_deflatestream_object_declare_default_properties() _http_deflatestream_object_declare_default_properties(TSRMLS_C)
-static inline void _http_deflatestream_object_declare_default_properties(TSRMLS_D);
-
+#define OBJ_PROP_CE http_deflatestream_object_ce
zend_class_entry *http_deflatestream_object_ce;
zend_function_entry http_deflatestream_object_fe[] = {
HTTP_DEFLATE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
{
HTTP_REGISTER_CLASS_EX(HttpDeflateStream, http_deflatestream_object, NULL, 0);
http_deflatestream_object_handlers.clone_obj = _http_deflatestream_object_clone_obj;
+
+#ifndef WONKY
+ DCL_CONST(long, "TYPE_GZIP", HTTP_DEFLATE_TYPE_GZIP);
+ DCL_CONST(long, "TYPE_ZLIB", HTTP_DEFLATE_TYPE_ZLIB);
+ DCL_CONST(long, "TYPE_RAW", HTTP_DEFLATE_TYPE_RAW);
+ DCL_CONST(long, "LEVEL_DEF", HTTP_DEFLATE_LEVEL_DEF);
+ DCL_CONST(long, "LEVEL_MIN", HTTP_DEFLATE_LEVEL_MIN);
+ DCL_CONST(long, "LEVEL_MAX", HTTP_DEFLATE_LEVEL_MAX);
+ DCL_CONST(long, "STRATEGY_DEF", HTTP_DEFLATE_STRATEGY_DEF);
+ DCL_CONST(long, "STRATEGY_FILT", HTTP_DEFLATE_STRATEGY_FILT);
+ DCL_CONST(long, "STRATEGY_HUFF", HTTP_DEFLATE_STRATEGY_HUFF);
+ DCL_CONST(long, "STRATEGY_RLE", HTTP_DEFLATE_STRATEGY_RLE);
+ DCL_CONST(long, "STRATEGY_FIXED", HTTP_DEFLATE_STRATEGY_FIXED);
+#endif
+
return SUCCESS;
}
return http_deflatestream_object_new_ex(Z_OBJCE_P(this_ptr), s, NULL);
}
-static inline void _http_deflatestream_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_deflatestream_object_ce;
-
-#ifndef WONKY
- DCL_CONST(long, "TYPE_GZIP", HTTP_DEFLATE_TYPE_GZIP);
- DCL_CONST(long, "TYPE_ZLIB", HTTP_DEFLATE_TYPE_ZLIB);
- DCL_CONST(long, "TYPE_RAW", HTTP_DEFLATE_TYPE_RAW);
- DCL_CONST(long, "LEVEL_DEF", HTTP_DEFLATE_LEVEL_DEF);
- DCL_CONST(long, "LEVEL_MIN", HTTP_DEFLATE_LEVEL_MIN);
- DCL_CONST(long, "LEVEL_MAX", HTTP_DEFLATE_LEVEL_MAX);
- DCL_CONST(long, "STRATEGY_DEF", HTTP_DEFLATE_STRATEGY_DEF);
- DCL_CONST(long, "STRATEGY_FILT", HTTP_DEFLATE_STRATEGY_FILT);
- DCL_CONST(long, "STRATEGY_HUFF", HTTP_DEFLATE_STRATEGY_HUFF);
- DCL_CONST(long, "STRATEGY_RLE", HTTP_DEFLATE_STRATEGY_RLE);
- DCL_CONST(long, "STRATEGY_FIXED", HTTP_DEFLATE_STRATEGY_FIXED);
-#endif
-}
-
void _http_deflatestream_object_free(zend_object *object TSRMLS_DC)
{
http_deflatestream_object *o = (http_deflatestream_object *) object;
HTTP_ARG_VAL(data, 0)
HTTP_END_ARGS;
+#define OBJ_PROP_CE http_inflatestream_object_ce
zend_class_entry *http_inflatestream_object_ce;
zend_function_entry http_inflatestream_object_fe[] = {
HTTP_INFLATE_ME(update, ZEND_ACC_PUBLIC)
};
static zend_object_handlers http_inflatestream_object_handlers;
-static inline void http_inflatestream_object_declare_default_properties() { return; }
-
PHP_MINIT_FUNCTION(http_inflatestream_object)
{
HTTP_REGISTER_CLASS_EX(HttpInflateStream, http_inflatestream_object, NULL, 0);
HTTP_END_ARGS;
HTTP_EMPTY_ARGS(reverse);
-#define http_message_object_declare_default_properties() _http_message_object_declare_default_properties(TSRMLS_C)
-static inline void _http_message_object_declare_default_properties(TSRMLS_D);
#define http_message_object_read_prop _http_message_object_read_prop
static zval *_http_message_object_read_prop(zval *object, zval *member, int type TSRMLS_DC);
#define http_message_object_write_prop _http_message_object_write_prop
#define http_message_object_get_props _http_message_object_get_props
static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC);
+#define OBJ_PROP_CE http_message_object_ce
zend_class_entry *http_message_object_ce;
zend_function_entry http_message_object_fe[] = {
HTTP_MESSAGE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_MINIT_FUNCTION(http_message_object)
{
HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0);
+
#ifndef WONKY
# ifdef HAVE_SPL
zend_class_implements(http_message_object_ce TSRMLS_CC, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);
#else
zend_class_implements(http_message_object_ce TSRMLS_CC, 1, zend_ce_iterator);
#endif
-
- HTTP_LONG_CONSTANT("HTTP_MSG_NONE", HTTP_MSG_NONE);
- HTTP_LONG_CONSTANT("HTTP_MSG_REQUEST", HTTP_MSG_REQUEST);
- HTTP_LONG_CONSTANT("HTTP_MSG_RESPONSE", HTTP_MSG_RESPONSE);
-
+
http_message_object_handlers.clone_obj = _http_message_object_clone_obj;
http_message_object_handlers.read_property = http_message_object_read_prop;
http_message_object_handlers.write_property = http_message_object_write_prop;
http_message_object_handlers.get_properties = http_message_object_get_props;
http_message_object_handlers.get_property_ptr_ptr = NULL;
+ DCL_PROP(PROTECTED, long, type, HTTP_MSG_NONE);
+ DCL_PROP(PROTECTED, string, body, "");
+ DCL_PROP(PROTECTED, string, requestMethod, "");
+ DCL_PROP(PROTECTED, string, requestUrl, "");
+ DCL_PROP(PROTECTED, string, responseStatus, "");
+ DCL_PROP(PROTECTED, long, responseCode, 0);
+ DCL_PROP_N(PROTECTED, httpVersion);
+ DCL_PROP_N(PROTECTED, headers);
+ DCL_PROP_N(PROTECTED, parentMessage);
+
+#ifndef WONKY
+ DCL_CONST(long, "TYPE_NONE", HTTP_MSG_NONE);
+ DCL_CONST(long, "TYPE_REQUEST", HTTP_MSG_REQUEST);
+ DCL_CONST(long, "TYPE_RESPONSE", HTTP_MSG_RESPONSE);
+#endif
+
+ HTTP_LONG_CONSTANT("HTTP_MSG_NONE", HTTP_MSG_NONE);
+ HTTP_LONG_CONSTANT("HTTP_MSG_REQUEST", HTTP_MSG_REQUEST);
+ HTTP_LONG_CONSTANT("HTTP_MSG_RESPONSE", HTTP_MSG_RESPONSE);
+
return SUCCESS;
}
return http_message_object_new_ex(Z_OBJCE_P(this_ptr), http_message_dup(obj->message), NULL);
}
-static inline void _http_message_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_message_object_ce;
-
-#ifndef WONKY
- DCL_CONST(long, "TYPE_NONE", HTTP_MSG_NONE);
- DCL_CONST(long, "TYPE_REQUEST", HTTP_MSG_REQUEST);
- DCL_CONST(long, "TYPE_RESPONSE", HTTP_MSG_RESPONSE);
-#endif
-
- DCL_PROP(PROTECTED, long, type, HTTP_MSG_NONE);
- DCL_PROP(PROTECTED, string, body, "");
- DCL_PROP(PROTECTED, string, requestMethod, "");
- DCL_PROP(PROTECTED, string, requestUrl, "");
- DCL_PROP(PROTECTED, string, responseStatus, "");
- DCL_PROP(PROTECTED, long, responseCode, 0);
- DCL_PROP_N(PROTECTED, httpVersion);
- DCL_PROP_N(PROTECTED, headers);
- DCL_PROP_N(PROTECTED, parentMessage);
-}
-
void _http_message_object_free(zend_object *object TSRMLS_DC)
{
http_message_object *o = (http_message_object *) object;
HTTP_ARG_VAL(serialized, 0)
HTTP_END_ARGS;
-#define http_querystring_object_declare_default_properties() _http_querystring_object_declare_default_properties(TSRMLS_C)
-static inline void _http_querystring_object_declare_default_properties(TSRMLS_D);
-
-#define GET_STATIC_PROP(n) *GET_STATIC_PROP_EX(http_querystring_object_ce, n)
-#define SET_STATIC_PROP(n, v) SET_STATIC_PROP_EX(http_querystring_object_ce, n, v)
#define OBJ_PROP_CE http_querystring_object_ce
zend_class_entry *http_querystring_object_ce;
zend_function_entry http_querystring_object_fe[] = {
zend_class_implements(http_querystring_object_ce TSRMLS_CC, 1, zend_ce_serializable);
#endif
+ DCL_STATIC_PROP_N(PRIVATE, instance);
+ DCL_PROP_N(PRIVATE, queryArray);
+ DCL_PROP(PRIVATE, string, queryString, "");
+
+#ifndef WONKY
+ DCL_CONST(long, "TYPE_BOOL", HTTP_QUERYSTRING_TYPE_BOOL);
+ DCL_CONST(long, "TYPE_INT", HTTP_QUERYSTRING_TYPE_INT);
+ DCL_CONST(long, "TYPE_FLOAT", HTTP_QUERYSTRING_TYPE_FLOAT);
+ DCL_CONST(long, "TYPE_STRING", HTTP_QUERYSTRING_TYPE_STRING);
+ DCL_CONST(long, "TYPE_ARRAY", HTTP_QUERYSTRING_TYPE_ARRAY);
+ DCL_CONST(long, "TYPE_OBJECT", HTTP_QUERYSTRING_TYPE_OBJECT);
+#endif
+
HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_BOOL", HTTP_QUERYSTRING_TYPE_BOOL);
HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_INT", HTTP_QUERYSTRING_TYPE_INT);
HTTP_LONG_CONSTANT("HTTP_QUERYSTRING_TYPE_FLOAT", HTTP_QUERYSTRING_TYPE_FLOAT);
return ov;
}
-static inline void _http_querystring_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_querystring_object_ce;
-
- DCL_STATIC_PROP_N(PRIVATE, instance);
-
- DCL_PROP_N(PRIVATE, queryArray);
- DCL_PROP(PRIVATE, string, queryString, "");
-
-#ifndef WONKY
- DCL_CONST(long, "TYPE_BOOL", HTTP_QUERYSTRING_TYPE_BOOL);
- DCL_CONST(long, "TYPE_INT", HTTP_QUERYSTRING_TYPE_INT);
- DCL_CONST(long, "TYPE_FLOAT", HTTP_QUERYSTRING_TYPE_FLOAT);
- DCL_CONST(long, "TYPE_STRING", HTTP_QUERYSTRING_TYPE_STRING);
- DCL_CONST(long, "TYPE_ARRAY", HTTP_QUERYSTRING_TYPE_ARRAY);
- DCL_CONST(long, "TYPE_OBJECT", HTTP_QUERYSTRING_TYPE_OBJECT);
-#endif
-}
-
void _http_querystring_object_free(zend_object *object TSRMLS_DC)
{
http_querystring_object *o = (http_querystring_object *) object;
HTTP_ARG_VAL(method, 0)
HTTP_END_ARGS;
-#define http_request_object_declare_default_properties() _http_request_object_declare_default_properties(TSRMLS_C)
-static inline void _http_request_object_declare_default_properties(TSRMLS_D);
-
#define OBJ_PROP_CE http_request_object_ce
zend_class_entry *http_request_object_ce;
zend_function_entry http_request_object_fe[] = {
{
HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0);
http_request_object_handlers.clone_obj = _http_request_object_clone_obj;
- return SUCCESS;
-}
-
-zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC)
-{
- return http_request_object_new_ex(ce, NULL, NULL);
-}
-
-zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, http_request_object **ptr TSRMLS_DC)
-{
- zend_object_value ov;
- http_request_object *o;
-
- o = ecalloc(1, sizeof(http_request_object));
- o->zo.ce = ce;
- o->request = http_request_init_ex(NULL, ch, 0, NULL);
-
- if (ptr) {
- *ptr = o;
- }
-
- ALLOC_HASHTABLE(OBJ_PROP(o));
- zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
-
- ov.handle = putObject(http_request_object, o);
- ov.handlers = &http_request_object_handlers;
-
- return ov;
-}
-
-zend_object_value _http_request_object_clone_obj(zval *this_ptr TSRMLS_DC)
-{
- zend_object *old_zo;
- zend_object_value new_ov;
- http_request_object *new_obj;
- getObject(http_request_object, old_obj);
-
- old_zo = zend_objects_get_address(this_ptr TSRMLS_CC);
- new_ov = http_request_object_new_ex(old_zo->ce, NULL, &new_obj);
- if (old_obj->request->ch) {
- http_curl_init_ex(curl_easy_duphandle(old_obj->request->ch), new_obj->request);
- }
-
- zend_objects_clone_members(&new_obj->zo, new_ov, old_zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
- phpstr_append(&new_obj->request->conv.request, old_obj->request->conv.request.data, old_obj->request->conv.request.used);
- phpstr_append(&new_obj->request->conv.response, old_obj->request->conv.response.data, old_obj->request->conv.response.used);
-
- return new_ov;
-}
-
-static inline void _http_request_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_request_object_ce;
DCL_PROP_N(PRIVATE, options);
DCL_PROP_N(PRIVATE, postFields);
#ifndef WONKY
/*
* Request Method Constants
- */
+ */
/* HTTP/1.1 */
DCL_CONST(long, "METH_GET", HTTP_GET);
DCL_CONST(long, "METH_HEAD", HTTP_HEAD);
DCL_CONST(long, "METH_ACL", HTTP_ACL);
/*
- * HTTP Protocol Version Constants
- */
+ * HTTP Protocol Version Constants
+ */
DCL_CONST(long, "VERSION_1_0", CURL_HTTP_VERSION_1_0);
DCL_CONST(long, "VERSION_1_1", CURL_HTTP_VERSION_1_1);
DCL_CONST(long, "VERSION_NONE", CURL_HTTP_VERSION_NONE);
/*
- * Auth Constants
- */
+ * Auth Constants
+ */
DCL_CONST(long, "AUTH_BASIC", CURLAUTH_BASIC);
DCL_CONST(long, "AUTH_DIGEST", CURLAUTH_DIGEST);
DCL_CONST(long, "AUTH_NTLM", CURLAUTH_NTLM);
DCL_CONST(long, "AUTH_ANY", CURLAUTH_ANY);
/*
- * Proxy Type Constants
- */
+ * Proxy Type Constants
+ */
# if HTTP_CURL_VERSION(7,15,2)
DCL_CONST(long, "PROXY_SOCKS4", CURLPROXY_SOCKS4);
# endif
DCL_CONST(long, "PROXY_SOCKS5", CURLPROXY_SOCKS5);
DCL_CONST(long, "PROXY_HTTP", CURLPROXY_HTTP);
#endif /* WONKY */
+
+ return SUCCESS;
+}
+
+zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC)
+{
+ return http_request_object_new_ex(ce, NULL, NULL);
+}
+
+zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, http_request_object **ptr TSRMLS_DC)
+{
+ zend_object_value ov;
+ http_request_object *o;
+
+ o = ecalloc(1, sizeof(http_request_object));
+ o->zo.ce = ce;
+ o->request = http_request_init_ex(NULL, ch, 0, NULL);
+
+ if (ptr) {
+ *ptr = o;
+ }
+
+ ALLOC_HASHTABLE(OBJ_PROP(o));
+ zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+
+ ov.handle = putObject(http_request_object, o);
+ ov.handlers = &http_request_object_handlers;
+
+ return ov;
+}
+
+zend_object_value _http_request_object_clone_obj(zval *this_ptr TSRMLS_DC)
+{
+ zend_object *old_zo;
+ zend_object_value new_ov;
+ http_request_object *new_obj;
+ getObject(http_request_object, old_obj);
+
+ old_zo = zend_objects_get_address(this_ptr TSRMLS_CC);
+ new_ov = http_request_object_new_ex(old_zo->ce, NULL, &new_obj);
+ if (old_obj->request->ch) {
+ http_curl_init_ex(curl_easy_duphandle(old_obj->request->ch), new_obj->request);
+ }
+
+ zend_objects_clone_members(&new_obj->zo, new_ov, old_zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+ phpstr_append(&new_obj->request->conv.request, old_obj->request->conv.request.data, old_obj->request->conv.request.used);
+ phpstr_append(&new_obj->request->conv.response, old_obj->request->conv.response.data, old_obj->request->conv.response.used);
+
+ return new_ov;
}
void _http_request_object_free(zend_object *object TSRMLS_DC)
HTTP_EMPTY_ARGS(getAttachedRequests);
HTTP_EMPTY_ARGS(getFinishedRequests);
-#define http_requestpool_object_declare_default_properties() _http_requestpool_object_declare_default_properties(TSRMLS_C)
-static inline void _http_requestpool_object_declare_default_properties(TSRMLS_D);
-
zend_class_entry *http_requestpool_object_ce;
zend_function_entry http_requestpool_object_fe[] = {
HTTP_REQPOOL_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_MINIT_FUNCTION(http_requestpool_object)
{
HTTP_REGISTER_CLASS_EX(HttpRequestPool, http_requestpool_object, NULL, 0);
+ http_requestpool_object_handlers.clone_obj = NULL;
+
#if defined(HAVE_SPL) && !defined(WONKY)
zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator);
#else
zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 1, zend_ce_iterator);
#endif
-
- http_requestpool_object_handlers.clone_obj = NULL;
+
return SUCCESS;
}
return ov;
}
-static inline void _http_requestpool_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_requestpool_object_ce;
-
- DCL_PROP_N(PROTECTED, pool);
-}
-
void _http_requestpool_object_free(zend_object *object TSRMLS_DC)
{
http_requestpool_object *o = (http_requestpool_object *) object;
#include "php_http_response_object.h"
#include "php_http_send_api.h"
-#define GET_STATIC_PROP(n) *GET_STATIC_PROP_EX(http_response_object_ce, n)
-#define UPD_STATIC_PROP(t, n, v) UPD_STATIC_PROP_EX(http_response_object_ce, t, n, v)
-#define SET_STATIC_PROP(n, v) SET_STATIC_PROP_EX(http_response_object_ce, n, v)
-#define UPD_STATIC_STRL(n, v, l) UPD_STATIC_STRL_EX(http_response_object_ce, n, v, l)
-
#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpResponse, method, 0, req_args)
#define HTTP_EMPTY_ARGS(method) HTTP_EMPTY_ARGS_EX(HttpResponse, method, 0)
#define HTTP_RESPONSE_ME(method, visibility) PHP_ME(HttpResponse, method, HTTP_ARGS(HttpResponse, method), visibility|ZEND_ACC_STATIC)
HTTP_EMPTY_ARGS(getRequestHeaders);
HTTP_EMPTY_ARGS(getRequestBody);
-#define http_response_object_declare_default_properties() _http_response_object_declare_default_properties(TSRMLS_C)
-static inline void _http_response_object_declare_default_properties(TSRMLS_D);
#define http_grab_response_headers _http_grab_response_headers
static void _http_grab_response_headers(void *data, void *arg TSRMLS_DC);
+#define OBJ_PROP_CE http_response_object_ce
zend_class_entry *http_response_object_ce;
zend_function_entry http_response_object_fe[] = {
PHP_MINIT_FUNCTION(http_response_object)
{
HTTP_REGISTER_CLASS(HttpResponse, http_response_object, NULL, 0);
- http_response_object_declare_default_properties();
- return SUCCESS;
-}
-
-static inline void _http_response_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_response_object_ce;
-
+
DCL_STATIC_PROP(PRIVATE, bool, sent, 0);
DCL_STATIC_PROP(PRIVATE, bool, catch, 0);
DCL_STATIC_PROP(PRIVATE, long, mode, -1);
DCL_CONST(long, "REDIRECT_PROXY", HTTP_REDIRECT_PROXY);
DCL_CONST(long, "REDIRECT_TEMP", HTTP_REDIRECT_TEMP);
#endif /* WONKY */
+
+ return SUCCESS;
}
static void _http_grab_response_headers(void *data, void *arg TSRMLS_DC)
#endif
PHP_FUNCTION(http_support);
-PHP_MINIT_FUNCTION(http);
-PHP_MSHUTDOWN_FUNCTION(http);
-PHP_RINIT_FUNCTION(http);
-PHP_RSHUTDOWN_FUNCTION(http);
-PHP_MINFO_FUNCTION(http);
-
#endif /* PHP_HTTP_H */
/*
name## _ce = zend_register_internal_class_ex(&ce, parent, NULL TSRMLS_CC); \
name## _ce->ce_flags |= flags; \
memcpy(& name## _handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \
- name## _declare_default_properties(); \
}
# define HTTP_REGISTER_CLASS(classname, name, parent, flags) \
# define putObject(t, o) zend_objects_store_put(o, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) _ ##t## _free, NULL TSRMLS_CC);
# define OBJ_PROP(o) (o)->zo.properties
-# define DCL_STATIC_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
-# define DCL_STATIC_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
-# define DCL_STATIC_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
+# define DCL_STATIC_PROP(a, t, n, v) zend_declare_property_ ##t(OBJ_PROP_CE, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
+# define DCL_STATIC_PROP_Z(a, n, v) zend_declare_property(OBJ_PROP_CE, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
+# define DCL_STATIC_PROP_N(a, n) zend_declare_property_null(OBJ_PROP_CE, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a | ZEND_ACC_STATIC) TSRMLS_CC)
# define GET_STATIC_PROP_EX(ce, n) zend_std_get_static_property(ce, (#n), sizeof(#n)-1, 0 TSRMLS_CC)
# define UPD_STATIC_PROP_EX(ce, t, n, v) zend_update_static_property_ ##t(ce, #n, sizeof(#n)-1, (v) TSRMLS_CC)
# define UPD_STATIC_STRL_EX(ce, n, v, l) zend_update_static_property_stringl(ce, #n, sizeof(#n)-1, (v), (l) TSRMLS_CC)
# define SET_STATIC_PROP_EX(ce, n, v) zend_update_static_property(ce, #n, sizeof(#n)-1, v TSRMLS_CC)
-
-# define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC)
-# define DCL_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC)
-# define DCL_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a) TSRMLS_CC)
+# define GET_STATIC_PROP(n) *GET_STATIC_PROP_EX(OBJ_PROP_CE, n)
+# define UPD_STATIC_PROP(t, n, v) UPD_STATIC_PROP_EX(OBJ_PROP_CE, t, n, v)
+# define SET_STATIC_PROP(n, v) SET_STATIC_PROP_EX(OBJ_PROP_CE, n, v)
+# define UPD_STATIC_STRL(n, v, l) UPD_STATIC_STRL_EX(OBJ_PROP_CE, n, v, l)
+
+# define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(OBJ_PROP_CE, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC)
+# define DCL_PROP_Z(a, n, v) zend_declare_property(OBJ_PROP_CE, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC)
+# define DCL_PROP_N(a, n) zend_declare_property_null(OBJ_PROP_CE, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a) TSRMLS_CC)
# define UPD_PROP(t, n, v) UPD_PROP_EX(getThis(), t, n, v)
# define UPD_PROP_EX(this, t, n, v) zend_update_property_ ##t(OBJ_PROP_CE, this, (#n), sizeof(#n)-1, (v) TSRMLS_CC)
# define UPD_STRL(n, v, l) zend_update_property_stringl(OBJ_PROP_CE, getThis(), (#n), sizeof(#n)-1, (v), (l) TSRMLS_CC)
# define GET_PROP(n) GET_PROP_EX(getThis(), n)
# define GET_PROP_EX(this, n) zend_read_property(OBJ_PROP_CE, this, (#n), sizeof(#n)-1, 0 TSRMLS_CC)
-# define DCL_CONST(t, n, v) zend_declare_class_constant_ ##t(ce, (n), sizeof(n)-1, (v) TSRMLS_CC)
+# define DCL_CONST(t, n, v) zend_declare_class_constant_ ##t(OBJ_PROP_CE, (n), sizeof(n)-1, (v) TSRMLS_CC)
# define ACC_PROP_PRIVATE(ce, flags) ((flags & ZEND_ACC_PRIVATE) && (EG(scope) && ce == EG(scope))
# define ACC_PROP_PROTECTED(ce, flags) ((flags & ZEND_ACC_PROTECTED) && (zend_check_protected(ce, EG(scope))))