PHP_6: updated support
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@504 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
parent
5b6d472b1d
commit
b36dbed007
|
@ -65,7 +65,7 @@ static void xc_dasm(zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */
|
|||
keysize ++;
|
||||
}
|
||||
}
|
||||
add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), buf, b->nKeyLength, zv);
|
||||
add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), ZSTR(buf), b->nKeyLength, zv);
|
||||
}
|
||||
efree(buf);
|
||||
add_assoc_zval_ex(dst, ZEND_STRS("class_table"), list);
|
||||
|
|
|
@ -59,7 +59,7 @@ define(`DEF_HASH_TABLE_FUNC', `
|
|||
keysize ++;
|
||||
}
|
||||
}
|
||||
add_u_assoc_zval_ex(dst, BUCKET_KEY_TYPE(b), buf, keysize, zv);
|
||||
add_u_assoc_zval_ex(dst, BUCKET_KEY_TYPE(b), ZSTR(buf), keysize, zv);
|
||||
}
|
||||
')
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ define(`PROC_CLASS_ENTRY_P_EX', `
|
|||
if ($2) {
|
||||
IFSTORE(`$1 = (zend_class_entry *) xc_get_class_num(processor, $2);')
|
||||
IFRESTORE(`$1 = xc_get_class(processor, (zend_ulong) $2);')
|
||||
IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, strlen($2->name), 1);')
|
||||
IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);')
|
||||
}
|
||||
else {
|
||||
COPYNULL_EX(`$1', `$3')
|
||||
|
|
|
@ -56,9 +56,7 @@ dnl }}}
|
|||
dnl {{{ zend_brk_cont_element
|
||||
DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `
|
||||
#ifdef ZEND_ENGINE_2_2
|
||||
#ifndef IS_UNICODE
|
||||
DISPATCH(int, start)
|
||||
#endif
|
||||
#endif
|
||||
DISPATCH(int, cont)
|
||||
DISPATCH(int, brk)
|
||||
|
@ -282,7 +280,7 @@ DEF_STRUCT_P_FUNC(`zend_property_info', , `
|
|||
PROC_ZSTRING_L(, doc_comment, doc_comment_len)
|
||||
#endif
|
||||
dnl isnt in php6 yet
|
||||
#if defined(ZEND_ENGINE_2_2) && !defined(IS_UNICODE)
|
||||
#if defined(ZEND_ENGINE_2_2)
|
||||
PROC_CLASS_ENTRY_P(ce)
|
||||
#endif
|
||||
')
|
||||
|
|
|
@ -38,7 +38,7 @@ define(`PROC_STRING_N_EX', `
|
|||
int usecopy;
|
||||
|
||||
INIT_ZVAL(zv);
|
||||
ZVAL_UNICODEL(&zv, (UChar *) ($2), $3 - 1, 1);
|
||||
ZVAL_UNICODEL(&zv, ZSTR_U($2), $3 - 1, 1);
|
||||
zend_make_printable_zval(&zv, &reszv, &usecopy);
|
||||
fprintf(stderr, "string:%s:\t\"", "$1");
|
||||
xc_dprint_str_len(Z_STRVAL(reszv), Z_STRLEN(reszv));
|
||||
|
@ -63,11 +63,16 @@ define(`PROC_STRING_N_EX', `
|
|||
')
|
||||
FIXPOINTER_EX(`PTRTYPE', DSTPTR)
|
||||
IFDASM(`
|
||||
ifelse(STRTYPE,zstr_uchar, `
|
||||
add_assoc_unicodel_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
|
||||
', ` dnl else
|
||||
add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);')
|
||||
ifelse(STRTYPE,zstr_uchar, `
|
||||
add_assoc_unicodel_ex(dst, ZEND_STRS("$4"), ZSTR_U($2), $3-1, 1);
|
||||
', ` dnl else
|
||||
ifelse(STRTYPE,zstr_char, `
|
||||
add_assoc_stringl_ex(dst, ZEND_STRS("$4"), ZSTR_S($2), $3-1, 1);
|
||||
', `
|
||||
add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
|
||||
')
|
||||
')
|
||||
')
|
||||
}
|
||||
popdef(`DSTPTR')
|
||||
popdef(`SRCPTR')
|
||||
|
|
13
utils.c
13
utils.c
|
@ -583,15 +583,6 @@ static int xc_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC) /* {{{ */
|
|||
/* }}} */
|
||||
#endif
|
||||
|
||||
void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce))
|
||||
{
|
||||
#ifdef ZEND_ENGINE_2
|
||||
(*ce)->refcount++;
|
||||
#else
|
||||
(*ce->refcount)++;
|
||||
#endif
|
||||
}
|
||||
|
||||
xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
HashTable *h;
|
||||
|
@ -634,7 +625,7 @@ xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /
|
|||
zend_hash_init_ex(&TG(function_table), 128, NULL, h->pDestructor, h->persistent, h->bApplyProtection);
|
||||
{
|
||||
zend_function tmp_func;
|
||||
zend_hash_copy(&TG(function_table), &XG(internal_function_table), (copy_ctor_func_t) function_add_ref, (void *) &tmp_func, sizeof(tmp_func));
|
||||
zend_hash_copy(&TG(function_table), &XG(internal_function_table), NULL, (void *) &tmp_func, sizeof(tmp_func));
|
||||
}
|
||||
TG(internal_function_tail) = TG(function_table).pListTail;
|
||||
|
||||
|
@ -643,7 +634,7 @@ xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /
|
|||
#if 0 && TODO
|
||||
{
|
||||
xc_cest_t tmp_cest;
|
||||
zend_hash_copy(&TG(class_table), &XG(internal_class_table), (copy_ctor_func_t) xc_zend_class_add_ref, (void *) &tmp_cest, sizeof(tmp_cest));
|
||||
zend_hash_copy(&TG(class_table), &XG(internal_class_table), NULL, (void *) &tmp_cest, sizeof(tmp_cest));
|
||||
}
|
||||
#endif
|
||||
TG(internal_class_tail) = TG(class_table).pListTail;
|
||||
|
|
8
xcache.c
8
xcache.c
|
@ -1719,11 +1719,11 @@ static void xc_request_init(TSRMLS_D) /* {{{ */
|
|||
zend_hash_destroy(&XG(internal_function_table));
|
||||
zend_hash_destroy(&XG(internal_class_table));
|
||||
|
||||
zend_hash_init_ex(&XG(internal_function_table), 100, NULL, CG(function_table)->pDestructor, 1, 0);
|
||||
zend_hash_init_ex(&XG(internal_class_table), 10, NULL, CG(class_table)->pDestructor, 1, 0);
|
||||
zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0);
|
||||
zend_hash_init_ex(&XG(internal_class_table), 10, NULL, NULL, 1, 0);
|
||||
|
||||
zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func));
|
||||
zend_hash_copy(&XG(internal_class_table), CG(class_table), (copy_ctor_func_t) xc_zend_class_add_ref, &tmp_cest, sizeof(tmp_cest));
|
||||
zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func));
|
||||
zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest));
|
||||
|
||||
XG(internal_table_copied) = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue