Browse Source

Merge branch 'PHP-5.5' into PHP-5.6

pull/743/head
Xinchen Hui 12 years ago
parent
commit
9bef96d96e
  1. 4
      Zend/zend_opcode.c
  2. 22
      ext/session/session.c
  3. 12
      ext/session/tests/bug66827.phpt
  4. 2
      win32/build/Makefile
  5. 5
      win32/build/config.w32.phpize.in
  6. 18
      win32/build/confutils.js
  7. 8
      win32/build/phpize.js.in

4
Zend/zend_opcode.c

@ -625,10 +625,10 @@ static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint op_num TSR
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:

22
ext/session/session.c

@ -1444,9 +1444,16 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{
} }
/* }}} */ /* }}} */
#define PPID2SID \
convert_to_string((*ppid)); \
PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid))
static void ppid2sid(zval **ppid TSRMLS_DC) {
if (Z_TYPE_PP(ppid) != IS_STRING) {
PS(id) = NULL;
PS(send_cookie) = 1;
} else {
convert_to_string((*ppid));
PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid));
PS(send_cookie) = 0;
}
}
PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */ PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
{ {
@ -1540,9 +1547,8 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_PP(data) == IS_ARRAY && Z_TYPE_PP(data) == IS_ARRAY &&
zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
) { ) {
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;
} }
@ -1551,8 +1557,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_PP(data) == IS_ARRAY && Z_TYPE_PP(data) == IS_ARRAY &&
zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
) { ) {
PPID2SID;
PS(send_cookie) = 0;
ppid2sid(ppid TSRMLS_CC);
} }
if (!PS(use_only_cookies) && !PS(id) && if (!PS(use_only_cookies) && !PS(id) &&
@ -1560,8 +1565,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_PP(data) == IS_ARRAY && Z_TYPE_PP(data) == IS_ARRAY &&
zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
) { ) {
PPID2SID;
PS(send_cookie) = 0;
ppid2sid(ppid TSRMLS_CC);
} }
} }

12
ext/session/tests/bug66827.phpt

@ -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

2
win32/build/Makefile

@ -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

5
win32/build/config.w32.phpize.in

@ -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 ");

18
win32/build/confutils.js

@ -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,18 @@ 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)\\" + dll + " $(PHP_PREFIX)\\" + dll);
MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib");
MF.WriteLine(" @copy $(BUILD_DIR)\\" + dll + " $(PHP_PREFIX)");
}
} else {
MF.WriteBlankLines(1);
MF.WriteLine("build-ext-libs:");
for (var i in extensions_enabled) {
var lib = "php_" + extensions_enabled[i][0] + ".lib";
if ('shared' == extensions_enabled[i][1]) {
MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib");
}
} }
} }
TF.Close(); TF.Close();

8
win32/build/phpize.js.in

@ -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…
Cancel
Save