summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2016-11-30 02:57:16 +0100
committerBob Weinand <bobwei9@hotmail.com>2016-11-30 02:57:16 +0100
commit7aaa1a876e82484c0c491c48efeda69dcc79507d (patch)
tree17f93a9b9b99e931508851be83566dcff131ebca
parentcabcf8971f849ed72562916f7c113608568650c6 (diff)
parentb73a3afff333143b2908b280e6a4e26d61cb3138 (diff)
downloadphp-git-7aaa1a876e82484c0c491c48efeda69dcc79507d.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
-rw-r--r--sapi/phpdbg/phpdbg.c4
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c6
-rw-r--r--sapi/phpdbg/tests/bug73615.phpt18
-rw-r--r--sapi/phpdbg/tests/bug73615/.phpdbginit2
4 files changed, 24 insertions, 6 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index b47c7c82b3..dc7422fcae 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1893,9 +1893,7 @@ phpdbg_main:
/* initialize from file */
PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING;
zend_try {
- if (init_file) {
- phpdbg_init(init_file, init_file_len, init_file_default);
- }
+ phpdbg_init(init_file, init_file_len, init_file_default);
} zend_end_try();
PHPDBG_G(flags) &= ~PHPDBG_IS_INITIALIZING;
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 35ee4332cd..da2cdfb738 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -348,7 +348,9 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_
void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */
{
- if (!init_file && use_default) {
+ if (init_file) {
+ phpdbg_try_file_init(init_file, init_file_len, 1);
+ } else if (use_default) {
char *scan_dir = getenv("PHP_INI_SCAN_DIR");
char *sys_ini;
int i;
@@ -381,8 +383,6 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /
}
phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0);
- } else {
- phpdbg_try_file_init(init_file, init_file_len, 1);
}
}
/* }}} */
diff --git a/sapi/phpdbg/tests/bug73615.phpt b/sapi/phpdbg/tests/bug73615.phpt
new file mode 100644
index 0000000000..ade957e50e
--- /dev/null
+++ b/sapi/phpdbg/tests/bug73615.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #73615 (phpdbg without option never load .phpdbginit at startup)
+--SKIPIF--
+<?php
+if (!getenv('TEST_PHPDBG_EXECUTABLE')) die("No TEST_PHPDBG_EXECUTABLE specified");
+?>
+--FILE--
+<?php
+
+$phpdbg = getenv('TEST_PHPDBG_EXECUTABLE');
+
+chdir(__DIR__."/bug73615");
+
+print `$phpdbg -qn`;
+
+?>
+--EXPECT--
+Executed .phpdbginit
diff --git a/sapi/phpdbg/tests/bug73615/.phpdbginit b/sapi/phpdbg/tests/bug73615/.phpdbginit
new file mode 100644
index 0000000000..29184ddf7c
--- /dev/null
+++ b/sapi/phpdbg/tests/bug73615/.phpdbginit
@@ -0,0 +1,2 @@
+ev "Executed .phpdbginit"
+q