summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-25 10:52:41 +0800
committerXinchen Hui <laruence@php.net>2014-07-25 10:52:41 +0800
commit235d0241d1264085c2e24b0ed02d1fdff35b2313 (patch)
tree03fe0c69324b9250919f5f82492f60ce833940aa
parent1d2f232bd29dd29045c7389cf9d23b1ad2fd4db8 (diff)
parent4ae1d5d1bd34cb5bb255ffdc6c8e96ce25e70fcf (diff)
downloadphp-git-235d0241d1264085c2e24b0ed02d1fdff35b2313.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
-rw-r--r--.gitattributes4
-rw-r--r--ext/readline/readline_cli.c17
-rw-r--r--sapi/fpm/config.m431
-rw-r--r--win32/build/confutils.js7
4 files changed, 53 insertions, 6 deletions
diff --git a/.gitattributes b/.gitattributes
index 79b218fcba..091043a35b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -22,6 +22,10 @@ sapi/nsapi/nsapi.c ident
sapi/continuity/capi.c ident
Zend/RFCs/002.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
UPGRADING merge=NEWS
UPGRADING.INTERNALS merge=NEWS
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
index c2bf8764cb..9c27acb193 100644
--- a/ext/readline/readline_cli.c
+++ b/ext/readline/readline_cli.c
@@ -99,6 +99,9 @@ static size_t readline_shell_write(const char *str, uint str_length TSRMLS_DC) /
static int readline_shell_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */
{
+ /* We just store the last char here and then pass back to the
+ caller (sapi_cli_single_write in sapi/cli) which will actually
+ write due to -1 return code */
php_last_char = str[str_length-1];
return -1;
}
@@ -587,6 +590,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
char *code = emalloc(size);
char *prompt = cli_get_prompt("php", '>' TSRMLS_CC);
char *history_file;
+ int history_lines_to_write = 0;
if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) {
zend_file_handle *prepend_file_p;
@@ -651,6 +655,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
if (*line) {
add_history(line);
+ history_lines_to_write += 1;
}
free(line);
@@ -660,6 +665,15 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
continue;
}
+ if (history_lines_to_write) {
+#if HAVE_LIBEDIT
+ write_history(history_file);
+#else
+ append_history(history_lines_to_write, history_file);
+#endif
+ history_lines_to_write = 0;
+ }
+
zend_try {
zend_eval_stringl(code, pos, NULL, "php shell code" TSRMLS_CC);
} zend_end_try();
@@ -667,7 +681,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
pos = 0;
if (!pager_pipe && php_last_char != '\0' && php_last_char != '\n') {
- readline_shell_write("\n", 1 TSRMLS_CC);
+ php_write("\n", 1 TSRMLS_CC);
}
if (EG(exception)) {
@@ -681,7 +695,6 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
php_last_char = '\0';
}
- write_history(history_file);
free(history_file);
efree(code);
efree(prompt);
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index 40cd69c719..9c10aa6be2 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -584,14 +584,41 @@ if test "$PHP_FPM" != "no"; then
[ --with-fpm-systemd Activate systemd integration], no, no)
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"])
if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then
AC_MSG_ERROR([Your system does not support systemd.])
else
AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration])
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
fi
else
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 203013e2f0..489adf34a8 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1994,11 +1994,14 @@ function generate_makefile()
} 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 = "php_" + extensions_enabled[i][0] + ".lib";
+ var lib;
+
+ lib = "php_" + extensions_enabled[i][0] + "*.lib";
if ('shared' == extensions_enabled[i][1]) {
- MF.WriteLine(" @copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib");
+ MF.WriteLine(" @if exist $(BUILD_DIR)\\" + lib + " copy $(BUILD_DIR)\\" + lib + " $(BUILD_DIR_DEV)\\lib");
}
}
}