mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'master' into phpng
* master: fix nmake snap when ext name is different in target dll force atoll macro usage on windows Enable $ replacement in exif, ldap, pdo_pgsql and tidy See bug #67635 NEWS NEWS improve previous, add message during configure Fixed bug #67635 php links to systemd libraries without using pkg-config Improve fix for #66608 Fixed segfault with empty break New added opcodes don't need to be resloved Update NEWS Update NEWS Update NEWS Fixed bug #66827 Session raises E_NOTICE when session name variable is array implemented copy libs of core exts in phpize mode fix copy the ext dll into the prefix path in phpize mode fix default prefix in phpize mode fix file with zero size usage in phpize mode Conflicts: Zend/zend_opcode.c Zend/zend_vm_def.h Zend/zend_vm_execute.h ext/session/session.c
This commit is contained in:
commit
f2a2fccece
15 changed files with 218 additions and 65 deletions
4
.gitattributes
vendored
4
.gitattributes
vendored
|
@ -22,6 +22,10 @@ sapi/nsapi/nsapi.c ident
|
||||||
sapi/continuity/capi.c ident
|
sapi/continuity/capi.c ident
|
||||||
Zend/RFCs/002.txt ident
|
Zend/RFCs/002.txt ident
|
||||||
Zend/RFCs/003.txt ident
|
Zend/RFCs/003.txt ident
|
||||||
|
ext/exif/exif.c ident
|
||||||
|
ext/ldap/ldap.c ident
|
||||||
|
ext/pdo_pgsql/pdo_pgsql.c ident
|
||||||
|
ext/tidy/tidy.c ident
|
||||||
NEWS merge=NEWS
|
NEWS merge=NEWS
|
||||||
UPGRADING merge=NEWS
|
UPGRADING merge=NEWS
|
||||||
UPGRADING.INTERNALS merge=NEWS
|
UPGRADING.INTERNALS merge=NEWS
|
||||||
|
|
|
@ -5,28 +5,56 @@ Bug #66608 (Incorrect behavior with nested "finally" blocks)
|
||||||
function bar() {
|
function bar() {
|
||||||
try {
|
try {
|
||||||
echo "1\n";
|
echo "1\n";
|
||||||
|
try {
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
echo "2\n";
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
throw new Exception ("");
|
throw new Exception ("");
|
||||||
} catch (Exception $ab) {
|
} catch (Exception $ab) {
|
||||||
echo "2\n";
|
echo "3\n";
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
} finally {
|
} finally {
|
||||||
echo "3\n";
|
echo "4\n";
|
||||||
try {
|
try {
|
||||||
} finally {
|
} finally {
|
||||||
}
|
}
|
||||||
echo "4\n";
|
echo "5\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "5\n";
|
echo "6\n";
|
||||||
try {
|
try {
|
||||||
} finally {
|
} finally {
|
||||||
echo "6\n";
|
while (1) {
|
||||||
|
try {
|
||||||
|
echo "7\n";
|
||||||
|
break;
|
||||||
|
} finally {
|
||||||
|
echo "8\n";
|
||||||
|
}
|
||||||
|
echo "bad";
|
||||||
|
}
|
||||||
|
echo "9\n";
|
||||||
|
while (1) {
|
||||||
|
try {
|
||||||
|
throw new Exception("");
|
||||||
|
} catch(Exception $e) {
|
||||||
|
echo "10\n";
|
||||||
|
break;
|
||||||
|
} finally {
|
||||||
|
echo "11\n";
|
||||||
|
}
|
||||||
|
echo "bak\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
echo "12\n";
|
||||||
}
|
}
|
||||||
echo "7\n";
|
echo "13\n";
|
||||||
}
|
}
|
||||||
bar();
|
bar();
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
@ -37,3 +65,9 @@ bar();
|
||||||
5
|
5
|
||||||
6
|
6
|
||||||
7
|
7
|
||||||
|
8
|
||||||
|
9
|
||||||
|
10
|
||||||
|
11
|
||||||
|
12
|
||||||
|
13
|
||||||
|
|
15
Zend/tests/try_finally_011.phpt
Normal file
15
Zend/tests/try_finally_011.phpt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
--TEST--
|
||||||
|
Try finally (segfault with empty break)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function foo () {
|
||||||
|
try {
|
||||||
|
break;
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foo();
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Fatal error: Cannot break/continue 1 level in %stry_finally_011.php on line %d
|
|
@ -840,8 +840,8 @@ int zend_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC);
|
||||||
#define ZEND_FAST_RET_TO_CATCH 1
|
#define ZEND_FAST_RET_TO_CATCH 1
|
||||||
#define ZEND_FAST_RET_TO_FINALLY 2
|
#define ZEND_FAST_RET_TO_FINALLY 2
|
||||||
|
|
||||||
#define ZEND_FAST_CALL_FOR_CATCH 1
|
#define ZEND_FAST_CALL_FROM_CATCH 1
|
||||||
#define ZEND_FAST_CALL_FOR_FINALLY 2
|
#define ZEND_FAST_CALL_FROM_FINALLY 2
|
||||||
|
|
||||||
#define ZEND_ARRAY_ELEMENT_REF (1<<0)
|
#define ZEND_ARRAY_ELEMENT_REF (1<<0)
|
||||||
#define ZEND_ARRAY_NOT_PACKED (1<<1)
|
#define ZEND_ARRAY_NOT_PACKED (1<<1)
|
||||||
|
|
|
@ -480,6 +480,49 @@ static void zend_check_finally_breakout(zend_op_array *op_array, zend_uint op_nu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void zend_adjust_fast_call(zend_op_array *op_array, zend_uint fast_call, zend_uint start, zend_uint end TSRMLS_DC)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
zend_uint op_num = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < op_array->last_try_catch; i++) {
|
||||||
|
if (op_array->try_catch_array[i].finally_op > start
|
||||||
|
&& op_array->try_catch_array[i].finally_end < end) {
|
||||||
|
op_num = op_array->try_catch_array[i].finally_op;
|
||||||
|
start = op_array->try_catch_array[i].finally_end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (op_num) {
|
||||||
|
/* Must be ZEND_FAST_CALL */
|
||||||
|
ZEND_ASSERT(op_array->opcodes[op_num - 2].opcode == ZEND_FAST_CALL);
|
||||||
|
op_array->opcodes[op_num - 2].extended_value = ZEND_FAST_CALL_FROM_FINALLY;
|
||||||
|
op_array->opcodes[op_num - 2].op2.opline_num = fast_call;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint fast_call, zend_uint op_num TSRMLS_DC)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
zend_uint finally_op_num = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < op_array->last_try_catch; i++) {
|
||||||
|
if (op_num >= op_array->try_catch_array[i].finally_op
|
||||||
|
&& op_num < op_array->try_catch_array[i].finally_end) {
|
||||||
|
finally_op_num = op_array->try_catch_array[i].finally_op;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (finally_op_num) {
|
||||||
|
/* Must be ZEND_FAST_CALL */
|
||||||
|
ZEND_ASSERT(op_array->opcodes[finally_op_num - 2].opcode == ZEND_FAST_CALL);
|
||||||
|
if (op_array->opcodes[fast_call].extended_value == 0) {
|
||||||
|
op_array->opcodes[fast_call].extended_value = ZEND_FAST_CALL_FROM_FINALLY;
|
||||||
|
op_array->opcodes[fast_call].op2.opline_num = finally_op_num - 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC)
|
static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC)
|
||||||
{
|
{
|
||||||
zend_uint start_op;
|
zend_uint start_op;
|
||||||
|
@ -507,11 +550,23 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,
|
||||||
opline->opcode = ZEND_FAST_CALL;
|
opline->opcode = ZEND_FAST_CALL;
|
||||||
SET_UNUSED(opline->op1);
|
SET_UNUSED(opline->op1);
|
||||||
SET_UNUSED(opline->op2);
|
SET_UNUSED(opline->op2);
|
||||||
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
|
zend_adjust_fast_call(op_array, start_op,
|
||||||
|
op_array->try_catch_array[i].finally_op,
|
||||||
|
op_array->try_catch_array[i].finally_end TSRMLS_CC);
|
||||||
if (op_array->try_catch_array[i].catch_op) {
|
if (op_array->try_catch_array[i].catch_op) {
|
||||||
opline->extended_value = ZEND_FAST_CALL_FOR_CATCH;
|
opline->extended_value = ZEND_FAST_CALL_FROM_CATCH;
|
||||||
opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
|
opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
|
||||||
|
opline->op1.opline_num = get_next_op_number(op_array);
|
||||||
|
/* generate a FAST_CALL to hole CALL_FROM_FINALLY */
|
||||||
|
opline = get_next_op(op_array TSRMLS_CC);
|
||||||
|
opline->opcode = ZEND_FAST_CALL;
|
||||||
|
SET_UNUSED(opline->op1);
|
||||||
|
SET_UNUSED(opline->op2);
|
||||||
|
zend_resolve_fast_call(op_array, start_op + 1, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
|
||||||
|
} else {
|
||||||
|
zend_resolve_fast_call(op_array, start_op, op_array->try_catch_array[i].finally_op - 2 TSRMLS_CC);
|
||||||
}
|
}
|
||||||
|
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
|
||||||
|
|
||||||
/* generate a sequence of FAST_CALL to upward finally block */
|
/* generate a sequence of FAST_CALL to upward finally block */
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
|
@ -574,32 +629,12 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num T
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint op_num TSRMLS_DC)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
zend_uint finally_op_num = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < op_array->last_try_catch; i++) {
|
|
||||||
if (op_array->try_catch_array[i].finally_op > op_num) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (op_num < op_array->try_catch_array[i].finally_end) {
|
|
||||||
finally_op_num = op_array->try_catch_array[i].finally_op;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (finally_op_num) {
|
|
||||||
op_array->opcodes[op_num].extended_value = ZEND_FAST_CALL_FOR_FINALLY;
|
|
||||||
op_array->opcodes[op_num].op2.opline_num = finally_op_num - 2; /* it must be ZEND_FAST_CALL */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
||||||
{
|
{
|
||||||
zend_uint i;
|
zend_uint i, j;
|
||||||
zend_op *opline;
|
zend_op *opline;
|
||||||
|
|
||||||
for (i = 0; i < op_array->last; i++) {
|
for (i = 0, j = op_array->last; i < j; i++) {
|
||||||
opline = op_array->opcodes + i;
|
opline = op_array->opcodes + i;
|
||||||
switch (opline->opcode) {
|
switch (opline->opcode) {
|
||||||
case ZEND_RETURN:
|
case ZEND_RETURN:
|
||||||
|
@ -614,15 +649,16 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
||||||
zend_brk_cont_element *jmp_to;
|
zend_brk_cont_element *jmp_to;
|
||||||
|
|
||||||
nest_levels = Z_LVAL(op_array->literals[opline->op2.constant]);
|
nest_levels = Z_LVAL(op_array->literals[opline->op2.constant]);
|
||||||
array_offset = opline->op1.opline_num;
|
if ((array_offset = opline->op1.opline_num) != -1) {
|
||||||
do {
|
do {
|
||||||
jmp_to = &op_array->brk_cont_array[array_offset];
|
jmp_to = &op_array->brk_cont_array[array_offset];
|
||||||
if (nest_levels > 1) {
|
if (nest_levels > 1) {
|
||||||
array_offset = jmp_to->parent;
|
array_offset = jmp_to->parent;
|
||||||
}
|
}
|
||||||
} while (--nest_levels > 0);
|
} while (--nest_levels > 0);
|
||||||
zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
|
zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case ZEND_GOTO:
|
case ZEND_GOTO:
|
||||||
if (Z_TYPE(op_array->literals[opline->op2.constant]) != IS_LONG) {
|
if (Z_TYPE(op_array->literals[opline->op2.constant]) != IS_LONG) {
|
||||||
|
@ -636,7 +672,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
|
||||||
zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC);
|
zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC);
|
||||||
break;
|
break;
|
||||||
case ZEND_FAST_CALL:
|
case ZEND_FAST_CALL:
|
||||||
zend_resolve_fast_call(op_array, i TSRMLS_CC);
|
zend_resolve_fast_call(op_array, i, i TSRMLS_CC);
|
||||||
break;
|
break;
|
||||||
case ZEND_FAST_RET:
|
case ZEND_FAST_RET:
|
||||||
zend_resolve_finally_ret(op_array, i TSRMLS_CC);
|
zend_resolve_finally_ret(op_array, i TSRMLS_CC);
|
||||||
|
|
|
@ -5757,7 +5757,7 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
|
|
||||||
if ((opline->extended_value & ZEND_FAST_CALL_FOR_CATCH) &&
|
if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
|
||||||
UNEXPECTED(EG(prev_exception) != NULL)) {
|
UNEXPECTED(EG(prev_exception) != NULL)) {
|
||||||
/* in case of unhandled exception jump to catch block instead of finally */
|
/* in case of unhandled exception jump to catch block instead of finally */
|
||||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||||
|
@ -5773,7 +5773,7 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
|
||||||
{
|
{
|
||||||
if (EX(fast_ret)) {
|
if (EX(fast_ret)) {
|
||||||
ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
|
ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
|
||||||
if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FOR_FINALLY)) {
|
if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
|
||||||
EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
|
EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
|
||||||
}
|
}
|
||||||
ZEND_VM_CONTINUE();
|
ZEND_VM_CONTINUE();
|
||||||
|
|
|
@ -1466,7 +1466,7 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||||
{
|
{
|
||||||
USE_OPLINE
|
USE_OPLINE
|
||||||
|
|
||||||
if ((opline->extended_value & ZEND_FAST_CALL_FOR_CATCH) &&
|
if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
|
||||||
UNEXPECTED(EG(prev_exception) != NULL)) {
|
UNEXPECTED(EG(prev_exception) != NULL)) {
|
||||||
/* in case of unhandled exception jump to catch block instead of finally */
|
/* in case of unhandled exception jump to catch block instead of finally */
|
||||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||||
|
@ -1482,7 +1482,7 @@ static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||||
{
|
{
|
||||||
if (EX(fast_ret)) {
|
if (EX(fast_ret)) {
|
||||||
ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
|
ZEND_VM_SET_OPCODE(EX(fast_ret) + 1);
|
||||||
if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FOR_FINALLY)) {
|
if ((EX(fast_ret)->extended_value & ZEND_FAST_CALL_FROM_FINALLY)) {
|
||||||
EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
|
EX(fast_ret) = &EX(func)->op_array.opcodes[EX(fast_ret)->op2.opline_num];
|
||||||
}
|
}
|
||||||
ZEND_VM_CONTINUE();
|
ZEND_VM_CONTINUE();
|
||||||
|
|
|
@ -1405,9 +1405,16 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
#define PPID2SID \
|
static void ppid2sid(zval *ppid TSRMLS_DC) {
|
||||||
convert_to_string((ppid)); \
|
if (Z_TYPE_P(ppid) != IS_STRING) {
|
||||||
PS(id) = STR_INIT(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0)
|
PS(id) = NULL;
|
||||||
|
PS(send_cookie) = 1;
|
||||||
|
} else {
|
||||||
|
convert_to_string(ppid);
|
||||||
|
PS(id) = STR_INIT(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0);
|
||||||
|
PS(send_cookie) = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
|
PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
|
||||||
{
|
{
|
||||||
|
@ -1502,9 +1509,8 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
|
||||||
Z_TYPE_P(data) == IS_ARRAY &&
|
Z_TYPE_P(data) == IS_ARRAY &&
|
||||||
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
|
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
|
||||||
) {
|
) {
|
||||||
PPID2SID;
|
ppid2sid(ppid TSRMLS_CC);
|
||||||
PS(apply_trans_sid) = 0;
|
PS(apply_trans_sid) = 0;
|
||||||
PS(send_cookie) = 0;
|
|
||||||
PS(define_sid) = 0;
|
PS(define_sid) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1513,8 +1519,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
|
||||||
Z_TYPE_P(data) == IS_ARRAY &&
|
Z_TYPE_P(data) == IS_ARRAY &&
|
||||||
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
|
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
|
||||||
) {
|
) {
|
||||||
PPID2SID;
|
ppid2sid(ppid TSRMLS_CC);
|
||||||
PS(send_cookie) = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PS(use_only_cookies) && !PS(id) &&
|
if (!PS(use_only_cookies) && !PS(id) &&
|
||||||
|
@ -1522,8 +1527,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
|
||||||
Z_TYPE_P(data) == IS_ARRAY &&
|
Z_TYPE_P(data) == IS_ARRAY &&
|
||||||
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
|
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
|
||||||
) {
|
) {
|
||||||
PPID2SID;
|
ppid2sid(ppid TSRMLS_CC);
|
||||||
PS(send_cookie) = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
ext/session/tests/bug66827.phpt
Normal file
12
ext/session/tests/bug66827.phpt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #66827: Session raises E_NOTICE when session name variable is array.
|
||||||
|
--INI--
|
||||||
|
--SKIPIF--
|
||||||
|
<?php include('skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$_COOKIE[session_name()] = array();
|
||||||
|
session_start();
|
||||||
|
echo 'OK';
|
||||||
|
--EXPECTF--
|
||||||
|
OK
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#if defined(PHP_WIN32) && !defined(HAVE_ATOLL)
|
#if defined(PHP_WIN32) && !defined(HAVE_ATOLL)
|
||||||
# define atoll(s) _atoi64(s)
|
# define atoll(s) _atoi64(s)
|
||||||
|
# define HAVE_ATOLL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEBUG_FILE_UPLOAD ZEND_DEBUG
|
#define DEBUG_FILE_UPLOAD ZEND_DEBUG
|
||||||
|
|
|
@ -584,14 +584,41 @@ if test "$PHP_FPM" != "no"; then
|
||||||
[ --with-fpm-systemd Activate systemd integration], no, no)
|
[ --with-fpm-systemd Activate systemd integration], no, no)
|
||||||
|
|
||||||
if test "$PHP_FPM_SYSTEMD" != "no" ; then
|
if test "$PHP_FPM_SYSTEMD" != "no" ; then
|
||||||
AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
|
if test -z "$PKG_CONFIG"; then
|
||||||
|
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||||
|
fi
|
||||||
|
unset SYSTEMD_LIBS
|
||||||
|
unset SYSTEMD_INCS
|
||||||
|
|
||||||
|
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd; then
|
||||||
|
dnl systemd version >= 209 provides libsystemd
|
||||||
|
AC_MSG_CHECKING([for libsystemd])
|
||||||
|
SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd`
|
||||||
|
SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd`
|
||||||
|
SYSTEMD_VERS=`$PKG_CONFIG --modversion libsystemd`
|
||||||
|
AC_MSG_RESULT([version $SYSTEMD_VERS])
|
||||||
|
|
||||||
|
elif test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd-daemon; then
|
||||||
|
dnl systemd version < 209 provides libsystemd-daemon
|
||||||
|
AC_MSG_CHECKING([for libsystemd-daemon])
|
||||||
|
SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd-daemon`
|
||||||
|
SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd-daemon`
|
||||||
|
SYSTEMD_VERS=`$PKG_CONFIG --modversion libsystemd-daemon`
|
||||||
|
AC_MSG_RESULT([version $SYSTEMD_VERS])
|
||||||
|
|
||||||
|
else
|
||||||
|
dnl failback when no pkg-config
|
||||||
|
AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"])
|
AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"])
|
||||||
if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then
|
if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then
|
||||||
AC_MSG_ERROR([Your system does not support systemd.])
|
AC_MSG_ERROR([Your system does not support systemd.])
|
||||||
else
|
else
|
||||||
AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration])
|
AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration])
|
||||||
PHP_FPM_SD_FILES="fpm/fpm_systemd.c"
|
PHP_FPM_SD_FILES="fpm/fpm_systemd.c"
|
||||||
PHP_ADD_LIBRARY(systemd-daemon)
|
PHP_EVAL_LIBLINE($SYSTEMD_LIBS)
|
||||||
|
PHP_EVAL_INCLINE($SYSTEMD_INCS)
|
||||||
php_fpm_systemd=notify
|
php_fpm_systemd=notify
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
@ -183,7 +183,7 @@ msi-installer: dist
|
||||||
# need to redirect, since INSTALL is a file in the root...
|
# need to redirect, since INSTALL is a file in the root...
|
||||||
install: really-install install-sdk
|
install: really-install install-sdk
|
||||||
|
|
||||||
build-lib:
|
build-lib: build-ext-libs
|
||||||
@if not exist $(BUILD_DIR_DEV)\lib mkdir $(BUILD_DIR_DEV)\lib >nul
|
@if not exist $(BUILD_DIR_DEV)\lib mkdir $(BUILD_DIR_DEV)\lib >nul
|
||||||
@copy $(BUILD_DIR)\$(PHPLIB) $(BUILD_DIR_DEV)\lib /y >nul
|
@copy $(BUILD_DIR)\$(PHPLIB) $(BUILD_DIR_DEV)\lib /y >nul
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,11 @@ if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {
|
||||||
ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
|
ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PHP_PREFIX == '') {
|
||||||
|
PHP_PREFIX = "C:\\php";
|
||||||
|
if (PHP_DEBUG == "yes")
|
||||||
|
PHP_PREFIX += "\\debug";
|
||||||
|
}
|
||||||
DEFINE('PHP_PREFIX', PHP_PREFIX);
|
DEFINE('PHP_PREFIX', PHP_PREFIX);
|
||||||
|
|
||||||
DEFINE("BASE_INCLUDES", "/I " + PHP_DIR + "/include /I " + PHP_DIR + "/include/main /I " + PHP_DIR + "/include/Zend /I " + PHP_DIR + "/include/TSRM /I " + PHP_DIR + "/include/ext ");
|
DEFINE("BASE_INCLUDES", "/I " + PHP_DIR + "/include /I " + PHP_DIR + "/include/main /I " + PHP_DIR + "/include/Zend /I " + PHP_DIR + "/include/TSRM /I " + PHP_DIR + "/include/ext ");
|
||||||
|
|
|
@ -1364,9 +1364,6 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
|
||||||
if (MODE_PHPIZE && FSO.FileExists(PHP_DIR + "/include/main/config.pickle.h")) {
|
if (MODE_PHPIZE && FSO.FileExists(PHP_DIR + "/include/main/config.pickle.h")) {
|
||||||
cflags = "/FI main/config.pickle.h " + cflags;
|
cflags = "/FI main/config.pickle.h " + cflags;
|
||||||
}
|
}
|
||||||
if (MODE_PHPIZE && FSO.FileExists(PHP_DIR + "/include/main/config.pickle.h")) {
|
|
||||||
cflags = "/FI main/config.pickle.h " + cflags;
|
|
||||||
}
|
|
||||||
ADD_FLAG("CFLAGS_" + EXT, cflags);
|
ADD_FLAG("CFLAGS_" + EXT, cflags);
|
||||||
|
|
||||||
if (PHP_DSP != "no") {
|
if (PHP_DSP != "no") {
|
||||||
|
@ -1905,6 +1902,7 @@ function generate_phpize()
|
||||||
|
|
||||||
var MF = FSO.CreateTextFile(dest + "/phpize.js", true);
|
var MF = FSO.CreateTextFile(dest + "/phpize.js", true);
|
||||||
var DEPS = FSO.CreateTextFile(dest + "/ext_deps.js", true);
|
var DEPS = FSO.CreateTextFile(dest + "/ext_deps.js", true);
|
||||||
|
|
||||||
prefix = get_define("PHP_PREFIX");
|
prefix = get_define("PHP_PREFIX");
|
||||||
prefix = prefix.replace(new RegExp("/", "g"), "\\");
|
prefix = prefix.replace(new RegExp("/", "g"), "\\");
|
||||||
prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\");
|
prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\");
|
||||||
|
@ -1990,8 +1988,21 @@ function generate_makefile()
|
||||||
for (var i in extensions_enabled) {
|
for (var i in extensions_enabled) {
|
||||||
var lib = "php_" + extensions_enabled[i][0] + ".lib";
|
var lib = "php_" + extensions_enabled[i][0] + ".lib";
|
||||||
var dll = "php_" + extensions_enabled[i][0] + ".dll";
|
var dll = "php_" + extensions_enabled[i][0] + ".dll";
|
||||||
MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib\\" + lib);
|
MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib");
|
||||||
//MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)\\" + dll);
|
MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MF.WriteBlankLines(1);
|
||||||
|
MF.WriteLine("build-ext-libs:");
|
||||||
|
MF.WriteLine(" @if not exist $(BUILD_DIR_DEV)\\lib mkdir $(BUILD_DIR_DEV)\\lib >nul");
|
||||||
|
for (var i in extensions_enabled) {
|
||||||
|
var lib;
|
||||||
|
|
||||||
|
lib = "php_" + extensions_enabled[i][0] + "*.lib";
|
||||||
|
|
||||||
|
if ('shared' == extensions_enabled[i][1]) {
|
||||||
|
MF.WriteLine(" @if exist $(BUILD_DIR)\\" + lib + " copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TF.Close();
|
TF.Close();
|
||||||
|
|
|
@ -40,9 +40,13 @@ function ERROR(msg)
|
||||||
|
|
||||||
function file_get_contents(filename)
|
function file_get_contents(filename)
|
||||||
{
|
{
|
||||||
|
var t = "";
|
||||||
var F = FSO.OpenTextFile(filename, 1);
|
var F = FSO.OpenTextFile(filename, 1);
|
||||||
var t = F.ReadAll();
|
|
||||||
F.Close();
|
if (!F.AtEndOfStream) {
|
||||||
|
t = F.ReadAll();
|
||||||
|
F.Close();
|
||||||
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue