+static inline zval *php_http_zsep(zend_bool add_ref, int type, zval *z)
+{
+ if (add_ref) {
+ Z_ADDREF_P(z);
+ }
+ if (Z_TYPE_P(z) != type) {
+ switch (type) {
+ case IS_NULL: convert_to_null_ex(&z); break;
+ case IS_BOOL: convert_to_boolean_ex(&z); break;
+ case IS_LONG: convert_to_long_ex(&z); break;
+ case IS_DOUBLE: convert_to_double_ex(&z); break;
+ case IS_STRING: convert_to_string_ex(&z); break;
+ case IS_ARRAY: convert_to_array_ex(&z); break;
+ case IS_OBJECT: convert_to_object_ex(&z); break;
+ }
+ } else {
+ SEPARATE_ZVAL_IF_NOT_REF(&z);
+ }
+ return z;
+}
+
+static inline STATUS php_http_ini_entry(const char *name_str, size_t name_len, const char **value_str, size_t *value_len, zend_bool orig TSRMLS_DC)
+{
+ zend_ini_entry *ini_entry;
+
+ if (SUCCESS == zend_hash_find(EG(ini_directives), name_str, name_len + 1, (void *) &ini_entry)) {
+ if (orig && ini_entry->modified) {
+ *value_str = ini_entry->orig_value;
+ *value_len = (size_t) ini_entry->orig_value_length;
+ } else {
+ *value_str = ini_entry->value;
+ *value_len = (size_t) ini_entry->value_length;
+ }
+ return SUCCESS;
+ }
+ return FAILURE;
+}