2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2010, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
15 #ifndef PHP_HTTP_MISSING
16 #define PHP_HTTP_MISSING
18 #include "php_version.h"
20 #if ZEND_MODULE_API_NO >= 20100409
21 #define ZEND_ENGINE_2_4
24 #if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50500)
25 # define ZEND_GET_PPTR_TYPE_DC , int type
26 # define ZEND_GET_PPTR_TYPE_CC , type
28 # define ZEND_GET_PPTR_TYPE_DC
29 # define ZEND_GET_PPTR_TYPE_CC
32 #if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399)
33 # define ZEND_LITERAL_KEY_DC , const zend_literal *_zend_literal_key
34 # define ZEND_LITERAL_KEY_CC , _zend_literal_key
35 # define ZEND_LITERAL_NIL_CC , NULL
36 # define HTTP_CHECK_OPEN_BASEDIR(file, act) \
37 if ((PG(open_basedir) && *PG(open_basedir))) \
39 const char *tmp = file; \
41 if (!strncasecmp(tmp, "file:", lenof("file:"))) { \
42 tmp += lenof("file:"); \
43 while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \
46 if ( (tmp != file || !strstr(file, "://")) && \
47 (!*tmp || php_check_open_basedir(tmp TSRMLS_CC))) { \
53 # define ZEND_LITERAL_KEY_DC
54 # define ZEND_LITERAL_KEY_CC
55 # define ZEND_LITERAL_NIL_CC
56 # define HTTP_CHECK_OPEN_BASEDIR(file, act) \
57 if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) \
59 const char *tmp = file; \
61 if (!strncasecmp(tmp, "file:", lenof("file:"))) { \
62 tmp += lenof("file:"); \
63 while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \
66 if ( (tmp != file || !strstr(file, "://")) && \
67 (!*tmp || php_check_open_basedir(tmp TSRMLS_CC) || \
68 (PG(safe_mode) && !php_checkuid(tmp, "rb+", CHECKUID_CHECK_MODE_PARAM)))) { \
75 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3)
76 # define HTTP_ZAPI_HASH_TSRMLS_CC TSRMLS_CC
77 # define HTTP_ZAPI_HASH_TSRMLS_DC TSRMLS_DC
78 # define HTTP_ZAPI_CONST_CAST(t) (const t)
79 # define GLOBAL_ERROR_HANDLING EG(error_handling)
80 # define GLOBAL_EXCEPTION_CLASS EG(exception_class)
81 # define HTTP_IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp) TSRMLS_CC)
82 # define HTTP_STATIC_ARG_INFO
84 # define HTTP_ZAPI_HASH_TSRMLS_CC
85 # define HTTP_ZAPI_HASH_TSRMLS_DC
86 # define HTTP_ZAPI_CONST_CAST(t) (t)
87 # define GLOBAL_ERROR_HANDLING PG(error_handling)
88 # define GLOBAL_EXCEPTION_CLASS PG(exception_class)
89 # define HTTP_IS_CALLABLE(cb_zv, flags, cb_sp) zend_is_callable((cb_zv), (flags), (cb_sp))
90 # define HTTP_STATIC_ARG_INFO static
93 #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0)
98 # define pemalloc_rel(size, persistent) ((persistent)?malloc(size):emalloc_rel(size))
101 #ifndef ZEND_ACC_DEPRECATED
102 # define ZEND_ACC_DEPRECATED 0
105 #if PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION < 10
106 # define php_url_parse_ex(u, l) php_url_parse(u)
109 #ifndef TSRMLS_FETCH_FROM_CTX
111 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
113 # define TSRMLS_FETCH_FROM_CTX(ctx)
117 #ifndef TSRMLS_SET_CTX
119 # define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
121 # define TSRMLS_SET_CTX(ctx)
126 # define ZVAL_ADDREF Z_ADDREF_P
129 #ifndef SEPARATE_ARG_IF_REF
130 #define SEPARATE_ARG_IF_REF(zv) \
131 if (PZVAL_IS_REF(zv)) { \
133 ALLOC_INIT_ZVAL(zv); \
134 Z_TYPE_P(zv) = Z_TYPE_P(ov); \
135 zv->value = ov->value; \
136 zval_copy_ctor(zv); \
143 #define ZVAL_ZVAL(z, zv, copy, dtor) { \
144 int is_ref, refcount; \
145 is_ref = (z)->is_ref; \
146 refcount = (z)->refcount; \
155 zval_ptr_dtor(&zv); \
157 (z)->is_ref = is_ref; \
158 (z)->refcount = refcount; \
162 # define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
165 # define RETURN_ZVAL(zv, copy, dtor) { RETVAL_ZVAL(zv, copy, dtor); return; }
169 # define ZEND_MN(name) ZEND_FN(name)
173 extern int zend_declare_property_double(zend_class_entry
*ce
, char *name
, int name_length
, double value
, int access_type TSRMLS_DC
);
174 extern void zend_update_property_double(zend_class_entry
*scope
, zval
*object
, char *name
, int name_length
, double value TSRMLS_DC
);
176 extern int zend_declare_property_bool(zend_class_entry
*ce
, char *name
, int name_length
, long value
, int access_type TSRMLS_DC
);
177 extern void zend_update_property_bool(zend_class_entry
*scope
, zval
*object
, char *name
, int name_length
, long value TSRMLS_DC
);
179 extern void zend_update_property_stringl(zend_class_entry
*scope
, zval
*object
, char *name
, int name_length
, char *value
, int value_len TSRMLS_DC
);
189 * vim600: noet sw=4 ts=4 fdm=marker
190 * vim<600: noet sw=4 ts=4