mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action. The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465 The action reports that the changes in this PR would make it happy: jsoref@602417c Closes GH-6822.
This commit is contained in:
parent
02557e62c9
commit
462da6e09c
106 changed files with 248 additions and 245 deletions
|
@ -3,7 +3,7 @@
|
||||||
This file lists several standards that any programmer adding or changing code in
|
This file lists several standards that any programmer adding or changing code in
|
||||||
PHP should follow. Since this file was added at a very late stage of the
|
PHP should follow. Since this file was added at a very late stage of the
|
||||||
development of PHP v3.0, the code base does not fully follow it, but new
|
development of PHP v3.0, the code base does not fully follow it, but new
|
||||||
features are going in that general direction. Many sections have been recoded to
|
features are going in that general direction. Many sections have been rewritten to
|
||||||
use these rules.
|
use these rules.
|
||||||
|
|
||||||
## Code implementation
|
## Code implementation
|
||||||
|
|
2
NEWS
2
NEWS
|
@ -78,7 +78,7 @@ PHP NEWS
|
||||||
- MySQLnd:
|
- MySQLnd:
|
||||||
. Fixed bug #80761 (PDO uses too much memory). (Nikita)
|
. Fixed bug #80761 (PDO uses too much memory). (Nikita)
|
||||||
|
|
||||||
- Opcache:
|
- OPcache:
|
||||||
. Added inheritance cache. (Dmitry)
|
. Added inheritance cache. (Dmitry)
|
||||||
|
|
||||||
- OpenSSL:
|
- OpenSSL:
|
||||||
|
|
|
@ -254,7 +254,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Different identity, we need a new impersontated token as well */
|
/* Different identity, we need a new impersonated token as well */
|
||||||
if (!TWG(impersonation_token_sid) || !EqualSid(token_sid, TWG(impersonation_token_sid))) {
|
if (!TWG(impersonation_token_sid) || !EqualSid(token_sid, TWG(impersonation_token_sid))) {
|
||||||
if (TWG(impersonation_token_sid)) {
|
if (TWG(impersonation_token_sid)) {
|
||||||
free(TWG(impersonation_token_sid));
|
free(TWG(impersonation_token_sid));
|
||||||
|
|
|
@ -113,12 +113,12 @@ PHP 8.1 UPGRADE NOTES
|
||||||
- PDO SQLite:
|
- PDO SQLite:
|
||||||
. Integers and floats in results sets will now be returned using native PHP
|
. Integers and floats in results sets will now be returned using native PHP
|
||||||
types. You can restore the previous behavior by enabling the
|
types. You can restore the previous behavior by enabling the
|
||||||
PDO::ATTR_STRINGFIY_FETCHES option.
|
PDO::ATTR_STRINGIFY_FETCHES option.
|
||||||
|
|
||||||
- Standard:
|
- Standard:
|
||||||
. version_compare() no longer accepts undocumented operator abbreviations.
|
. version_compare() no longer accepts undocumented operator abbreviations.
|
||||||
. htmlspecialchars(), htmlentities(), htmlspecialchars_decode(),
|
. htmlspecialchars(), htmlentities(), htmlspecialchars_decode(),
|
||||||
html_entitity_decode() and get_html_translation_table() now use
|
html_entity_decode() and get_html_translation_table() now use
|
||||||
ENT_QUOTES | ENT_SUBSTITUTE rather than ENT_COMPAT by default. This means
|
ENT_QUOTES | ENT_SUBSTITUTE rather than ENT_COMPAT by default. This means
|
||||||
that ' is escaped to ' while previously it was left alone.
|
that ' is escaped to ' while previously it was left alone.
|
||||||
Additionally, malformed UTF-8 will be replaced by a Unicode substitution
|
Additionally, malformed UTF-8 will be replaced by a Unicode substitution
|
||||||
|
@ -187,7 +187,7 @@ PHP 8.1 UPGRADE NOTES
|
||||||
echo $h, "\n";
|
echo $h, "\n";
|
||||||
```
|
```
|
||||||
|
|
||||||
A valid seed value is within the range from 0 to the plaform defined UINT_MAX, usually 4294967295.
|
A valid seed value is within the range from 0 to the platform defined UINT_MAX, usually 4294967295.
|
||||||
|
|
||||||
. Added xxHash. The implementation brings in the following arguments
|
. Added xxHash. The implementation brings in the following arguments
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ PHP 8.1 UPGRADE NOTES
|
||||||
etc. was changed. Now properties are naturally ordered according to their
|
etc. was changed. Now properties are naturally ordered according to their
|
||||||
declaration and inheritance. Properties declared in a base class are going
|
declaration and inheritance. Properties declared in a base class are going
|
||||||
to be before the child properties. This order is consistent with internal
|
to be before the child properties. This order is consistent with internal
|
||||||
layout of properies in zend_objct structure and repeats the order in
|
layout of properties in zend_object structure and repeats the order in
|
||||||
default_properties_table[] and properties_info_table[]. The old order was
|
default_properties_table[] and properties_info_table[]. The old order was
|
||||||
not documented and was caused by class inheritance implementation details.
|
not documented and was caused by class inheritance implementation details.
|
||||||
|
|
||||||
|
|
|
@ -1458,7 +1458,7 @@ static void zend_jmp_optimization(zend_basic_block *block, zend_op_array *op_arr
|
||||||
/* is not used on the following path and */
|
/* is not used on the following path and */
|
||||||
/* should be used once on the branch path. */
|
/* should be used once on the branch path. */
|
||||||
/* */
|
/* */
|
||||||
/* The pattern works well only if jums processed in */
|
/* The pattern works well only if jumps processed in */
|
||||||
/* direct order, otherwise it breaks JMPZ_EX */
|
/* direct order, otherwise it breaks JMPZ_EX */
|
||||||
/* sequences too early. */
|
/* sequences too early. */
|
||||||
last_op->result.var = target->result.var;
|
last_op->result.var = target->result.var;
|
||||||
|
|
|
@ -541,7 +541,7 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, bool reorder_d
|
||||||
}
|
}
|
||||||
} FOREACH_PHI_END();
|
} FOREACH_PHI_END();
|
||||||
|
|
||||||
/* Mark reacable instruction without side effects as dead */
|
/* Mark reachable instruction without side effects as dead */
|
||||||
int b = ssa->cfg.blocks_count;
|
int b = ssa->cfg.blocks_count;
|
||||||
while (b > 0) {
|
while (b > 0) {
|
||||||
int op_data = -1;
|
int op_data = -1;
|
||||||
|
|
|
@ -111,7 +111,7 @@ constant_binary_op:
|
||||||
|| opline->extended_value == ZEND_DIV
|
|| opline->extended_value == ZEND_DIV
|
||||||
|| opline->extended_value == ZEND_POW) {
|
|| opline->extended_value == ZEND_POW) {
|
||||||
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
|
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
|
||||||
/* don't optimise if it should produce a runtime numeric string error */
|
/* don't optimize if it should produce a runtime numeric string error */
|
||||||
if (is_numeric_string(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), NULL, NULL, 0)) {
|
if (is_numeric_string(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), NULL, NULL, 0)) {
|
||||||
convert_scalar_to_number(&ZEND_OP2_LITERAL(opline));
|
convert_scalar_to_number(&ZEND_OP2_LITERAL(opline));
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ constant_binary_op:
|
||||||
|| opline->extended_value == ZEND_SL
|
|| opline->extended_value == ZEND_SL
|
||||||
|| opline->extended_value == ZEND_SR) {
|
|| opline->extended_value == ZEND_SR) {
|
||||||
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) != IS_LONG) {
|
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) != IS_LONG) {
|
||||||
/* don't optimise if it should produce a runtime numeric string error */
|
/* don't optimize if it should produce a runtime numeric string error */
|
||||||
if (!(Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING
|
if (!(Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING
|
||||||
&& !is_numeric_string(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), NULL, NULL, 0))) {
|
&& !is_numeric_string(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), NULL, NULL, 0))) {
|
||||||
convert_to_long(&ZEND_OP2_LITERAL(opline));
|
convert_to_long(&ZEND_OP2_LITERAL(opline));
|
||||||
|
@ -311,7 +311,7 @@ constant_binary_op:
|
||||||
}
|
}
|
||||||
if (send1_opline->opcode != ZEND_SEND_VAL ||
|
if (send1_opline->opcode != ZEND_SEND_VAL ||
|
||||||
send1_opline->op1_type != IS_CONST) {
|
send1_opline->op1_type != IS_CONST) {
|
||||||
/* don't colllect constants after unknown function call */
|
/* don't collect constants after unknown function call */
|
||||||
collect_constants = 0;
|
collect_constants = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ constant_binary_op:
|
||||||
}
|
}
|
||||||
if (send1_opline->opcode != ZEND_SEND_VAL ||
|
if (send1_opline->opcode != ZEND_SEND_VAL ||
|
||||||
send1_opline->op1_type != IS_CONST) {
|
send1_opline->op1_type != IS_CONST) {
|
||||||
/* don't colllect constants after unknown function call */
|
/* don't collect constants after unknown function call */
|
||||||
collect_constants = 0;
|
collect_constants = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ constant_binary_op:
|
||||||
if (init_opline->opcode != ZEND_INIT_FCALL ||
|
if (init_opline->opcode != ZEND_INIT_FCALL ||
|
||||||
init_opline->op2_type != IS_CONST ||
|
init_opline->op2_type != IS_CONST ||
|
||||||
Z_TYPE(ZEND_OP2_LITERAL(init_opline)) != IS_STRING) {
|
Z_TYPE(ZEND_OP2_LITERAL(init_opline)) != IS_STRING) {
|
||||||
/* don't colllect constants after unknown function call */
|
/* don't collect constants after unknown function call */
|
||||||
collect_constants = 0;
|
collect_constants = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +504,7 @@ constant_binary_op:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* don't colllect constants after any other function call */
|
/* don't collect constants after any other function call */
|
||||||
collect_constants = 0;
|
collect_constants = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,7 @@ void zend_optimizer_pass3(zend_op_array *op_array, zend_optimizer_ctx *ctx)
|
||||||
/* is not used on the following path and */
|
/* is not used on the following path and */
|
||||||
/* should be used once on the branch path. */
|
/* should be used once on the branch path. */
|
||||||
/* */
|
/* */
|
||||||
/* The pattern works well only if jums processed in */
|
/* The pattern works well only if jumps processed in */
|
||||||
/* direct order, otherwise it breaks JMPZ_EX */
|
/* direct order, otherwise it breaks JMPZ_EX */
|
||||||
/* sequences too early. */
|
/* sequences too early. */
|
||||||
opline->result.var = target->result.var;
|
opline->result.var = target->result.var;
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct _zend_call_info {
|
||||||
struct _zend_func_info {
|
struct _zend_func_info {
|
||||||
int num;
|
int num;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
zend_ssa ssa; /* Static Single Assignmnt Form */
|
zend_ssa ssa; /* Static Single Assignment Form */
|
||||||
zend_call_info *caller_info; /* where this function is called from */
|
zend_call_info *caller_info; /* where this function is called from */
|
||||||
zend_call_info *callee_info; /* which functions are called from this one */
|
zend_call_info *callee_info; /* which functions are called from this one */
|
||||||
zend_call_info **call_map; /* Call info associated with init/call/send opnum */
|
zend_call_info **call_map; /* Call info associated with init/call/send opnum */
|
||||||
|
|
|
@ -926,7 +926,7 @@ ZEND_API void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_fl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (func_flags & ZEND_FUNC_IRREDUCIBLE) {
|
if (func_flags & ZEND_FUNC_IRREDUCIBLE) {
|
||||||
fprintf(stderr, ", irreducable");
|
fprintf(stderr, ", irreducible");
|
||||||
}
|
}
|
||||||
if (func_flags & ZEND_FUNC_NO_LOOPS) {
|
if (func_flags & ZEND_FUNC_NO_LOOPS) {
|
||||||
fprintf(stderr, ", no_loops");
|
fprintf(stderr, ", no_loops");
|
||||||
|
|
|
@ -3790,7 +3790,7 @@ static bool is_effective_op2_double_cast(zend_op *opline, zval *op1) {
|
||||||
* E.g. 0+$i and 0.0+$i only differ by that cast. If then the consuming instruction of this
|
* E.g. 0+$i and 0.0+$i only differ by that cast. If then the consuming instruction of this
|
||||||
* result will perform a double cast anyway, the conversion is safe.
|
* result will perform a double cast anyway, the conversion is safe.
|
||||||
*
|
*
|
||||||
* The checks happens recursively, while keeping track of which variables are already visisted to
|
* The checks happens recursively, while keeping track of which variables are already visited to
|
||||||
* avoid infinite loops. An iterative, worklist driven approach would be possible, but the state
|
* avoid infinite loops. An iterative, worklist driven approach would be possible, but the state
|
||||||
* management more cumbersome to implement, so we don't bother for now.
|
* management more cumbersome to implement, so we don't bother for now.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -113,7 +113,7 @@ zend_function *zend_optimizer_get_called_func(
|
||||||
uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args);
|
uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args);
|
||||||
void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, zend_op *opline);
|
void zend_optimizer_migrate_jump(zend_op_array *op_array, zend_op *new_opline, zend_op *opline);
|
||||||
void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_t *shiftlist);
|
void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_t *shiftlist);
|
||||||
int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_arrya, zend_ssa *ssa, zend_call_info **call_map);
|
int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zend_ssa *ssa, zend_call_info **call_map);
|
||||||
int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, bool reorder_dtor_effects);
|
int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, bool reorder_dtor_effects);
|
||||||
int zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa);
|
int zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa);
|
||||||
|
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
list(&$foo) = [42];
|
list(&$foo) = [42];
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Fatal error: Cannot assign reference to non referencable value in %s on line %d
|
Fatal error: Cannot assign reference to non referenceable value in %s on line %d
|
||||||
|
|
|
@ -6,4 +6,4 @@ const FOO = 10;
|
||||||
[&$f] = FOO;
|
[&$f] = FOO;
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Fatal error: Cannot assign reference to non referencable value in %s on line %d
|
Fatal error: Cannot assign reference to non referenceable value in %s on line %d
|
||||||
|
|
|
@ -7,4 +7,4 @@ list(&$GLOBALS) = [1];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Fatal error: Cannot assign reference to non referencable value in %s on line %d
|
Fatal error: Cannot assign reference to non referenceable value in %s on line %d
|
||||||
|
|
|
@ -931,7 +931,7 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
|
||||||
#endif
|
#endif
|
||||||
# if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR
|
# if ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR
|
||||||
/* Create a map region, used for indirect pointers from shared to
|
/* Create a map region, used for indirect pointers from shared to
|
||||||
* process memory. It's allocatred once and never resized.
|
* process memory. It's allocated once and never resized.
|
||||||
* All processes must map it into the same address space.
|
* All processes must map it into the same address space.
|
||||||
*/
|
*/
|
||||||
CG(map_ptr_size) = 1024 * 1024; // TODO: initial size ???
|
CG(map_ptr_size) = 1024 * 1024; // TODO: initial size ???
|
||||||
|
@ -1374,8 +1374,8 @@ static ZEND_COLD void zend_error_impl(
|
||||||
ZVAL_COPY_VALUE(&orig_user_error_handler, &EG(user_error_handler));
|
ZVAL_COPY_VALUE(&orig_user_error_handler, &EG(user_error_handler));
|
||||||
ZVAL_UNDEF(&EG(user_error_handler));
|
ZVAL_UNDEF(&EG(user_error_handler));
|
||||||
|
|
||||||
/* User error handler may include() additinal PHP files.
|
/* User error handler may include() additional PHP files.
|
||||||
* If an error was generated during comilation PHP will compile
|
* If an error was generated during compilation PHP will compile
|
||||||
* such scripts recursively, but some CG() variables may be
|
* such scripts recursively, but some CG() variables may be
|
||||||
* inconsistent. */
|
* inconsistent. */
|
||||||
|
|
||||||
|
|
|
@ -2900,7 +2900,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
|
||||||
zend_unregister_ini_entries(module->module_number);
|
zend_unregister_ini_entries(module->module_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deinitilaise module globals */
|
/* Deinitialize module globals */
|
||||||
if (module->globals_size) {
|
if (module->globals_size) {
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
if (*module->globals_id_ptr) {
|
if (*module->globals_id_ptr) {
|
||||||
|
|
|
@ -590,7 +590,7 @@ ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, bool free_mem);
|
||||||
*/
|
*/
|
||||||
ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, uint32_t *param_count, zval **params);
|
ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, uint32_t *param_count, zval **params);
|
||||||
|
|
||||||
/** Free arguments connected with zend_fcall_info *fci andset back saved ones.
|
/** Free arguments connected with zend_fcall_info *fci and set back saved ones.
|
||||||
*/
|
*/
|
||||||
ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_count, zval *params);
|
ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, uint32_t param_count, zval *params);
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ int zend_mm_use_huge_pages = 0;
|
||||||
* free_tail - number of continuous free pages at the end of chunk
|
* free_tail - number of continuous free pages at the end of chunk
|
||||||
*
|
*
|
||||||
* free_map - bitset (a bit for each page). The bit is set if the corresponding
|
* free_map - bitset (a bit for each page). The bit is set if the corresponding
|
||||||
* page is allocated. Allocator for "lage sizes" may easily find a
|
* page is allocated. Allocator for "large sizes" may easily find a
|
||||||
* free page (or a continuous number of pages) searching for zero
|
* free page (or a continuous number of pages) searching for zero
|
||||||
* bits.
|
* bits.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1936,7 +1936,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||||
_zend_hash_append_ex(stack_frame, ZSTR_KNOWN(ZEND_STR_LINE), &tmp, 1);
|
_zend_hash_append_ex(stack_frame, ZSTR_KNOWN(ZEND_STR_LINE), &tmp, 1);
|
||||||
|
|
||||||
/* try to fetch args only if an FCALL was just made - elsewise we're in the middle of a function
|
/* try to fetch args only if an FCALL was just made - elsewise we're in the middle of a function
|
||||||
* and debug_baktrace() might have been called by the error_handler. in this case we don't
|
* and debug_backtrace() might have been called by the error_handler. in this case we don't
|
||||||
* want to pop anything of the argument-stack */
|
* want to pop anything of the argument-stack */
|
||||||
} else {
|
} else {
|
||||||
zend_execute_data *prev_call = skip;
|
zend_execute_data *prev_call = skip;
|
||||||
|
|
|
@ -586,7 +586,7 @@ static int zend_add_ns_func_name_literal(zend_string *name) /* {{{ */
|
||||||
zend_string *lc_name = zend_string_tolower(name);
|
zend_string *lc_name = zend_string_tolower(name);
|
||||||
zend_add_literal_string(&lc_name);
|
zend_add_literal_string(&lc_name);
|
||||||
|
|
||||||
/* Lowercased unqualfied name */
|
/* Lowercased unqualified name */
|
||||||
if (zend_get_unqualified_name(name, &unqualified_name, &unqualified_name_len)) {
|
if (zend_get_unqualified_name(name, &unqualified_name, &unqualified_name_len)) {
|
||||||
lc_name = zend_string_alloc(unqualified_name_len, 0);
|
lc_name = zend_string_alloc(unqualified_name_len, 0);
|
||||||
zend_str_tolower_copy(ZSTR_VAL(lc_name), unqualified_name, unqualified_name_len);
|
zend_str_tolower_copy(ZSTR_VAL(lc_name), unqualified_name, unqualified_name_len);
|
||||||
|
@ -715,7 +715,7 @@ void zend_do_free(znode *op1) /* {{{ */
|
||||||
switch (opline->opcode) {
|
switch (opline->opcode) {
|
||||||
case ZEND_BOOL:
|
case ZEND_BOOL:
|
||||||
case ZEND_BOOL_NOT:
|
case ZEND_BOOL_NOT:
|
||||||
/* boolean resuls don't have to be freed */
|
/* boolean results don't have to be freed */
|
||||||
return;
|
return;
|
||||||
case ZEND_POST_INC_STATIC_PROP:
|
case ZEND_POST_INC_STATIC_PROP:
|
||||||
case ZEND_POST_DEC_STATIC_PROP:
|
case ZEND_POST_DEC_STATIC_PROP:
|
||||||
|
@ -3234,7 +3234,7 @@ void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */
|
||||||
if (zend_propagate_list_refs(var_ast)) {
|
if (zend_propagate_list_refs(var_ast)) {
|
||||||
if (!zend_is_variable_or_call(expr_ast)) {
|
if (!zend_is_variable_or_call(expr_ast)) {
|
||||||
zend_error_noreturn(E_COMPILE_ERROR,
|
zend_error_noreturn(E_COMPILE_ERROR,
|
||||||
"Cannot assign reference to non referencable value");
|
"Cannot assign reference to non referenceable value");
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1);
|
zend_compile_var(&expr_node, expr_ast, BP_VAR_W, 1);
|
||||||
|
|
|
@ -233,7 +233,7 @@ typedef struct _zend_oparray_context {
|
||||||
/* op_array or class is preloaded | | | */
|
/* op_array or class is preloaded | | | */
|
||||||
#define ZEND_ACC_PRELOADED (1 << 10) /* X | X | | */
|
#define ZEND_ACC_PRELOADED (1 << 10) /* X | X | | */
|
||||||
/* | | | */
|
/* | | | */
|
||||||
/* Flag to differenciate cases from constants. | | | */
|
/* Flag to differentiate cases from constants. | | | */
|
||||||
/* Stored in Z_ACCESS_FLAGS, must not conflict with | | | */
|
/* Stored in Z_ACCESS_FLAGS, must not conflict with | | | */
|
||||||
/* ZEND_ACC_ visibility flags or IS_CONSTANT_VISITED_MARK | | | */
|
/* ZEND_ACC_ visibility flags or IS_CONSTANT_VISITED_MARK | | | */
|
||||||
#define ZEND_CLASS_CONST_IS_CASE (1 << 6) /* | | | X */
|
#define ZEND_CLASS_CONST_IS_CASE (1 << 6) /* | | | X */
|
||||||
|
@ -1103,7 +1103,7 @@ END_EXTERN_C()
|
||||||
#define ZEND_COMPILE_EXTENDED_FCALL (1<<1)
|
#define ZEND_COMPILE_EXTENDED_FCALL (1<<1)
|
||||||
#define ZEND_COMPILE_EXTENDED_INFO (ZEND_COMPILE_EXTENDED_STMT|ZEND_COMPILE_EXTENDED_FCALL)
|
#define ZEND_COMPILE_EXTENDED_INFO (ZEND_COMPILE_EXTENDED_STMT|ZEND_COMPILE_EXTENDED_FCALL)
|
||||||
|
|
||||||
/* call op_array handler of extendions */
|
/* call op_array handler of extensions */
|
||||||
#define ZEND_COMPILE_HANDLE_OP_ARRAY (1<<2)
|
#define ZEND_COMPILE_HANDLE_OP_ARRAY (1<<2)
|
||||||
|
|
||||||
/* generate ZEND_INIT_FCALL_BY_NAME for internal functions instead of ZEND_INIT_FCALL */
|
/* generate ZEND_INIT_FCALL_BY_NAME for internal functions instead of ZEND_INIT_FCALL */
|
||||||
|
@ -1111,7 +1111,7 @@ END_EXTERN_C()
|
||||||
|
|
||||||
/* don't perform early binding for classes inherited form internal ones;
|
/* don't perform early binding for classes inherited form internal ones;
|
||||||
* in namespaces assume that internal class that doesn't exist at compile-time
|
* in namespaces assume that internal class that doesn't exist at compile-time
|
||||||
* may apper in run-time */
|
* may appear in run-time */
|
||||||
#define ZEND_COMPILE_IGNORE_INTERNAL_CLASSES (1<<4)
|
#define ZEND_COMPILE_IGNORE_INTERNAL_CLASSES (1<<4)
|
||||||
|
|
||||||
/* generate ZEND_DECLARE_CLASS_DELAYED opcode to delay early binding */
|
/* generate ZEND_DECLARE_CLASS_DELAYED opcode to delay early binding */
|
||||||
|
|
|
@ -85,7 +85,7 @@ ZEND_API void zend_register_string_constant(const char *name, size_t name_len, c
|
||||||
ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval, size_t strlen, int flags, int module_number);
|
ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval, size_t strlen, int flags, int module_number);
|
||||||
ZEND_API zend_result zend_register_constant(zend_constant *c);
|
ZEND_API zend_result zend_register_constant(zend_constant *c);
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
void zend_copy_constants(HashTable *target, HashTable *sourc);
|
void zend_copy_constants(HashTable *target, HashTable *source);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t name_len);
|
ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t name_len);
|
||||||
|
|
|
@ -53,7 +53,7 @@ static zend_object_handlers default_exception_handlers;
|
||||||
/* {{{ zend_implement_throwable */
|
/* {{{ zend_implement_throwable */
|
||||||
static int zend_implement_throwable(zend_class_entry *interface, zend_class_entry *class_type)
|
static int zend_implement_throwable(zend_class_entry *interface, zend_class_entry *class_type)
|
||||||
{
|
{
|
||||||
/* zend_ce_exception and zend_ce_error may not be initialized yet when this is caleld (e.g when
|
/* zend_ce_exception and zend_ce_error may not be initialized yet when this is called (e.g when
|
||||||
* implementing Throwable for Exception itself). Perform a manual inheritance check. */
|
* implementing Throwable for Exception itself). Perform a manual inheritance check. */
|
||||||
zend_class_entry *root = class_type;
|
zend_class_entry *root = class_type;
|
||||||
while (root->parent) {
|
while (root->parent) {
|
||||||
|
|
|
@ -174,7 +174,7 @@ struct _zend_vm_stack {
|
||||||
/*
|
/*
|
||||||
* In general in RELEASE build ZEND_ASSERT() must be zero-cost, but for some
|
* In general in RELEASE build ZEND_ASSERT() must be zero-cost, but for some
|
||||||
* reason, GCC generated worse code, performing CSE on assertion code and the
|
* reason, GCC generated worse code, performing CSE on assertion code and the
|
||||||
* following "slow path" and moving memory read operatins from slow path into
|
* following "slow path" and moving memory read operations from slow path into
|
||||||
* common header. This made a degradation for the fast path.
|
* common header. This made a degradation for the fast path.
|
||||||
* The following "#if ZEND_DEBUG" eliminates it.
|
* The following "#if ZEND_DEBUG" eliminates it.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -708,7 +708,7 @@ try_again:
|
||||||
orig_generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
orig_generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* If there are no more deletegated values, resume the generator
|
/* If there are no more delegated values, resume the generator
|
||||||
* after the "yield from" expression. */
|
* after the "yield from" expression. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ struct _zend_executor_globals {
|
||||||
|
|
||||||
zend_long assertions;
|
zend_long assertions;
|
||||||
|
|
||||||
uint32_t ht_iterators_count; /* number of allocatd slots */
|
uint32_t ht_iterators_count; /* number of allocated slots */
|
||||||
uint32_t ht_iterators_used; /* number of used slots */
|
uint32_t ht_iterators_used; /* number of used slots */
|
||||||
HashTableIterator *ht_iterators;
|
HashTableIterator *ht_iterators;
|
||||||
HashTableIterator ht_iterators_slots[16];
|
HashTableIterator ht_iterators_slots[16];
|
||||||
|
|
|
@ -1842,7 +1842,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_graceful_reverse_destroy(HashTable *ht)
|
||||||
* return codes are possible:
|
* return codes are possible:
|
||||||
* ZEND_HASH_APPLY_KEEP - continue
|
* ZEND_HASH_APPLY_KEEP - continue
|
||||||
* ZEND_HASH_APPLY_STOP - stop iteration
|
* ZEND_HASH_APPLY_STOP - stop iteration
|
||||||
* ZEND_HASH_APPLY_REMOVE - delete the element, combineable with the former
|
* ZEND_HASH_APPLY_REMOVE - delete the element, combinable with the former
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_func)
|
ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_func)
|
||||||
|
|
|
@ -297,7 +297,7 @@ static bool unlinked_instanceof(zend_class_entry *ce1, zend_class_entry *ce2) {
|
||||||
zend_class_entry *ce = zend_lookup_class_ex(
|
zend_class_entry *ce = zend_lookup_class_ex(
|
||||||
ce1->interface_names[i].name, ce1->interface_names[i].lc_name,
|
ce1->interface_names[i].name, ce1->interface_names[i].lc_name,
|
||||||
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
|
ZEND_FETCH_CLASS_ALLOW_UNLINKED | ZEND_FETCH_CLASS_NO_AUTOLOAD);
|
||||||
/* Avoid recursing if class implements ifself. */
|
/* Avoid recursing if class implements itself. */
|
||||||
if (ce && ce != ce1 && unlinked_instanceof(ce, ce2)) {
|
if (ce && ce != ce1 && unlinked_instanceof(ce, ce2)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1734,7 +1734,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
|
||||||
) {
|
) {
|
||||||
fn_copy = *fn;
|
fn_copy = *fn;
|
||||||
|
|
||||||
/* if it is 0, no modifieres has been changed */
|
/* if it is 0, no modifiers have been changed */
|
||||||
if (alias->modifiers) {
|
if (alias->modifiers) {
|
||||||
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags & ~ZEND_ACC_PPP_MASK);
|
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags & ~ZEND_ACC_PPP_MASK);
|
||||||
}
|
}
|
||||||
|
@ -1988,11 +1988,11 @@ static void zend_do_traits_method_binding(zend_class_entry *ce, zend_class_entry
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static zend_class_entry* find_first_definition(zend_class_entry *ce, zend_class_entry **traits, size_t current_trait, zend_string *prop_name, zend_class_entry *coliding_ce) /* {{{ */
|
static zend_class_entry* find_first_definition(zend_class_entry *ce, zend_class_entry **traits, size_t current_trait, zend_string *prop_name, zend_class_entry *colliding_ce) /* {{{ */
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (coliding_ce == ce) {
|
if (colliding_ce == ce) {
|
||||||
for (i = 0; i < current_trait; i++) {
|
for (i = 0; i < current_trait; i++) {
|
||||||
if (traits[i]
|
if (traits[i]
|
||||||
&& zend_hash_exists(&traits[i]->properties_info, prop_name)) {
|
&& zend_hash_exists(&traits[i]->properties_info, prop_name)) {
|
||||||
|
@ -2001,7 +2001,7 @@ static zend_class_entry* find_first_definition(zend_class_entry *ce, zend_class_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return coliding_ce;
|
return colliding_ce;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -2009,7 +2009,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
zend_property_info *property_info;
|
zend_property_info *property_info;
|
||||||
zend_property_info *coliding_prop;
|
zend_property_info *colliding_prop;
|
||||||
zend_property_info *new_prop;
|
zend_property_info *new_prop;
|
||||||
zend_string* prop_name;
|
zend_string* prop_name;
|
||||||
bool not_compatible;
|
bool not_compatible;
|
||||||
|
@ -2029,28 +2029,28 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
|
||||||
uint32_t flags = property_info->flags;
|
uint32_t flags = property_info->flags;
|
||||||
|
|
||||||
/* next: check for conflicts with current class */
|
/* next: check for conflicts with current class */
|
||||||
if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
|
if ((colliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
|
||||||
if ((coliding_prop->flags & ZEND_ACC_PRIVATE) && coliding_prop->ce != ce) {
|
if ((colliding_prop->flags & ZEND_ACC_PRIVATE) && colliding_prop->ce != ce) {
|
||||||
zend_hash_del(&ce->properties_info, prop_name);
|
zend_hash_del(&ce->properties_info, prop_name);
|
||||||
flags |= ZEND_ACC_CHANGED;
|
flags |= ZEND_ACC_CHANGED;
|
||||||
} else {
|
} else {
|
||||||
not_compatible = 1;
|
not_compatible = 1;
|
||||||
|
|
||||||
if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
if ((colliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))
|
||||||
== (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) &&
|
== (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) &&
|
||||||
property_types_compatible(property_info, coliding_prop) == INHERITANCE_SUCCESS
|
property_types_compatible(property_info, colliding_prop) == INHERITANCE_SUCCESS
|
||||||
) {
|
) {
|
||||||
/* the flags are identical, thus, the properties may be compatible */
|
/* the flags are identical, thus, the properties may be compatible */
|
||||||
zval *op1, *op2;
|
zval *op1, *op2;
|
||||||
zval op1_tmp, op2_tmp;
|
zval op1_tmp, op2_tmp;
|
||||||
|
|
||||||
if (flags & ZEND_ACC_STATIC) {
|
if (flags & ZEND_ACC_STATIC) {
|
||||||
op1 = &ce->default_static_members_table[coliding_prop->offset];
|
op1 = &ce->default_static_members_table[colliding_prop->offset];
|
||||||
op2 = &traits[i]->default_static_members_table[property_info->offset];
|
op2 = &traits[i]->default_static_members_table[property_info->offset];
|
||||||
ZVAL_DEINDIRECT(op1);
|
ZVAL_DEINDIRECT(op1);
|
||||||
ZVAL_DEINDIRECT(op2);
|
ZVAL_DEINDIRECT(op2);
|
||||||
} else {
|
} else {
|
||||||
op1 = &ce->default_properties_table[OBJ_PROP_TO_NUM(coliding_prop->offset)];
|
op1 = &ce->default_properties_table[OBJ_PROP_TO_NUM(colliding_prop->offset)];
|
||||||
op2 = &traits[i]->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)];
|
op2 = &traits[i]->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2079,7 +2079,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
|
||||||
if (not_compatible) {
|
if (not_compatible) {
|
||||||
zend_error_noreturn(E_COMPILE_ERROR,
|
zend_error_noreturn(E_COMPILE_ERROR,
|
||||||
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
|
"%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed",
|
||||||
ZSTR_VAL(find_first_definition(ce, traits, i, prop_name, coliding_prop->ce)->name),
|
ZSTR_VAL(find_first_definition(ce, traits, i, prop_name, colliding_prop->ce)->name),
|
||||||
ZSTR_VAL(property_info->ce->name),
|
ZSTR_VAL(property_info->ce->name),
|
||||||
ZSTR_VAL(prop_name),
|
ZSTR_VAL(prop_name),
|
||||||
ZSTR_VAL(ce->name));
|
ZSTR_VAL(ce->name));
|
||||||
|
@ -2122,7 +2122,7 @@ static void zend_do_bind_traits(zend_class_entry *ce, zend_class_entry **traits)
|
||||||
|
|
||||||
ZEND_ASSERT(ce->num_traits > 0);
|
ZEND_ASSERT(ce->num_traits > 0);
|
||||||
|
|
||||||
/* complete initialization of trait strutures in ce */
|
/* complete initialization of trait structures in ce */
|
||||||
zend_traits_init_trait_structures(ce, traits, &exclude_tables, &aliases);
|
zend_traits_init_trait_structures(ce, traits, &exclude_tables, &aliases);
|
||||||
|
|
||||||
/* first care about all methods to be flattened into the class */
|
/* first care about all methods to be flattened into the class */
|
||||||
|
@ -2136,7 +2136,7 @@ static void zend_do_bind_traits(zend_class_entry *ce, zend_class_entry **traits)
|
||||||
efree(exclude_tables);
|
efree(exclude_tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* then flatten the properties into it, to, mostly to notfiy developer about problems */
|
/* then flatten the properties into it, to, mostly to notify developer about problems */
|
||||||
zend_do_traits_property_binding(ce, traits);
|
zend_do_traits_property_binding(ce, traits);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
|
@ -250,8 +250,8 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
|
||||||
%type <ast> new_expr anonymous_class class_name class_name_reference simple_variable
|
%type <ast> new_expr anonymous_class class_name class_name_reference simple_variable
|
||||||
%type <ast> internal_functions_in_yacc
|
%type <ast> internal_functions_in_yacc
|
||||||
%type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name property_name
|
%type <ast> exit_expr scalar backticks_expr lexical_var function_call member_name property_name
|
||||||
%type <ast> variable_class_name dereferencable_scalar constant class_constant
|
%type <ast> variable_class_name dereferenceable_scalar constant class_constant
|
||||||
%type <ast> fully_dereferencable array_object_dereferencable
|
%type <ast> fully_dereferenceable array_object_dereferenceable
|
||||||
%type <ast> callable_expr callable_variable static_member new_variable
|
%type <ast> callable_expr callable_variable static_member new_variable
|
||||||
%type <ast> encaps_var encaps_var_offset isset_variables
|
%type <ast> encaps_var encaps_var_offset isset_variables
|
||||||
%type <ast> top_statement_list use_declarations const_list inner_statement_list if_stmt
|
%type <ast> top_statement_list use_declarations const_list inner_statement_list if_stmt
|
||||||
|
@ -1262,7 +1262,7 @@ ctor_arguments:
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
dereferencable_scalar:
|
dereferenceable_scalar:
|
||||||
T_ARRAY '(' array_pair_list ')' { $$ = $3; $$->attr = ZEND_ARRAY_SYNTAX_LONG; }
|
T_ARRAY '(' array_pair_list ')' { $$ = $3; $$->attr = ZEND_ARRAY_SYNTAX_LONG; }
|
||||||
| '[' array_pair_list ']' { $$ = $2; $$->attr = ZEND_ARRAY_SYNTAX_SHORT; }
|
| '[' array_pair_list ']' { $$ = $2; $$->attr = ZEND_ARRAY_SYNTAX_SHORT; }
|
||||||
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||||
|
@ -1276,7 +1276,7 @@ scalar:
|
||||||
| T_START_HEREDOC T_END_HEREDOC
|
| T_START_HEREDOC T_END_HEREDOC
|
||||||
{ $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
|
{ $$ = zend_ast_create_zval_from_str(ZSTR_EMPTY_ALLOC()); }
|
||||||
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
|
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; }
|
||||||
| dereferencable_scalar { $$ = $1; }
|
| dereferenceable_scalar { $$ = $1; }
|
||||||
| constant { $$ = $1; }
|
| constant { $$ = $1; }
|
||||||
| class_constant { $$ = $1; }
|
| class_constant { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
@ -1306,37 +1306,37 @@ optional_expr:
|
||||||
;
|
;
|
||||||
|
|
||||||
variable_class_name:
|
variable_class_name:
|
||||||
fully_dereferencable { $$ = $1; }
|
fully_dereferenceable { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
fully_dereferencable:
|
fully_dereferenceable:
|
||||||
variable { $$ = $1; }
|
variable { $$ = $1; }
|
||||||
| '(' expr ')' { $$ = $2; }
|
| '(' expr ')' { $$ = $2; }
|
||||||
| dereferencable_scalar { $$ = $1; }
|
| dereferenceable_scalar { $$ = $1; }
|
||||||
| class_constant { $$ = $1; }
|
| class_constant { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
array_object_dereferencable:
|
array_object_dereferenceable:
|
||||||
fully_dereferencable { $$ = $1; }
|
fully_dereferenceable { $$ = $1; }
|
||||||
| constant { $$ = $1; }
|
| constant { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
callable_expr:
|
callable_expr:
|
||||||
callable_variable { $$ = $1; }
|
callable_variable { $$ = $1; }
|
||||||
| '(' expr ')' { $$ = $2; }
|
| '(' expr ')' { $$ = $2; }
|
||||||
| dereferencable_scalar { $$ = $1; }
|
| dereferenceable_scalar { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
callable_variable:
|
callable_variable:
|
||||||
simple_variable
|
simple_variable
|
||||||
{ $$ = zend_ast_create(ZEND_AST_VAR, $1); }
|
{ $$ = zend_ast_create(ZEND_AST_VAR, $1); }
|
||||||
| array_object_dereferencable '[' optional_expr ']'
|
| array_object_dereferenceable '[' optional_expr ']'
|
||||||
{ $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
|
{ $$ = zend_ast_create(ZEND_AST_DIM, $1, $3); }
|
||||||
| array_object_dereferencable '{' expr '}'
|
| array_object_dereferenceable '{' expr '}'
|
||||||
{ $$ = zend_ast_create_ex(ZEND_AST_DIM, ZEND_DIM_ALTERNATIVE_SYNTAX, $1, $3); }
|
{ $$ = zend_ast_create_ex(ZEND_AST_DIM, ZEND_DIM_ALTERNATIVE_SYNTAX, $1, $3); }
|
||||||
| array_object_dereferencable T_OBJECT_OPERATOR property_name argument_list
|
| array_object_dereferenceable T_OBJECT_OPERATOR property_name argument_list
|
||||||
{ $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
|
{ $$ = zend_ast_create(ZEND_AST_METHOD_CALL, $1, $3, $4); }
|
||||||
| array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list
|
| array_object_dereferenceable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list
|
||||||
{ $$ = zend_ast_create(ZEND_AST_NULLSAFE_METHOD_CALL, $1, $3, $4); }
|
{ $$ = zend_ast_create(ZEND_AST_NULLSAFE_METHOD_CALL, $1, $3, $4); }
|
||||||
| function_call { $$ = $1; }
|
| function_call { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
@ -1346,9 +1346,9 @@ variable:
|
||||||
{ $$ = $1; }
|
{ $$ = $1; }
|
||||||
| static_member
|
| static_member
|
||||||
{ $$ = $1; }
|
{ $$ = $1; }
|
||||||
| array_object_dereferencable T_OBJECT_OPERATOR property_name
|
| array_object_dereferenceable T_OBJECT_OPERATOR property_name
|
||||||
{ $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
|
{ $$ = zend_ast_create(ZEND_AST_PROP, $1, $3); }
|
||||||
| array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name
|
| array_object_dereferenceable T_NULLSAFE_OBJECT_OPERATOR property_name
|
||||||
{ $$ = zend_ast_create(ZEND_AST_NULLSAFE_PROP, $1, $3); }
|
{ $$ = zend_ast_create(ZEND_AST_NULLSAFE_PROP, $1, $3); }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -742,7 +742,7 @@ found:
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (Z_PROP_FLAG_P(variable_ptr) == IS_PROP_UNINIT) {
|
if (Z_PROP_FLAG_P(variable_ptr) == IS_PROP_UNINIT) {
|
||||||
/* Writes to uninitializde typed properties bypass __set(). */
|
/* Writes to uninitialized typed properties bypass __set(). */
|
||||||
Z_PROP_FLAG_P(variable_ptr) = 0;
|
Z_PROP_FLAG_P(variable_ptr) = 0;
|
||||||
goto write_std_property;
|
goto write_std_property;
|
||||||
}
|
}
|
||||||
|
|
|
@ -716,7 +716,7 @@ try_again:
|
||||||
} else if (Z_OBJ_P(op)->properties == NULL
|
} else if (Z_OBJ_P(op)->properties == NULL
|
||||||
&& Z_OBJ_HT_P(op)->get_properties_for == NULL
|
&& Z_OBJ_HT_P(op)->get_properties_for == NULL
|
||||||
&& Z_OBJ_HT_P(op)->get_properties == zend_std_get_properties) {
|
&& Z_OBJ_HT_P(op)->get_properties == zend_std_get_properties) {
|
||||||
/* Optimized version without rebulding properties HashTable */
|
/* Optimized version without rebuilding properties HashTable */
|
||||||
HashTable *ht = zend_std_build_object_properties_array(Z_OBJ_P(op));
|
HashTable *ht = zend_std_build_object_properties_array(Z_OBJ_P(op));
|
||||||
OBJ_RELEASE(Z_OBJ_P(op));
|
OBJ_RELEASE(Z_OBJ_P(op));
|
||||||
ZVAL_ARR(op, ht);
|
ZVAL_ARR(op, ht);
|
||||||
|
@ -2965,7 +2965,7 @@ ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(zend_string *s1, zend_string *s2)
|
||||||
#else
|
#else
|
||||||
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
|
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
|
||||||
#endif
|
#endif
|
||||||
/* both values are integers overflown to the same side, and the
|
/* both values are integers overflowed to the same side, and the
|
||||||
* double comparison may have resulted in crucial accuracy lost */
|
* double comparison may have resulted in crucial accuracy lost */
|
||||||
goto string_cmp;
|
goto string_cmp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context);
|
||||||
static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
|
static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
|
||||||
|
|
||||||
#if defined(__CYGWIN__) || defined(__PASE__)
|
#if defined(__CYGWIN__) || defined(__PASE__)
|
||||||
/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */
|
/* Matches zend_execute_API.c; these platforms don't support ITIMER_PROF. */
|
||||||
#define TIMEOUT_SIG SIGALRM
|
#define TIMEOUT_SIG SIGALRM
|
||||||
#else
|
#else
|
||||||
#define TIMEOUT_SIG SIGPROF
|
#define TIMEOUT_SIG SIGPROF
|
||||||
|
@ -118,7 +118,7 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
|
||||||
} else { /* delay signal handling */
|
} else { /* delay signal handling */
|
||||||
SIGG(blocked) = 1; /* signal is blocked */
|
SIGG(blocked) = 1; /* signal is blocked */
|
||||||
|
|
||||||
if ((queue = SIGG(pavail))) { /* if none available it's simply forgotton */
|
if ((queue = SIGG(pavail))) { /* if none available it's simply forgotten */
|
||||||
SIGG(pavail) = queue->next;
|
SIGG(pavail) = queue->next;
|
||||||
queue->zend_signal.signo = signo;
|
queue->zend_signal.signo = signo;
|
||||||
queue->zend_signal.siginfo = siginfo;
|
queue->zend_signal.siginfo = siginfo;
|
||||||
|
|
|
@ -4214,7 +4214,7 @@ zend_dtoa
|
||||||
*
|
*
|
||||||
* Perhaps we should just compute leading 28 bits of S once
|
* Perhaps we should just compute leading 28 bits of S once
|
||||||
* and for all and pass them and a shift to quorem, so it
|
* and for all and pass them and a shift to quorem, so it
|
||||||
* can do shifts and ors to compute the numerator for q.
|
* can do shifts and ORs to compute the numerator for q.
|
||||||
*/
|
*/
|
||||||
i = dshift(S, s2);
|
i = dshift(S, s2);
|
||||||
b2 += i;
|
b2 += i;
|
||||||
|
|
|
@ -943,7 +943,7 @@ retry_reparse_tag_cloud:
|
||||||
if (i <= start + 1) {
|
if (i <= start + 1) {
|
||||||
j = start;
|
j = start;
|
||||||
} else {
|
} else {
|
||||||
/* some leading directories may be unaccessable */
|
/* some leading directories may be inaccessible */
|
||||||
j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL);
|
j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL);
|
||||||
if (j > start && j != (size_t)-1) {
|
if (j > start && j != (size_t)-1) {
|
||||||
path[j++] = DEFAULT_SLASH;
|
path[j++] = DEFAULT_SLASH;
|
||||||
|
|
|
@ -6139,7 +6139,7 @@ ZEND_VM_COLD_CONST_HANDLER(51, ZEND_CAST, CONST|TMP|VAR|CV, ANY, TYPE)
|
||||||
} else if (Z_OBJ_P(expr)->properties == NULL
|
} else if (Z_OBJ_P(expr)->properties == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
||||||
/* Optimized version without rebulding properties HashTable */
|
/* Optimized version without rebuilding properties HashTable */
|
||||||
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
||||||
} else {
|
} else {
|
||||||
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
||||||
|
|
|
@ -4764,7 +4764,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_H
|
||||||
} else if (Z_OBJ_P(expr)->properties == NULL
|
} else if (Z_OBJ_P(expr)->properties == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
||||||
/* Optimized version without rebulding properties HashTable */
|
/* Optimized version without rebuilding properties HashTable */
|
||||||
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
||||||
} else {
|
} else {
|
||||||
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
||||||
|
@ -18986,7 +18986,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPC
|
||||||
} else if (Z_OBJ_P(expr)->properties == NULL
|
} else if (Z_OBJ_P(expr)->properties == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
||||||
/* Optimized version without rebulding properties HashTable */
|
/* Optimized version without rebuilding properties HashTable */
|
||||||
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
||||||
} else {
|
} else {
|
||||||
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
||||||
|
@ -21601,7 +21601,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPC
|
||||||
} else if (Z_OBJ_P(expr)->properties == NULL
|
} else if (Z_OBJ_P(expr)->properties == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
||||||
/* Optimized version without rebulding properties HashTable */
|
/* Optimized version without rebuilding properties HashTable */
|
||||||
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
||||||
} else {
|
} else {
|
||||||
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
||||||
|
@ -38121,7 +38121,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCO
|
||||||
} else if (Z_OBJ_P(expr)->properties == NULL
|
} else if (Z_OBJ_P(expr)->properties == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
&& Z_OBJ_HT_P(expr)->get_properties_for == NULL
|
||||||
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
&& Z_OBJ_HT_P(expr)->get_properties == zend_std_get_properties) {
|
||||||
/* Optimized version without rebulding properties HashTable */
|
/* Optimized version without rebuilding properties HashTable */
|
||||||
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
ZVAL_ARR(result, zend_std_build_object_properties_array(Z_OBJ_P(expr)));
|
||||||
} else {
|
} else {
|
||||||
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
HashTable *obj_ht = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_ARRAY_CAST);
|
||||||
|
|
|
@ -62,7 +62,7 @@ rem set OPENSSL_CONF=%OPENSSLDIR%\openssl.cnf
|
||||||
set OPENSSL_CONF=
|
set OPENSSL_CONF=
|
||||||
rem set SSLEAY_CONF=
|
rem set SSLEAY_CONF=
|
||||||
|
|
||||||
rem prepare for Opcache
|
rem prepare for OPcache
|
||||||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M
|
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M
|
||||||
|
|
||||||
rem prepare for enchant
|
rem prepare for enchant
|
||||||
|
|
|
@ -8,7 +8,7 @@ To create such an extension, two things are required:
|
||||||
|
|
||||||
We will describe now how to create these and how to put things together.
|
We will describe now how to create these and how to put things together.
|
||||||
|
|
||||||
## Prepairing your system
|
## Preparing your system
|
||||||
|
|
||||||
While the result will run on any system, a developer's setup needs these tools:
|
While the result will run on any system, a developer's setup needs these tools:
|
||||||
|
|
||||||
|
|
|
@ -575,8 +575,8 @@ static void sapi_update_response_code(int ncode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* since zend_llist_del_element only remove one matched item once,
|
* since zend_llist_del_element only removes one matched item once,
|
||||||
* we should remove them by ourself
|
* we should remove them manually
|
||||||
*/
|
*/
|
||||||
static void sapi_remove_header(zend_llist *l, char *name, size_t len) {
|
static void sapi_remove_header(zend_llist *l, char *name, size_t len) {
|
||||||
sapi_header_struct *header;
|
sapi_header_struct *header;
|
||||||
|
|
|
@ -119,7 +119,7 @@ find_stack_direction ()
|
||||||
#endif /* STACK_DIRECTION == 0 */
|
#endif /* STACK_DIRECTION == 0 */
|
||||||
|
|
||||||
/* An "alloca header" is used to:
|
/* An "alloca header" is used to:
|
||||||
(a) chain together all alloca'ed blocks;
|
(a) chain together all alloca'd blocks;
|
||||||
(b) keep track of stack depth.
|
(b) keep track of stack depth.
|
||||||
|
|
||||||
It is very important that sizeof(header) agree with malloc
|
It is very important that sizeof(header) agree with malloc
|
||||||
|
@ -253,7 +253,7 @@ struct stack_segment_linkage
|
||||||
long ssusr1; /* Reserved for user. */
|
long ssusr1; /* Reserved for user. */
|
||||||
long ssusr2; /* Reserved for user. */
|
long ssusr2; /* Reserved for user. */
|
||||||
long sstpid; /* Process ID for pid based multi-tasking. */
|
long sstpid; /* Process ID for pid based multi-tasking. */
|
||||||
long ssgvup; /* Pointer to multitasking thread giveup. */
|
long ssgvup; /* Pointer to multitasking thread give up. */
|
||||||
long sscray[7]; /* Reserved for Cray Research. */
|
long sscray[7]; /* Reserved for Cray Research. */
|
||||||
long ssa0;
|
long ssa0;
|
||||||
long ssa1;
|
long ssa1;
|
||||||
|
|
|
@ -1032,7 +1032,7 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
|
||||||
val_len |= *p++;
|
val_len |= *p++;
|
||||||
}
|
}
|
||||||
if (UNEXPECTED(name_len + val_len > (unsigned int) (end - p))) {
|
if (UNEXPECTED(name_len + val_len > (unsigned int) (end - p))) {
|
||||||
/* Malformated request */
|
/* Malformed request */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
fcgi_hash_set(&req->env, FCGI_HASH_FUNC(p, name_len), (char*)p, name_len, (char*)p + name_len, val_len);
|
fcgi_hash_set(&req->env, FCGI_HASH_FUNC(p, name_len), (char*)p, name_len, (char*)p + name_len, val_len);
|
||||||
|
|
|
@ -25,21 +25,21 @@
|
||||||
#define OPTERRARG (3)
|
#define OPTERRARG (3)
|
||||||
|
|
||||||
// Print error message to stderr and return -2 to distinguish it from '?' command line option.
|
// Print error message to stderr and return -2 to distinguish it from '?' command line option.
|
||||||
static int php_opt_error(int argc, char * const *argv, int oint, int optchr, int err, int show_err) /* {{{ */
|
static int php_opt_error(int argc, char * const *argv, int optint, int optchr, int err, int show_err) /* {{{ */
|
||||||
{
|
{
|
||||||
if (show_err)
|
if (show_err)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error in argument %d, char %d: ", oint, optchr+1);
|
fprintf(stderr, "Error in argument %d, char %d: ", optint, optchr+1);
|
||||||
switch(err)
|
switch(err)
|
||||||
{
|
{
|
||||||
case OPTERRCOLON:
|
case OPTERRCOLON:
|
||||||
fprintf(stderr, ": in flags\n");
|
fprintf(stderr, ": in flags\n");
|
||||||
break;
|
break;
|
||||||
case OPTERRNF:
|
case OPTERRNF:
|
||||||
fprintf(stderr, "option not found %c\n", argv[oint][optchr]);
|
fprintf(stderr, "option not found %c\n", argv[optint][optchr]);
|
||||||
break;
|
break;
|
||||||
case OPTERRARG:
|
case OPTERRARG:
|
||||||
fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]);
|
fprintf(stderr, "no argument for option %c\n", argv[optint][optchr]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "unknown\n");
|
fprintf(stderr, "unknown\n");
|
||||||
|
|
|
@ -1950,7 +1950,7 @@ void dummy_invalid_parameter_handler(
|
||||||
const wchar_t *function,
|
const wchar_t *function,
|
||||||
const wchar_t *file,
|
const wchar_t *file,
|
||||||
unsigned int line,
|
unsigned int line,
|
||||||
uintptr_t pEwserved)
|
uintptr_t pReserved)
|
||||||
{
|
{
|
||||||
static int called = 0;
|
static int called = 0;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
|
@ -885,7 +885,7 @@ static inline php_output_handler *php_output_handler_init(zend_string *name, siz
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ static int php_output_handler_appen(php_output_handler *handler, const php_output_buffer *buf)
|
/* {{{ static int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf)
|
||||||
* Appends input to the output handlers buffer and indicates whether the buffer does not have to be processed by the output handler */
|
* Appends input to the output handlers buffer and indicates whether the buffer does not have to be processed by the output handler */
|
||||||
static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf)
|
static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf)
|
||||||
{
|
{
|
||||||
|
|
|
@ -788,7 +788,7 @@ static bool php_auto_globals_create_files(zend_string *name)
|
||||||
return 0; /* don't rearm */
|
return 0; /* don't rearm */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Upgly hack to fix HTTP_PROXY issue, see bug #72573 */
|
/* Ugly hack to fix HTTP_PROXY issue, see bug #72573 */
|
||||||
static void check_http_proxy(HashTable *var_table)
|
static void check_http_proxy(HashTable *var_table)
|
||||||
{
|
{
|
||||||
if (zend_hash_str_exists(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY")-1)) {
|
if (zend_hash_str_exists(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY")-1)) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ static void normalize_protected_variable(char *varname) /* {{{ */
|
||||||
{
|
{
|
||||||
char *s = varname, *index = NULL, *indexend = NULL, *p;
|
char *s = varname, *index = NULL, *indexend = NULL, *p;
|
||||||
|
|
||||||
/* overjump leading space */
|
/* skip leading space */
|
||||||
while (*s == ' ') {
|
while (*s == ' ') {
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
@ -678,7 +678,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
|
||||||
int boundary_len = 0, cancel_upload = 0, is_arr_upload = 0;
|
int boundary_len = 0, cancel_upload = 0, is_arr_upload = 0;
|
||||||
size_t array_len = 0;
|
size_t array_len = 0;
|
||||||
int64_t total_bytes = 0, max_file_size = 0;
|
int64_t total_bytes = 0, max_file_size = 0;
|
||||||
int skip_upload = 0, anonindex = 0, is_anonymous;
|
int skip_upload = 0, anonymous_index = 0, is_anonymous;
|
||||||
HashTable *uploaded_files = NULL;
|
HashTable *uploaded_files = NULL;
|
||||||
multipart_buffer *mbuff;
|
multipart_buffer *mbuff;
|
||||||
zval *array_ptr = (zval *) arg;
|
zval *array_ptr = (zval *) arg;
|
||||||
|
@ -923,7 +923,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
|
||||||
if (!param) {
|
if (!param) {
|
||||||
is_anonymous = 1;
|
is_anonymous = 1;
|
||||||
param = emalloc(MAX_SIZE_ANONNAME);
|
param = emalloc(MAX_SIZE_ANONNAME);
|
||||||
snprintf(param, MAX_SIZE_ANONNAME, "%u", anonindex++);
|
snprintf(param, MAX_SIZE_ANONNAME, "%u", anonymous_index++);
|
||||||
} else {
|
} else {
|
||||||
is_anonymous = 0;
|
is_anonymous = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,7 +496,7 @@ PHPAPI char * ap_php_conv_p2(register u_wide_int num, register int nbits, char f
|
||||||
* XXX: this is a magic number; do not decrease it
|
* XXX: this is a magic number; do not decrease it
|
||||||
* Emax = 1023
|
* Emax = 1023
|
||||||
* NDIG = 320
|
* NDIG = 320
|
||||||
* NUM_BUF_SIZE >= strlen("-") + Emax + strlrn(".") + NDIG + strlen("E+1023") + 1;
|
* NUM_BUF_SIZE >= strlen("-") + Emax + strlen(".") + NDIG + strlen("E+1023") + 1;
|
||||||
*/
|
*/
|
||||||
#define NUM_BUF_SIZE 2048
|
#define NUM_BUF_SIZE 2048
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ sprintf offers the ability to make a lot of failures since it does not know
|
||||||
the size of the buffer it uses. Therefore usage of sprintf often
|
the size of the buffer it uses. Therefore usage of sprintf often
|
||||||
results in possible entries for buffer overrun attacks. So please
|
results in possible entries for buffer overrun attacks. So please
|
||||||
use this version only if you are sure the call is safe. sprintf
|
use this version only if you are sure the call is safe. sprintf
|
||||||
always terminstes the buffer it writes to.
|
always terminates the buffer it writes to.
|
||||||
|
|
||||||
snprintf knows the buffers size and will not write behind it. But you will
|
snprintf knows the buffers size and will not write behind it. But you will
|
||||||
have to use either a static buffer or allocate a dynamic buffer
|
have to use either a static buffer or allocate a dynamic buffer
|
||||||
|
@ -41,7 +41,7 @@ slprintf same as snprintf with the difference that it actually returns the
|
||||||
spprintf is the dynamical version of snprintf. It allocates the buffer in size
|
spprintf is the dynamical version of snprintf. It allocates the buffer in size
|
||||||
as needed and allows a maximum setting as snprintf (turn this feature
|
as needed and allows a maximum setting as snprintf (turn this feature
|
||||||
off by setting max_len to 0). spprintf is a little bit slower than
|
off by setting max_len to 0). spprintf is a little bit slower than
|
||||||
snprintf and offers possible memory leakes if you miss freeing the
|
snprintf and offers possible memory leaks if you miss freeing the
|
||||||
buffer allocated by the function. Therefore this function should be
|
buffer allocated by the function. Therefore this function should be
|
||||||
used where either no maximum is known or the maximum is much bigger
|
used where either no maximum is known or the maximum is much bigger
|
||||||
than normal size required. spprintf always terminates the buffer.
|
than normal size required. spprintf always terminates the buffer.
|
||||||
|
|
|
@ -416,7 +416,7 @@ static ssize_t php_stdiop_read(php_stream *stream, char *buf, size_t count)
|
||||||
|
|
||||||
if (ret == (size_t)-1 && errno == EINTR) {
|
if (ret == (size_t)-1 && errno == EINTR) {
|
||||||
/* Read was interrupted, retry once,
|
/* Read was interrupted, retry once,
|
||||||
If read still fails, giveup with feof==0
|
If read still fails, give up with feof==0
|
||||||
so script can retry if desired */
|
so script can retry if desired */
|
||||||
ret = read(data->fd, buf, PLAIN_WRAP_BUF_SIZE(count));
|
ret = read(data->fd, buf, PLAIN_WRAP_BUF_SIZE(count));
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,7 +340,7 @@ static const char *_php_stream_pretty_free_options(int close_options, char *out)
|
||||||
if (close_options & PHP_STREAM_FREE_RELEASE_STREAM)
|
if (close_options & PHP_STREAM_FREE_RELEASE_STREAM)
|
||||||
strcat(out, "RELEASE_STREAM, ");
|
strcat(out, "RELEASE_STREAM, ");
|
||||||
if (close_options & PHP_STREAM_FREE_PRESERVE_HANDLE)
|
if (close_options & PHP_STREAM_FREE_PRESERVE_HANDLE)
|
||||||
strcat(out, "PREVERSE_HANDLE, ");
|
strcat(out, "PRESERVE_HANDLE, ");
|
||||||
if (close_options & PHP_STREAM_FREE_RSRC_DTOR)
|
if (close_options & PHP_STREAM_FREE_RSRC_DTOR)
|
||||||
strcat(out, "RSRC_DTOR, ");
|
strcat(out, "RSRC_DTOR, ");
|
||||||
if (close_options & PHP_STREAM_FREE_PERSISTENT)
|
if (close_options & PHP_STREAM_FREE_PERSISTENT)
|
||||||
|
@ -368,7 +368,7 @@ PHPAPI int _php_stream_free(php_stream *stream, int close_options) /* {{{ */
|
||||||
php_stream_context *context;
|
php_stream_context *context;
|
||||||
|
|
||||||
/* During shutdown resources may be released before other resources still holding them.
|
/* During shutdown resources may be released before other resources still holding them.
|
||||||
* When only resoruces are referenced this is not a problem, because they are refcounted
|
* When only resources are referenced this is not a problem, because they are refcounted
|
||||||
* and will only be fully freed once the refcount drops to zero. However, if php_stream*
|
* and will only be fully freed once the refcount drops to zero. However, if php_stream*
|
||||||
* is held directly, we don't have this guarantee. To avoid use-after-free we ignore all
|
* is held directly, we don't have this guarantee. To avoid use-after-free we ignore all
|
||||||
* stream free operations in shutdown unless they come from the resource list destruction,
|
* stream free operations in shutdown unless they come from the resource list destruction,
|
||||||
|
@ -1105,7 +1105,7 @@ PHPAPI zend_string *php_stream_get_record(php_stream *stream, size_t maxlen, con
|
||||||
|
|
||||||
ret_buf = zend_string_alloc(tent_ret_len, 0);
|
ret_buf = zend_string_alloc(tent_ret_len, 0);
|
||||||
/* php_stream_read will not call ops->read here because the necessary
|
/* php_stream_read will not call ops->read here because the necessary
|
||||||
* data is guaranteedly buffered */
|
* data is guaranteed to be buffered */
|
||||||
ZSTR_LEN(ret_buf) = php_stream_read(stream, ZSTR_VAL(ret_buf), tent_ret_len);
|
ZSTR_LEN(ret_buf) = php_stream_read(stream, ZSTR_VAL(ret_buf), tent_ret_len);
|
||||||
|
|
||||||
if (found_delim) {
|
if (found_delim) {
|
||||||
|
|
|
@ -1605,7 +1605,7 @@ zend.assertions = 1
|
||||||
; https://php.net/com.allow-dcom
|
; https://php.net/com.allow-dcom
|
||||||
;com.allow_dcom = true
|
;com.allow_dcom = true
|
||||||
|
|
||||||
; autoregister constants of a component's typlib on com_load()
|
; autoregister constants of a component's typelib on com_load()
|
||||||
; https://php.net/com.autoregister-typelib
|
; https://php.net/com.autoregister-typelib
|
||||||
;com.autoregister_typelib = true
|
;com.autoregister_typelib = true
|
||||||
|
|
||||||
|
|
|
@ -1607,7 +1607,7 @@ zend.assertions = -1
|
||||||
; https://php.net/com.allow-dcom
|
; https://php.net/com.allow-dcom
|
||||||
;com.allow_dcom = true
|
;com.allow_dcom = true
|
||||||
|
|
||||||
; autoregister constants of a component's typlib on com_load()
|
; autoregister constants of a component's typelib on com_load()
|
||||||
; https://php.net/com.autoregister-typelib
|
; https://php.net/com.autoregister-typelib
|
||||||
;com.autoregister_typelib = true
|
;com.autoregister_typelib = true
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This loop is needed because ap_get_brigade() can return us partial data
|
* This loop is needed because ap_get_brigade() can return us partial data
|
||||||
* which would cause premature termination of request read. Therefor we
|
* which would cause premature termination of request read. Therefore we
|
||||||
* need to make sure that if data is available we fill the buffer completely.
|
* need to make sure that if data is available we fill the buffer completely.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -675,7 +675,7 @@ zend_first_try {
|
||||||
/*
|
/*
|
||||||
* check if coming due to ErrorDocument
|
* check if coming due to ErrorDocument
|
||||||
* We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs
|
* We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs
|
||||||
* during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting
|
* during processing of the request by PHP during POST processing. Therefore we need to re-use the exiting
|
||||||
* PHP instance to handle the request rather then creating a new one.
|
* PHP instance to handle the request rather then creating a new one.
|
||||||
*/
|
*/
|
||||||
if (parent_req && parent_req->status != HTTP_OK && parent_req->status != 413 && strcmp(r->protocol, "INCLUDED")) {
|
if (parent_req && parent_req->status != HTTP_OK && parent_req->status != 413 && strcmp(r->protocol, "INCLUDED")) {
|
||||||
|
|
|
@ -2011,7 +2011,7 @@ consult the installation file that came with this distribution, or visit \n\
|
||||||
int running = 0;
|
int running = 0;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
/* Create a process group for ourself & children */
|
/* Create a process group for us & children */
|
||||||
setsid();
|
setsid();
|
||||||
pgroup = getpgrp();
|
pgroup = getpgrp();
|
||||||
#ifdef DEBUG_FASTCGI
|
#ifdef DEBUG_FASTCGI
|
||||||
|
|
|
@ -947,7 +947,7 @@ do_repeat:
|
||||||
is_ps_title_available() == PS_TITLE_SUCCESS,
|
is_ps_title_available() == PS_TITLE_SUCCESS,
|
||||||
CONST_CS, 0);
|
CONST_CS, 0);
|
||||||
|
|
||||||
*arg_excp = arg_free; /* reconstuct argv */
|
*arg_excp = arg_free; /* reconstruct argv */
|
||||||
|
|
||||||
if (hide_argv) {
|
if (hide_argv) {
|
||||||
int i;
|
int i;
|
||||||
|
@ -1338,7 +1338,7 @@ exit_loop:
|
||||||
/* startup after we get the above ini override se we get things right */
|
/* startup after we get the above ini override se we get things right */
|
||||||
if (sapi_module->startup(sapi_module) == FAILURE) {
|
if (sapi_module->startup(sapi_module) == FAILURE) {
|
||||||
/* there is no way to see if we must call zend_ini_deactivate()
|
/* there is no way to see if we must call zend_ini_deactivate()
|
||||||
* since we cannot check if EG(ini_directives) has been initialised
|
* since we cannot check if EG(ini_directives) has been initialized
|
||||||
* because the executor's constructor does not set initialize it.
|
* because the executor's constructor does not set initialize it.
|
||||||
* Apart from that there seems no need for zend_ini_deactivate() yet.
|
* Apart from that there seems no need for zend_ini_deactivate() yet.
|
||||||
* So we goto out_err.*/
|
* So we goto out_err.*/
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef struct php_http_parser_settings php_http_parser_settings;
|
||||||
* HEAD request which may contain 'Content-Length' or 'Transfer-Encoding:
|
* HEAD request which may contain 'Content-Length' or 'Transfer-Encoding:
|
||||||
* chunked' headers that indicate the presence of a body.
|
* chunked' headers that indicate the presence of a body.
|
||||||
*
|
*
|
||||||
* http_data_cb does not return data chunks. It will be call arbitrarally
|
* http_data_cb does not return data chunks. It will be call arbitrarily
|
||||||
* many times for each string. E.G. you might get 10 callbacks for "on_path"
|
* many times for each string. E.G. you might get 10 callbacks for "on_path"
|
||||||
* each providing just a few characters more data.
|
* each providing just a few characters more data.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -152,7 +152,7 @@ static int fpm_event_devpoll_wait(struct fpm_event_queue_s *queue, unsigned long
|
||||||
dopoll.dp_nfds = npollfds;
|
dopoll.dp_nfds = npollfds;
|
||||||
dopoll.dp_timeout = (int)timeout;
|
dopoll.dp_timeout = (int)timeout;
|
||||||
|
|
||||||
/* wait for inconming event or timeout */
|
/* wait for incoming event or timeout */
|
||||||
ret = ioctl(dpfd, DP_POLL, &dopoll);
|
ret = ioctl(dpfd, DP_POLL, &dopoll);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -120,7 +120,7 @@ static int fpm_event_epoll_wait(struct fpm_event_queue_s *queue, unsigned long i
|
||||||
/* ensure we have a clean epoolfds before calling epoll_wait() */
|
/* ensure we have a clean epoolfds before calling epoll_wait() */
|
||||||
memset(epollfds, 0, sizeof(struct epoll_event) * nepollfds);
|
memset(epollfds, 0, sizeof(struct epoll_event) * nepollfds);
|
||||||
|
|
||||||
/* wait for inconming event or timeout */
|
/* wait for incoming event or timeout */
|
||||||
ret = epoll_wait(epollfd, epollfds, nepollfds, timeout);
|
ret = epoll_wait(epollfd, epollfds, nepollfds, timeout);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ static int fpm_event_poll_wait(struct fpm_event_queue_s *queue, unsigned long in
|
||||||
memcpy(active_pollfds, pollfds, sizeof(struct pollfd) * npollfds);
|
memcpy(active_pollfds, pollfds, sizeof(struct pollfd) * npollfds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wait for inconming event or timeout */
|
/* wait for incoming event or timeout */
|
||||||
ret = poll(active_pollfds, npollfds, timeout);
|
ret = poll(active_pollfds, npollfds, timeout);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ static int fpm_event_port_wait(struct fpm_event_queue_s *queue, unsigned long in
|
||||||
t.tv_sec = (int)(timeout / 1000);
|
t.tv_sec = (int)(timeout / 1000);
|
||||||
t.tv_nsec = (timeout % 1000) * 1000 * 1000;
|
t.tv_nsec = (timeout % 1000) * 1000 * 1000;
|
||||||
|
|
||||||
/* wait for inconming event or timeout. We want at least one event or timeout */
|
/* wait for incoming event or timeout. We want at least one event or timeout */
|
||||||
nget = 1;
|
nget = 1;
|
||||||
ret = port_getn(pfd, events, nevents, &nget, &t);
|
ret = port_getn(pfd, events, nevents, &nget, &t);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -93,7 +93,7 @@ static int fpm_event_select_wait(struct fpm_event_queue_s *queue, unsigned long
|
||||||
t.tv_sec = timeout / 1000;
|
t.tv_sec = timeout / 1000;
|
||||||
t.tv_usec = (timeout % 1000) * 1000;
|
t.tv_usec = (timeout % 1000) * 1000;
|
||||||
|
|
||||||
/* wait for inconming event or timeout */
|
/* wait for incoming event or timeout */
|
||||||
ret = select(FD_SETSIZE, ¤t_fds, NULL, NULL, &t);
|
ret = select(FD_SETSIZE, ¤t_fds, NULL, NULL, &t);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
|
||||||
|
|
|
@ -393,7 +393,7 @@ int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to
|
||||||
* - fpm_pctl_can_spawn_children : FPM is running in a NORMAL state (aka not restart, stop or reload)
|
* - fpm_pctl_can_spawn_children : FPM is running in a NORMAL state (aka not restart, stop or reload)
|
||||||
* - wp->running_children < max : there is less than the max process for the current pool
|
* - wp->running_children < max : there is less than the max process for the current pool
|
||||||
* - (fpm_global_config.process_max < 1 || fpm_globals.running_children < fpm_global_config.process_max):
|
* - (fpm_global_config.process_max < 1 || fpm_globals.running_children < fpm_global_config.process_max):
|
||||||
* if fpm_global_config.process_max is set, FPM has not fork this number of processes (globaly)
|
* if fpm_global_config.process_max is set, FPM has not fork this number of processes (globally)
|
||||||
*/
|
*/
|
||||||
while (fpm_pctl_can_spawn_children() && wp->running_children < max && (fpm_global_config.process_max < 1 || fpm_globals.running_children < fpm_global_config.process_max)) {
|
while (fpm_pctl_can_spawn_children() && wp->running_children < max && (fpm_global_config.process_max < 1 || fpm_globals.running_children < fpm_global_config.process_max)) {
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ int fpm_clock_get(struct timeval *tv) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* macosx clock */
|
/* macOS clock */
|
||||||
#elif defined(HAVE_CLOCK_GET_TIME)
|
#elif defined(HAVE_CLOCK_GET_TIME)
|
||||||
|
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
|
|
|
@ -893,7 +893,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
|
||||||
struct fpm_worker_pool_config_s *config = wp->config;
|
struct fpm_worker_pool_config_s *config = wp->config;
|
||||||
|
|
||||||
if (!fpm_event_support_edge_trigger()) {
|
if (!fpm_event_support_edge_trigger()) {
|
||||||
zlog(ZLOG_ALERT, "[pool %s] ondemand process manager can ONLY be used when events.mechanisme is either epoll (Linux) or kqueue (*BSD).", wp->config->name);
|
zlog(ZLOG_ALERT, "[pool %s] ondemand process manager can ONLY be used when events.mechanism is either epoll (Linux) or kqueue (*BSD).", wp->config->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -907,7 +907,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
|
||||||
config->listen_backlog = FPM_BACKLOG_DEFAULT;
|
config->listen_backlog = FPM_BACKLOG_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* certainely useless but proper */
|
/* certainly useless but proper */
|
||||||
config->pm_start_servers = 0;
|
config->pm_start_servers = 0;
|
||||||
config->pm_min_spare_servers = 0;
|
config->pm_min_spare_servers = 0;
|
||||||
config->pm_max_spare_servers = 0;
|
config->pm_max_spare_servers = 0;
|
||||||
|
@ -1688,7 +1688,7 @@ static void fpm_conf_dump() /* {{{ */
|
||||||
zlog(ZLOG_NOTICE, "\tdaemonize = %s", BOOL2STR(fpm_global_config.daemonize));
|
zlog(ZLOG_NOTICE, "\tdaemonize = %s", BOOL2STR(fpm_global_config.daemonize));
|
||||||
zlog(ZLOG_NOTICE, "\trlimit_files = %d", fpm_global_config.rlimit_files);
|
zlog(ZLOG_NOTICE, "\trlimit_files = %d", fpm_global_config.rlimit_files);
|
||||||
zlog(ZLOG_NOTICE, "\trlimit_core = %d", fpm_global_config.rlimit_core);
|
zlog(ZLOG_NOTICE, "\trlimit_core = %d", fpm_global_config.rlimit_core);
|
||||||
zlog(ZLOG_NOTICE, "\tevents.mechanism = %s", fpm_event_machanism_name());
|
zlog(ZLOG_NOTICE, "\tevents.mechanism = %s", fpm_event_mechanism_name());
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_SYSTEMD
|
||||||
zlog(ZLOG_NOTICE, "\tsystemd_interval = %ds", fpm_global_config.systemd_interval/1000);
|
zlog(ZLOG_NOTICE, "\tsystemd_interval = %ds", fpm_global_config.systemd_interval/1000);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -211,7 +211,7 @@ int fpm_env_init_main() /* {{{ */
|
||||||
char *first = NULL;
|
char *first = NULL;
|
||||||
char *last = NULL;
|
char *last = NULL;
|
||||||
/*
|
/*
|
||||||
* This piece of code has been inspirated from nginx and pureftpd code, which
|
* This piece of code has been inspired from nginx and pureftpd code, which
|
||||||
* are under BSD licence.
|
* are under BSD licence.
|
||||||
*
|
*
|
||||||
* To change the process title in Linux we have to set argv[1] to NULL
|
* To change the process title in Linux we have to set argv[1] to NULL
|
||||||
|
|
|
@ -245,12 +245,12 @@ static void fpm_event_queue_destroy(struct fpm_event_queue_s **queue) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
int fpm_event_pre_init(char *machanism) /* {{{ */
|
int fpm_event_pre_init(char *mechanism) /* {{{ */
|
||||||
{
|
{
|
||||||
/* kqueue */
|
/* kqueue */
|
||||||
module = fpm_event_kqueue_module();
|
module = fpm_event_kqueue_module();
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!machanism || strcasecmp(module->name, machanism) == 0) {
|
if (!mechanism || strcasecmp(module->name, mechanism) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ int fpm_event_pre_init(char *machanism) /* {{{ */
|
||||||
/* port */
|
/* port */
|
||||||
module = fpm_event_port_module();
|
module = fpm_event_port_module();
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!machanism || strcasecmp(module->name, machanism) == 0) {
|
if (!mechanism || strcasecmp(module->name, mechanism) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ int fpm_event_pre_init(char *machanism) /* {{{ */
|
||||||
/* epoll */
|
/* epoll */
|
||||||
module = fpm_event_epoll_module();
|
module = fpm_event_epoll_module();
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!machanism || strcasecmp(module->name, machanism) == 0) {
|
if (!mechanism || strcasecmp(module->name, mechanism) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ int fpm_event_pre_init(char *machanism) /* {{{ */
|
||||||
/* /dev/poll */
|
/* /dev/poll */
|
||||||
module = fpm_event_devpoll_module();
|
module = fpm_event_devpoll_module();
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!machanism || strcasecmp(module->name, machanism) == 0) {
|
if (!mechanism || strcasecmp(module->name, mechanism) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ int fpm_event_pre_init(char *machanism) /* {{{ */
|
||||||
/* poll */
|
/* poll */
|
||||||
module = fpm_event_poll_module();
|
module = fpm_event_poll_module();
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!machanism || strcasecmp(module->name, machanism) == 0) {
|
if (!mechanism || strcasecmp(module->name, mechanism) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,13 +290,13 @@ int fpm_event_pre_init(char *machanism) /* {{{ */
|
||||||
/* select */
|
/* select */
|
||||||
module = fpm_event_select_module();
|
module = fpm_event_select_module();
|
||||||
if (module) {
|
if (module) {
|
||||||
if (!machanism || strcasecmp(module->name, machanism) == 0) {
|
if (!mechanism || strcasecmp(module->name, mechanism) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (machanism) {
|
if (mechanism) {
|
||||||
zlog(ZLOG_ERROR, "event mechanism '%s' is not available on this system", machanism);
|
zlog(ZLOG_ERROR, "event mechanism '%s' is not available on this system", mechanism);
|
||||||
} else {
|
} else {
|
||||||
zlog(ZLOG_ERROR, "unable to find a suitable event mechanism on this system");
|
zlog(ZLOG_ERROR, "unable to find a suitable event mechanism on this system");
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ int fpm_event_pre_init(char *machanism) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
const char *fpm_event_machanism_name() /* {{{ */
|
const char *fpm_event_mechanism_name() /* {{{ */
|
||||||
{
|
{
|
||||||
return module ? module->name : NULL;
|
return module ? module->name : NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,8 @@ int fpm_event_init_main();
|
||||||
int fpm_event_set(struct fpm_event_s *ev, int fd, int flags, void (*callback)(struct fpm_event_s *, short, void *), void *arg);
|
int fpm_event_set(struct fpm_event_s *ev, int fd, int flags, void (*callback)(struct fpm_event_s *, short, void *), void *arg);
|
||||||
int fpm_event_add(struct fpm_event_s *ev, unsigned long int timeout);
|
int fpm_event_add(struct fpm_event_s *ev, unsigned long int timeout);
|
||||||
int fpm_event_del(struct fpm_event_s *ev);
|
int fpm_event_del(struct fpm_event_s *ev);
|
||||||
int fpm_event_pre_init(char *machanism);
|
int fpm_event_pre_init(char *mechanism);
|
||||||
const char *fpm_event_machanism_name();
|
const char *fpm_event_mechanism_name();
|
||||||
int fpm_event_support_edge_trigger();
|
int fpm_event_support_edge_trigger();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -205,8 +205,11 @@ int fpm_log_write(char *log_format) /* {{{ */
|
||||||
len2 = snprintf(b, FPM_LOG_BUFFER - len, "%.3f", proc.duration.tv_sec + proc.duration.tv_usec / 1000000.);
|
len2 = snprintf(b, FPM_LOG_BUFFER - len, "%.3f", proc.duration.tv_sec + proc.duration.tv_usec / 1000000.);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* miliseconds */
|
/* milliseconds */
|
||||||
} else if (!strcasecmp(format, "miliseconds") || !strcasecmp(format, "mili")) {
|
} else if (!strcasecmp(format, "milliseconds") || !strcasecmp(format, "milli") ||
|
||||||
|
/* mili/miliseconds are supported for backwards compatibility */
|
||||||
|
!strcasecmp(format, "miliseconds") || !strcasecmp(format, "mili")
|
||||||
|
) {
|
||||||
if (!test) {
|
if (!test) {
|
||||||
len2 = snprintf(b, FPM_LOG_BUFFER - len, "%.3f", proc.duration.tv_sec * 1000. + proc.duration.tv_usec / 1000.);
|
len2 = snprintf(b, FPM_LOG_BUFFER - len, "%.3f", proc.duration.tv_sec * 1000. + proc.duration.tv_usec / 1000.);
|
||||||
}
|
}
|
||||||
|
@ -218,7 +221,7 @@ int fpm_log_write(char *log_format) /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
zlog(ZLOG_WARNING, "only 'seconds', 'mili', 'miliseconds', 'micro' or 'microseconds' are allowed as a modifier for %%%c ('%s')", *s, format);
|
zlog(ZLOG_WARNING, "only 'seconds', 'milli', 'milliseconds', 'micro' or 'microseconds' are allowed as a modifier for %%%c ('%s')", *s, format);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
format[0] = '\0';
|
format[0] = '\0';
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "zlog.h"
|
#include "zlog.h"
|
||||||
|
|
||||||
|
|
||||||
/* MAP_ANON is deprecated, but not in macosx */
|
/* MAP_ANON is deprecated, but not in macOS */
|
||||||
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
||||||
#define MAP_ANONYMOUS MAP_ANON
|
#define MAP_ANONYMOUS MAP_ANON
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -230,7 +230,7 @@ static int fpm_sockets_new_listening_socket(struct fpm_worker_pool_s *wp, struct
|
||||||
|
|
||||||
umask(saved_umask);
|
umask(saved_umask);
|
||||||
|
|
||||||
if (0 > fpm_unix_set_socket_premissions(wp, path)) {
|
if (0 > fpm_unix_set_socket_permissions(wp, path)) {
|
||||||
close(sock);
|
close(sock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +438,7 @@ int fpm_sockets_init_main() /* {{{ */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FPM_AF_UNIX :
|
case FPM_AF_UNIX :
|
||||||
if (0 > fpm_unix_resolve_socket_premissions(wp)) {
|
if (0 > fpm_unix_resolve_socket_permissions(wp)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
wp->listening_socket = fpm_socket_af_unix_listening_socket(wp);
|
wp->listening_socket = fpm_socket_af_unix_listening_socket(wp);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
size_t fpm_pagesize;
|
size_t fpm_pagesize;
|
||||||
|
|
||||||
int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp) /* {{{ */
|
int fpm_unix_resolve_socket_permissions(struct fpm_worker_pool_s *wp) /* {{{ */
|
||||||
{
|
{
|
||||||
struct fpm_worker_pool_config_s *c = wp->config;
|
struct fpm_worker_pool_config_s *c = wp->config;
|
||||||
#ifdef HAVE_FPM_ACL
|
#ifdef HAVE_FPM_ACL
|
||||||
|
@ -198,7 +198,7 @@ int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
int fpm_unix_set_socket_premissions(struct fpm_worker_pool_s *wp, const char *path) /* {{{ */
|
int fpm_unix_set_socket_permissions(struct fpm_worker_pool_s *wp, const char *path) /* {{{ */
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FPM_ACL
|
#ifdef HAVE_FPM_ACL
|
||||||
if (wp->socket_acl) {
|
if (wp->socket_acl) {
|
||||||
|
@ -249,7 +249,7 @@ int fpm_unix_set_socket_premissions(struct fpm_worker_pool_s *wp, const char *pa
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
int fpm_unix_free_socket_premissions(struct fpm_worker_pool_s *wp) /* {{{ */
|
int fpm_unix_free_socket_permissions(struct fpm_worker_pool_s *wp) /* {{{ */
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FPM_ACL
|
#ifdef HAVE_FPM_ACL
|
||||||
if (wp->socket_acl) {
|
if (wp->socket_acl) {
|
||||||
|
@ -482,7 +482,7 @@ int fpm_unix_init_main() /* {{{ */
|
||||||
*
|
*
|
||||||
* The parent process has then to wait for the master
|
* The parent process has then to wait for the master
|
||||||
* process to initialize to return a consistent exit
|
* process to initialize to return a consistent exit
|
||||||
* value. For this pupose, the master process will
|
* value. For this purpose, the master process will
|
||||||
* send \"1\" into the pipe if everything went well
|
* send \"1\" into the pipe if everything went well
|
||||||
* and \"0\" otherwise.
|
* and \"0\" otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#include "fpm_worker_pool.h"
|
#include "fpm_worker_pool.h"
|
||||||
|
|
||||||
int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp);
|
int fpm_unix_resolve_socket_permissions(struct fpm_worker_pool_s *wp);
|
||||||
int fpm_unix_set_socket_premissions(struct fpm_worker_pool_s *wp, const char *path);
|
int fpm_unix_set_socket_permissions(struct fpm_worker_pool_s *wp, const char *path);
|
||||||
int fpm_unix_free_socket_premissions(struct fpm_worker_pool_s *wp);
|
int fpm_unix_free_socket_permissions(struct fpm_worker_pool_s *wp);
|
||||||
|
|
||||||
int fpm_unix_init_child(struct fpm_worker_pool_s *wp);
|
int fpm_unix_init_child(struct fpm_worker_pool_s *wp);
|
||||||
int fpm_unix_init_main();
|
int fpm_unix_init_main();
|
||||||
|
|
|
@ -40,7 +40,7 @@ void fpm_worker_pool_free(struct fpm_worker_pool_s *wp) /* {{{ */
|
||||||
if (wp->limit_extensions) {
|
if (wp->limit_extensions) {
|
||||||
fpm_worker_pool_free_limit_extensions(wp->limit_extensions);
|
fpm_worker_pool_free_limit_extensions(wp->limit_extensions);
|
||||||
}
|
}
|
||||||
fpm_unix_free_socket_premissions(wp);
|
fpm_unix_free_socket_permissions(wp);
|
||||||
free(wp);
|
free(wp);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
; Log buffering specifies if the log line is buffered which means that the
|
; Log buffering specifies if the log line is buffered which means that the
|
||||||
; line is written in a single write operation. If the value is false, then the
|
; line is written in a single write operation. If the value is false, then the
|
||||||
; data is written directly into the file descriptor. It is an experimental
|
; data is written directly into the file descriptor. It is an experimental
|
||||||
; option that can potentionaly improve logging performance and memory usage
|
; option that can potentially improve logging performance and memory usage
|
||||||
; for some heavy logging scenarios. This option is ignored if logging to syslog
|
; for some heavy logging scenarios. This option is ignored if logging to syslog
|
||||||
; as it has to be always buffered.
|
; as it has to be always buffered.
|
||||||
; Default value: yes
|
; Default value: yes
|
||||||
|
|
|
@ -295,7 +295,7 @@ pm.max_spare_servers = 3
|
||||||
; it can accept the following format:
|
; it can accept the following format:
|
||||||
; - %{seconds}d (default)
|
; - %{seconds}d (default)
|
||||||
; - %{milliseconds}d
|
; - %{milliseconds}d
|
||||||
; - %{mili}d
|
; - %{milli}d
|
||||||
; - %{microseconds}d
|
; - %{microseconds}d
|
||||||
; - %{micro}d
|
; - %{micro}d
|
||||||
; %e: an environment variable (same as $_ENV or $_SERVER)
|
; %e: an environment variable (same as $_ENV or $_SERVER)
|
||||||
|
@ -330,17 +330,17 @@ pm.max_spare_servers = 3
|
||||||
; %t: server time the request was received
|
; %t: server time the request was received
|
||||||
; it can accept a strftime(3) format:
|
; it can accept a strftime(3) format:
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
; %d/%b/%Y:%H:%M:%S %z (default)
|
||||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
||||||
; %T: time the log has been written (the request has finished)
|
; %T: time the log has been written (the request has finished)
|
||||||
; it can accept a strftime(3) format:
|
; it can accept a strftime(3) format:
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
; %d/%b/%Y:%H:%M:%S %z (default)
|
||||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
||||||
; %u: remote user
|
; %u: remote user
|
||||||
;
|
;
|
||||||
; Default: "%R - %u %t \"%m %r\" %s"
|
; Default: "%R - %u %t \"%m %r\" %s"
|
||||||
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
|
||||||
|
|
||||||
; The log file for slow requests
|
; The log file for slow requests
|
||||||
; Default Value: not set
|
; Default Value: not set
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
"backslash": "\\",
|
"backslash": "\\",
|
||||||
"controls": "\b\f\n\r\t",
|
"controls": "\b\f\n\r\t",
|
||||||
"slash": "/ & \/",
|
"slash": "/ & \/",
|
||||||
"alpha": "abcdefghijklmnopqrstuvwyz",
|
"alpha": "abcdefghijklmnopqrstuvwxyz",
|
||||||
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
|
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||||
"digit": "0123456789",
|
"digit": "0123456789",
|
||||||
"0123456789": "digit",
|
"0123456789": "digit",
|
||||||
"special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
|
"special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
|
||||||
|
|
|
@ -88,7 +88,7 @@ versa.
|
||||||
|
|
||||||
Brief instructions are as follow:
|
Brief instructions are as follow:
|
||||||
|
|
||||||
1. Login to web administration interface, go to 'Server'->'Ext App' tab, add an
|
1. Log into web administration interface, go to 'Server'->'Ext App' tab, add an
|
||||||
external application of type "LSAPI app", "Command" should be set to a shell
|
external application of type "LSAPI app", "Command" should be set to a shell
|
||||||
command that executes the PHP binary you just built. "Instances" should be
|
command that executes the PHP binary you just built. "Instances" should be
|
||||||
set to "1". Add "LSAPI_CHILDREN" environment variable to match the value of
|
set to "1". Add "LSAPI_CHILDREN" environment variable to match the value of
|
||||||
|
@ -132,7 +132,7 @@ behavior of LSAPI application.
|
||||||
"Self Managed Mode". When set to 0, the internal process manager will stop and
|
"Self Managed Mode". When set to 0, the internal process manager will stop and
|
||||||
start children process on demand to save system resource. This is preferred in
|
start children process on demand to save system resource. This is preferred in
|
||||||
a shared hosting environment. When set to 1, the internal process manager will
|
a shared hosting environment. When set to 1, the internal process manager will
|
||||||
try to avoid freqently stopping and starting children process. This might be
|
try to avoid frequently stopping and starting children process. This might be
|
||||||
preferred in a dedicate hosting environment.
|
preferred in a dedicate hosting environment.
|
||||||
|
|
||||||
* `LSAPI_EXTRA_CHILDREN` (default: 1/3 of `LSAPI_CHILDREN` or 0)
|
* `LSAPI_EXTRA_CHILDREN` (default: 1/3 of `LSAPI_CHILDREN` or 0)
|
||||||
|
@ -162,7 +162,7 @@ behavior of LSAPI application.
|
||||||
In Self Managed Mode, `LSAI_MAX_IDLE_CHILDREN` controls how many idle children
|
In Self Managed Mode, `LSAI_MAX_IDLE_CHILDREN` controls how many idle children
|
||||||
processes are allowed. Excessive idle children processes will be killed by the
|
processes are allowed. Excessive idle children processes will be killed by the
|
||||||
parent process immediately. When `LSAPI_AVOID_FORK` is set to 0, the default
|
parent process immediately. When `LSAPI_AVOID_FORK` is set to 0, the default
|
||||||
value is 1/3 of `LSAPI_CHIDLREN`, When `LSAPI_AVOID_FORK` is set to 1, the
|
value is 1/3 of `LSAPI_CHILDREN`, When `LSAPI_AVOID_FORK` is set to 1, the
|
||||||
default value is `LSAPI_CHILDREN`.
|
default value is `LSAPI_CHILDREN`.
|
||||||
|
|
||||||
* `LSAPI_MAX_PROCESS_TIME` (default value: 300 seconds)
|
* `LSAPI_MAX_PROCESS_TIME` (default value: 300 seconds)
|
||||||
|
|
|
@ -1567,7 +1567,7 @@ int main( int argc, char * argv[] )
|
||||||
while( ( result = LSAPI_Prefork_Accept_r( &g_req )) >= 0 ) {
|
while( ( result = LSAPI_Prefork_Accept_r( &g_req )) >= 0 ) {
|
||||||
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
|
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
|
||||||
if (is_criu && !result) {
|
if (is_criu && !result) {
|
||||||
LSCRIU_inc_req_procssed();
|
LSCRIU_inc_req_processed();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ( slow_script_msec ) {
|
if ( slow_script_msec ) {
|
||||||
|
|
|
@ -944,7 +944,7 @@ static int lsapi_enterLVE( LSAPI_Request * pReq, uid_t uid )
|
||||||
ret = (*fp_lve_enter)(s_lve, uid, -1, -1, &cookie);
|
ret = (*fp_lve_enter)(s_lve, uid, -1, -1, &cookie);
|
||||||
if ( ret < 0 )
|
if ( ret < 0 )
|
||||||
{
|
{
|
||||||
//lsapi_log("enter LVE (%d) : ressult: %d !\n", uid, ret );
|
//lsapi_log("enter LVE (%d) : result: %d !\n", uid, ret );
|
||||||
LSAPI_perror_r(pReq, "LSAPI: lve_enter() failure, reached resource limit.", NULL );
|
LSAPI_perror_r(pReq, "LSAPI: lve_enter() failure, reached resource limit.", NULL );
|
||||||
lsapi_lve_error( pReq );
|
lsapi_lve_error( pReq );
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -4181,7 +4181,7 @@ void lsapi_MD5Update(struct lsapi_MD5Context *ctx, unsigned char const *buf, uns
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
* Final wrap-up - pad to 64-byte boundary with the bit pattern
|
||||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||||
*/
|
*/
|
||||||
void lsapi_MD5Final(unsigned char digest[16], struct lsapi_MD5Context *ctx)
|
void lsapi_MD5Final(unsigned char digest[16], struct lsapi_MD5Context *ctx)
|
||||||
|
|
|
@ -469,7 +469,7 @@ static void LSCRIU_CloudLinux_Checkpoint(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void LSCRIU_Wait_Dump_Finsh_Or_Restored(int pid_parent)
|
static void LSCRIU_Wait_Dump_Finish_Or_Restored(int pid_parent)
|
||||||
{
|
{
|
||||||
// Now get restored. We know if we're restored if the ppid changes!
|
// Now get restored. We know if we're restored if the ppid changes!
|
||||||
// If we're dumped, we're killed (no use worrying about that!).
|
// If we're dumped, we're killed (no use worrying about that!).
|
||||||
|
@ -528,7 +528,7 @@ static void LSCRIU_try_checkpoint(int *forked_pid)
|
||||||
s_fd_native);
|
s_fd_native);
|
||||||
close(s_fd_native);
|
close(s_fd_native);
|
||||||
|
|
||||||
LSCRIU_Wait_Dump_Finsh_Or_Restored(iPidParent);
|
LSCRIU_Wait_Dump_Finish_Or_Restored(iPidParent);
|
||||||
LSCRIU_Restored_Error(0, "Restored!");
|
LSCRIU_Restored_Error(0, "Restored!");
|
||||||
LSAPI_reset_server_state();
|
LSAPI_reset_server_state();
|
||||||
s_restored = 1;
|
s_restored = 1;
|
||||||
|
@ -659,7 +659,7 @@ static int LSCRIU_Init_Env_Parameters(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LSCRIU_inc_req_procssed()
|
void LSCRIU_inc_req_processed()
|
||||||
{
|
{
|
||||||
if (!LSCRIU_Get_Global_Counter_Type()) {
|
if (!LSCRIU_Get_Global_Counter_Type()) {
|
||||||
++s_requests_count;
|
++s_requests_count;
|
||||||
|
|
|
@ -55,7 +55,7 @@ extern "C" {
|
||||||
// return 1 if CRIU is available, return 0 if CRIU is not available
|
// return 1 if CRIU is available, return 0 if CRIU is not available
|
||||||
int LSCRIU_Init(void);
|
int LSCRIU_Init(void);
|
||||||
|
|
||||||
void LSCRIU_inc_req_procssed(void);
|
void LSCRIU_inc_req_processed(void);
|
||||||
|
|
||||||
|
|
||||||
#if defined (c_plusplus) || defined (__cplusplus)
|
#if defined (c_plusplus) || defined (__cplusplus)
|
||||||
|
|
|
@ -60,7 +60,7 @@ int phpdbg_btree_delete(phpdbg_btree *tree, zend_ulong idx);
|
||||||
int phpdbg_btree_insert_or_update(phpdbg_btree *tree, zend_ulong idx, void *ptr, int flags);
|
int phpdbg_btree_insert_or_update(phpdbg_btree *tree, zend_ulong idx, void *ptr, int flags);
|
||||||
#define phpdbg_btree_insert(tree, idx, ptr) phpdbg_btree_insert_or_update(tree, idx, ptr, PHPDBG_BTREE_INSERT)
|
#define phpdbg_btree_insert(tree, idx, ptr) phpdbg_btree_insert_or_update(tree, idx, ptr, PHPDBG_BTREE_INSERT)
|
||||||
#define phpdbg_btree_update(tree, idx, ptr) phpdbg_btree_insert_or_update(tree, idx, ptr, PHPDBG_BTREE_UPDATE)
|
#define phpdbg_btree_update(tree, idx, ptr) phpdbg_btree_insert_or_update(tree, idx, ptr, PHPDBG_BTREE_UPDATE)
|
||||||
#define phpdbg_btree_overwrite(tree, idx, ptr) phpdbg_btree_insert_or_update(tree, idx, ptr, PHPDBG_BTREE_OWERWRITE)
|
#define phpdbg_btree_overwrite(tree, idx, ptr) phpdbg_btree_insert_or_update(tree, idx, ptr, PHPDBG_BTREE_OVERWRITE)
|
||||||
|
|
||||||
|
|
||||||
/* debugging functions */
|
/* debugging functions */
|
||||||
|
|
|
@ -87,7 +87,7 @@ void pretty_print(char *text)
|
||||||
* $P substitutes the prompt sequence
|
* $P substitutes the prompt sequence
|
||||||
* Lines are wrapped by replacing the last blank with a CR before <term width>
|
* Lines are wrapped by replacing the last blank with a CR before <term width>
|
||||||
* characters. (This defaults to 100 if the width can't be detected). In the
|
* characters. (This defaults to 100 if the width can't be detected). In the
|
||||||
* pathelogical case where no blanks are found, then the wrap occurs at the
|
* pathological case where no blanks are found, then the wrap occurs at the
|
||||||
* first blank.
|
* first blank.
|
||||||
*/
|
*/
|
||||||
for (p = text, q = new; *p; p++) {
|
for (p = text, q = new; *p; p++) {
|
||||||
|
@ -154,7 +154,7 @@ static char *get_help(const char * const key)
|
||||||
phpdbg_help_text_t *p;
|
phpdbg_help_text_t *p;
|
||||||
|
|
||||||
/* Note that phpdbg_help_text is not assumed to be collated in key order. This is an
|
/* Note that phpdbg_help_text is not assumed to be collated in key order. This is an
|
||||||
inconvience that means that help can't be logically grouped Not worth
|
inconvenience that means that help can't be logically grouped Not worth
|
||||||
the savings */
|
the savings */
|
||||||
|
|
||||||
for (p = phpdbg_help_text; p->key; p++) {
|
for (p = phpdbg_help_text; p->key; p++) {
|
||||||
|
@ -383,10 +383,10 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||||
"(and list out options if not unique), so **help exp** will give help on the **export** command, "
|
"(and list out options if not unique), so **help exp** will give help on the **export** command, "
|
||||||
"but **help ex** will list the summary for **exec** and **export**." CR CR
|
"but **help ex** will list the summary for **exec** and **export**." CR CR
|
||||||
|
|
||||||
"Type **help aliases** to show a full alias list, including any registered phpdginit functions" CR
|
"Type **help aliases** to show a full alias list, including any registered phpdbginit functions" CR
|
||||||
"Type **help syntax** for a general introduction to the command syntax." CR
|
"Type **help syntax** for a general introduction to the command syntax." CR
|
||||||
"Type **help options** for a list of phpdbg command line options." CR
|
"Type **help options** for a list of phpdbg command line options." CR
|
||||||
"Type **help phpdbginit** to show how to customise the debugger environment."
|
"Type **help phpdbginit** to show how to customize the debugger environment."
|
||||||
},
|
},
|
||||||
{"options", CR
|
{"options", CR
|
||||||
"Below are the command line options supported by phpdbg" CR CR
|
"Below are the command line options supported by phpdbg" CR CR
|
||||||
|
@ -444,7 +444,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||||
},
|
},
|
||||||
|
|
||||||
{"phpdbginit", CR
|
{"phpdbginit", CR
|
||||||
"Phpdgb uses an debugger script file to initialize the debugger context. By default, phpdbg looks "
|
"Phpdbg uses an debugger script file to initialize the debugger context. By default, phpdbg looks "
|
||||||
"for the file named **.phpdbginit** in the current working directory. This location can be "
|
"for the file named **.phpdbginit** in the current working directory. This location can be "
|
||||||
"overridden on the command line using the **-i** switch (see **help options** for a more "
|
"overridden on the command line using the **-i** switch (see **help options** for a more "
|
||||||
"details)." CR CR
|
"details)." CR CR
|
||||||
|
@ -514,7 +514,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||||
/******************************** Help Codicils ********************************/
|
/******************************** Help Codicils ********************************/
|
||||||
{"aliases!", CR
|
{"aliases!", CR
|
||||||
"Note that aliases can be used for either command or sub-command keywords or both, so **info b** "
|
"Note that aliases can be used for either command or sub-command keywords or both, so **info b** "
|
||||||
"is a synomyn for **info break** and **l func** for **list func**, etc." CR CR
|
"is a synonym for **info break** and **l func** for **list func**, etc." CR CR
|
||||||
|
|
||||||
"Note that help will also accept any alias as a parameter and provide help on that command, for example **h p** will provide help on the print command."
|
"Note that help will also accept any alias as a parameter and provide help on that command, for example **h p** will provide help on the print command."
|
||||||
},
|
},
|
||||||
|
@ -760,7 +760,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
|
||||||
},
|
},
|
||||||
|
|
||||||
{"list",
|
{"list",
|
||||||
"The list command displays source code for the given argument. The target type is specficied by "
|
"The list command displays source code for the given argument. The target type is specified by "
|
||||||
"a second subcommand keyword:" CR CR
|
"a second subcommand keyword:" CR CR
|
||||||
|
|
||||||
" **Type** **Alias** **Purpose**" CR
|
" **Type** **Alias** **Purpose**" CR
|
||||||
|
|
|
@ -37,7 +37,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
|
||||||
* XXX: this is a magic number; do not decrease it
|
* XXX: this is a magic number; do not decrease it
|
||||||
* Emax = 1023
|
* Emax = 1023
|
||||||
* NDIG = 320
|
* NDIG = 320
|
||||||
* NUM_BUF_SIZE >= strlen("-") + Emax + strlrn(".") + NDIG + strlen("E+1023") + 1;
|
* NUM_BUF_SIZE >= strlen("-") + Emax + strlen(".") + NDIG + strlen("E+1023") + 1;
|
||||||
*/
|
*/
|
||||||
#define NUM_BUF_SIZE 2048
|
#define NUM_BUF_SIZE 2048
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ void phpdbg_webdata_decompress(char *msg, int len) {
|
||||||
PHP_VAR_UNSERIALIZE_INIT(var_hash);
|
PHP_VAR_UNSERIALIZE_INIT(var_hash);
|
||||||
if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash)) {
|
if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash)) {
|
||||||
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
||||||
phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed serialized was sent to this socket, arborting");
|
phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed serialized was sent to this socket, aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
||||||
|
|
|
@ -665,7 +665,7 @@ void phpdbg_queue_element_for_recreation(phpdbg_watch_element *element) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool phpdbg_try_readding_watch_element(zval *parent, phpdbg_watch_element *element) {
|
bool phpdbg_try_re_adding_watch_element(zval *parent, phpdbg_watch_element *element) {
|
||||||
zval *zv;
|
zval *zv;
|
||||||
HashTable *ht = HT_FROM_ZVP(parent);
|
HashTable *ht = HT_FROM_ZVP(parent);
|
||||||
|
|
||||||
|
@ -690,7 +690,7 @@ bool phpdbg_try_readding_watch_element(zval *parent, phpdbg_watch_element *eleme
|
||||||
next = Z_REFVAL_P(next);
|
next = Z_REFVAL_P(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!phpdbg_try_readding_watch_element(next, element->child)) {
|
if (!phpdbg_try_re_adding_watch_element(next, element->child)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else if (phpdbg_check_watch_diff(WATCH_ON_ZVAL, &element->backup.zv, zv)) {
|
} else if (phpdbg_check_watch_diff(WATCH_ON_ZVAL, &element->backup.zv, zv)) {
|
||||||
|
@ -736,7 +736,7 @@ void phpdbg_dequeue_elements_for_recreation() {
|
||||||
} else {
|
} else {
|
||||||
ZVAL_ARR(zv, element->parent_container);
|
ZVAL_ARR(zv, element->parent_container);
|
||||||
}
|
}
|
||||||
if (!phpdbg_try_readding_watch_element(zv, element)) {
|
if (!phpdbg_try_re_adding_watch_element(zv, element)) {
|
||||||
phpdbg_automatic_dequeue_free(element);
|
phpdbg_automatic_dequeue_free(element);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -133,7 +133,7 @@ inactive
|
||||||
|
|
||||||
- by type
|
- by type
|
||||||
- op_array: nothing was yet compiled (probably because no execution context set)
|
- op_array: nothing was yet compiled (probably because no execution context set)
|
||||||
- symbol_table: no symbol table present (not yet initiailized or already destructed)
|
- symbol_table: no symbol table present (not yet initialized or already destructed)
|
||||||
- noexec: not in execution
|
- noexec: not in execution
|
||||||
- memory_manager: using the native memory manager (malloc, free, realloc) instead of e.g. the Zend MM
|
- memory_manager: using the native memory manager (malloc, free, realloc) instead of e.g. the Zend MM
|
||||||
- notfound: file not found
|
- notfound: file not found
|
||||||
|
@ -166,7 +166,7 @@ break / info break
|
||||||
|
|
||||||
- id: the breakpoint id (if the leave command was executed, the id has the value "leave")
|
- id: the breakpoint id (if the leave command was executed, the id has the value "leave")
|
||||||
- num: the nth opline of a function/method/file
|
- num: the nth opline of a function/method/file
|
||||||
- add: has value "success"/"fail": a brekpoint was successfully/not added
|
- add: has value "success"/"fail": a breakpoint was successfully/not added
|
||||||
- pending: the breakpoint is waiting for resolving (e.g. a file opline on a not yet loaded file)
|
- pending: the breakpoint is waiting for resolving (e.g. a file opline on a not yet loaded file)
|
||||||
- deleted: has value "success"/"fail": a breakpoint was successfully/not deleted
|
- deleted: has value "success"/"fail": a breakpoint was successfully/not deleted
|
||||||
- eval: the condition on conditional breakpoints
|
- eval: the condition on conditional breakpoints
|
||||||
|
@ -366,7 +366,7 @@ print
|
||||||
- if the type is "User"
|
- if the type is "User"
|
||||||
- it has these attributes
|
- it has these attributes
|
||||||
- startline: the first line of code where the method or function is defined
|
- startline: the first line of code where the method or function is defined
|
||||||
- endline: the lastt line of code where the method or function is defined
|
- endline: the last line of code where the method or function is defined
|
||||||
- file: the file of code where the method or function is defined
|
- file: the file of code where the method or function is defined
|
||||||
- is followed by the oplines of that method or function (<print> elements)
|
- is followed by the oplines of that method or function (<print> elements)
|
||||||
- <print line="%u" opline="%p" opcode="%s" op="%s" />
|
- <print line="%u" opline="%p" opcode="%s" op="%s" />
|
||||||
|
@ -516,7 +516,7 @@ set
|
||||||
|
|
||||||
### prompt ###
|
### prompt ###
|
||||||
|
|
||||||
- without other args, a <setpromt str="" /> tag is emitted where the value of the str attribute is the value of the prompt
|
- without other args, a <setprompt str="" /> tag is emitted where the value of the str attribute is the value of the prompt
|
||||||
- when there is another arg, the prompt is changed to that arg, no further xml answer
|
- when there is another arg, the prompt is changed to that arg, no further xml answer
|
||||||
|
|
||||||
### break ###
|
### break ###
|
||||||
|
@ -558,7 +558,7 @@ set
|
||||||
- generally enables / disables quietness silently with no further xml answer
|
- generally enables / disables quietness silently with no further xml answer
|
||||||
- if the boolean switch is omitted, it emits current state in a <setquiet active="" /> where active is on or off
|
- if the boolean switch is omitted, it emits current state in a <setquiet active="" /> where active is on or off
|
||||||
|
|
||||||
### setpping ###
|
### stepping ###
|
||||||
|
|
||||||
- sets stepping to either opcode or line (so a step command will either advance one op or one line)
|
- sets stepping to either opcode or line (so a step command will either advance one op or one line)
|
||||||
- if no further argument is passed, it emits current state in a <setoplog type="" /> where active is opcode or line
|
- if no further argument is passed, it emits current state in a <setoplog type="" /> where active is opcode or line
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
RFC1867 character quotting
|
RFC1867 character quoting
|
||||||
--INI--
|
--INI--
|
||||||
file_uploads=1
|
file_uploads=1
|
||||||
max_input_vars=1000
|
max_input_vars=1000
|
||||||
|
|
|
@ -8,7 +8,7 @@ disable_functions=dl
|
||||||
<?php
|
<?php
|
||||||
$disabled_function = 'dl';
|
$disabled_function = 'dl';
|
||||||
|
|
||||||
/* exclude_disabled parameters is harded to true */
|
/* exclude_disabled parameters is hardcoded to true */
|
||||||
|
|
||||||
$functions = get_defined_functions();
|
$functions = get_defined_functions();
|
||||||
var_dump(in_array($disabled_function, $functions['internal']));
|
var_dump(in_array($disabled_function, $functions['internal']));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
ZE2 An abstrcat method cannot be called indirectly
|
ZE2 An abstract method cannot be called indirectly
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
ZE2 ArrayAccess::offsetGet ambiguties
|
ZE2 ArrayAccess::offsetGet ambiguities
|
||||||
--INI--
|
--INI--
|
||||||
error_reporting=4095
|
error_reporting=4095
|
||||||
--FILE--
|
--FILE--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
ZE2 ArrayAccess::offsetGet ambiguties
|
ZE2 ArrayAccess::offsetGet ambiguities
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
class ObjectOne implements ArrayAccess {
|
class ObjectOne implements ArrayAccess {
|
||||||
|
|
|
@ -6,7 +6,7 @@ for ($jdk=0; $jdk<50; $jdk++) {
|
||||||
?><html>
|
?><html>
|
||||||
<head>
|
<head>
|
||||||
<?php /* the point of this file is to intensively test various aspects of the parser.
|
<?php /* the point of this file is to intensively test various aspects of the parser.
|
||||||
* right now, each test focuses in one aspect only (e.g. variable aliasing, arithemtic operator,
|
* right now, each test focuses in one aspect only (e.g. variable aliasing, arithmetic operator,
|
||||||
* various control structures), while trying to combine code from other parts of the parser as well.
|
* various control structures), while trying to combine code from other parts of the parser as well.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Testing string scanner confirmance
|
Testing string scanner conformance
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php echo "\"\t\\'" . '\n\\\'a\\\b\\' ?>
|
<?php echo "\"\t\\'" . '\n\\\'a\\\b\\' ?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
|
|
@ -10,7 +10,7 @@ print zend_version()."\n";
|
||||||
* Storing the result of a function in a static variable.
|
* Storing the result of a function in a static variable.
|
||||||
* foo_global() increments global variable $foo_count whenever it is executed.
|
* foo_global() increments global variable $foo_count whenever it is executed.
|
||||||
* When foo_static() is called it checks for the static variable $foo_value
|
* When foo_static() is called it checks for the static variable $foo_value
|
||||||
* being initialised. In case initialisation is necessary foo_global() will be
|
* being initialized. In case initialisation is necessary foo_global() will be
|
||||||
* called. Since that must happen only once the return value should be equal.
|
* called. Since that must happen only once the return value should be equal.
|
||||||
*/
|
*/
|
||||||
$foo_count = 0;
|
$foo_count = 0;
|
||||||
|
@ -58,8 +58,8 @@ function bar_static() {
|
||||||
*
|
*
|
||||||
* Storing a reference to the result of a function in a static variable.
|
* Storing a reference to the result of a function in a static variable.
|
||||||
* Same as Part 2 but wow_global() returns a reference so $wow_value
|
* Same as Part 2 but wow_global() returns a reference so $wow_value
|
||||||
* should store a reference to $wow_global. Therefor $wow_value is already
|
* should store a reference to $wow_global. Therefore $wow_value is already
|
||||||
* initialised in second call to wow_static() and hence shouldn't call
|
* initialized in second call to wow_static() and hence shouldn't call
|
||||||
* wow_global() again.
|
* wow_global() again.
|
||||||
*/ /*
|
*/ /*
|
||||||
$wow_count = 0;
|
$wow_count = 0;
|
||||||
|
@ -89,7 +89,7 @@ function wow_static() {
|
||||||
* The class oop_test uses a static reference to a oop_class instance.
|
* The class oop_test uses a static reference to a oop_class instance.
|
||||||
* When another oop_test instance is created it must reuse the statically
|
* When another oop_test instance is created it must reuse the statically
|
||||||
* stored reference oop_value. This way oop_class gets some singleton behavior
|
* stored reference oop_value. This way oop_class gets some singleton behavior
|
||||||
* since it will be created only once for all insatnces of oop_test.
|
* since it will be created only once for all instances of oop_test.
|
||||||
*/
|
*/
|
||||||
$oop_global = 0;
|
$oop_global = 0;
|
||||||
class oop_class {
|
class oop_class {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Bug #25145 (SEGV on recpt of form input with name like "123[]")
|
Bug #25145 (SEGV on receipt of form input with name like "123[]")
|
||||||
--GET--
|
--GET--
|
||||||
123[]=SEGV
|
123[]=SEGV
|
||||||
--FILE--
|
--FILE--
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Bug #30578 (Output buffers flushed before calling __desctruct functions)
|
Bug #30578 (Output buffers flushed before calling __destruct functions)
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@ docref_root="/"
|
||||||
error_reporting=4095
|
error_reporting=4095
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
require_once('nonexisiting.php');
|
require_once('nonexistent.php');
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
<br />
|
<br />
|
||||||
<b>Warning</b>: require_once(nonexisiting.php) [<a href='/function.require-once.html'>function.require-once.html</a>]: Failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br />
|
<b>Warning</b>: require_once(nonexistent.php) [<a href='/function.require-once.html'>function.require-once.html</a>]: Failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br />
|
||||||
<br />
|
<br />
|
||||||
<b>Fatal error</b>: Uncaught Error: Failed opening required 'nonexisiting.php' (include_path='%s') in %s:%d
|
<b>Fatal error</b>: Uncaught Error: Failed opening required 'nonexistent.php' (include_path='%s') in %s:%d
|
||||||
Stack trace:
|
Stack trace:
|
||||||
#0 {main}
|
#0 {main}
|
||||||
thrown in <b>%sbug35176.php</b> on line <b>2</b><br />
|
thrown in <b>%sbug35176.php</b> on line <b>2</b><br />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Operators on overlaoded property reference
|
Operators on overloaded property reference
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
class C {
|
class C {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue