summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-rw-r--r--sapi/apache2handler/php_apache.h4
-rw-r--r--sapi/apache2handler/php_functions.c6
-rw-r--r--sapi/apache2handler/sapi_apache2.c15
-rw-r--r--sapi/cgi/cgi_main.c12
-rw-r--r--sapi/cgi/tests/002.phpt10
-rw-r--r--sapi/cgi/tests/007.phpt2
-rw-r--r--sapi/cli/config.m43
-rw-r--r--sapi/cli/php_cli.c23
-rw-r--r--sapi/cli/php_cli_server.c6
-rw-r--r--sapi/cli/tests/015.phpt2
-rw-r--r--sapi/fpm/.gitignore4
-rw-r--r--sapi/fpm/fpm/fpm_conf.c26
-rw-r--r--sapi/fpm/fpm/fpm_conf.h1
-rw-r--r--sapi/fpm/fpm/fpm_main.c8
-rw-r--r--sapi/fpm/fpm/fpm_php_trace.c4
-rw-r--r--sapi/fpm/www.conf.in4
-rw-r--r--sapi/litespeed/lsapi_main.c4
-rw-r--r--sapi/phpdbg/phpdbg.c4
-rw-r--r--sapi/phpdbg/phpdbg_bp.c11
-rw-r--r--sapi/phpdbg/phpdbg_bp.h5
-rw-r--r--sapi/phpdbg/phpdbg_help.c6
-rw-r--r--sapi/phpdbg/phpdbg_list.c24
-rw-r--r--sapi/phpdbg/phpdbg_list.h6
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c27
-rw-r--r--sapi/phpdbg/tests/stdin_001.phpt8
25 files changed, 116 insertions, 109 deletions
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h
index 69c01bbe02..94ef7d83f0 100644
--- a/sapi/apache2handler/php_apache.h
+++ b/sapi/apache2handler/php_apache.h
@@ -46,11 +46,7 @@ typedef struct php_struct {
request_rec *r;
apr_bucket_brigade *brigade;
/* stat structure of the current file */
-#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
- struct stat_libc finfo;
-#else
zend_stat_t finfo;
-#endif
/* Whether or not we've processed PHP in the output filters yet. */
int request_processed;
/* final content type */
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index 9ba09da66e..673fde98a9 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -42,7 +42,7 @@
#include "util_script.h"
#include "http_core.h"
#include "ap_mpm.h"
-#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
+#if !defined(WIN32) && !defined(WINNT)
#include "unixd.h"
#endif
@@ -371,7 +371,7 @@ PHP_MINFO_FUNCTION(apache)
int n, max_requests;
char *p;
server_rec *serv = ((php_struct *) SG(server_context))->r->server;
-#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
+#if !defined(WIN32) && !defined(WINNT)
#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;
#else
@@ -410,7 +410,7 @@ PHP_MINFO_FUNCTION(apache)
snprintf(tmp, sizeof(tmp), "%s:%u", serv->server_hostname, serv->port);
php_info_print_table_row(2, "Hostname:Port", tmp);
-#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)
+#if !defined(WIN32) && !defined(WINNT)
#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
#else
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 12a9e71716..9f06588674 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -31,11 +31,7 @@
#include <fcntl.h>
#include "zend_smart_str.h"
-#ifndef NETWARE
#include "ext/standard/php_standard.h"
-#else
-#include "ext/standard/basic_functions.h"
-#endif
#include "apr_strings.h"
#include "ap_config.h"
@@ -53,9 +49,9 @@
#include "php_apache.h"
-/* UnixWare and Netware define shutdown to _shutdown, which causes problems later
+/* UnixWare define shutdown to _shutdown, which causes problems later
* on when using a structure member named shutdown. Since this source
- * file does not use the system call shutdown, it is safe to #undef it.K
+ * file does not use the system call shutdown, it is safe to #undef it.
*/
#undef shutdown
@@ -259,16 +255,9 @@ php_apache_sapi_get_stat(void)
#endif
ctx->finfo.st_dev = ctx->r->finfo.device;
ctx->finfo.st_ino = ctx->r->finfo.inode;
-#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
- ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime);
- ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime);
- ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime);
-#else
ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime);
ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime);
ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime);
-#endif
-
ctx->finfo.st_size = ctx->r->finfo.size;
ctx->finfo.st_nlink = ctx->r->finfo.nlink;
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 0b6deb10e8..a7eb312fd6 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1774,16 +1774,6 @@ int main(int argc, char *argv[])
char *decoded_query_string;
int skip_getopt = 0;
-#if 0 && defined(PHP_DEBUG)
- /* IIS is always making things more difficult. This allows
- * us to stop PHP and attach a debugger before much gets started */
- {
- char szMessage [256];
- wsprintf (szMessage, "Please attach a debugger to the process 0x%X [%d] (%s) and click OK", GetCurrentProcessId(), GetCurrentProcessId(), argv[0]);
- MessageBox(NULL, szMessage, "CGI Debug Time!", MB_OK|MB_SERVICE_NOTIFICATION);
- }
-#endif
-
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
@@ -2431,7 +2421,7 @@ consult the installation file that came with this distribution, or visit \n\
file_handle.filename = SG(request_info).path_translated;
file_handle.handle.fp = NULL;
} else {
- file_handle.filename = "-";
+ file_handle.filename = "Standard input code";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
}
diff --git a/sapi/cgi/tests/002.phpt b/sapi/cgi/tests/002.phpt
index 884e6521e2..fda8fcbe04 100644
--- a/sapi/cgi/tests/002.phpt
+++ b/sapi/cgi/tests/002.phpt
@@ -31,22 +31,22 @@ echo "Done\n";
string(%d) "X-Powered-By: PHP/%s
Content-type: text/html%r; charset=.*|%r
-%unicode|string%(3) "111"
+string(3) "111"
"
string(%d) "X-Powered-By: PHP/%s
Content-type: text/html%r; charset=.*|%r
-%unicode|string%(3) "500"
+string(3) "500"
"
string(%d) "X-Powered-By: PHP/%s
Content-type: text/html%r; charset=.*|%r
-%unicode|string%(3) "555"
+string(3) "555"
"
string(%d) "X-Powered-By: PHP/%s
Content-type: text/html%r; charset=.*|%r
-%unicode|string%(3) "555"
-%unicode|string%(10) "/test/path"
+string(3) "555"
+string(10) "/test/path"
"
Done
diff --git a/sapi/cgi/tests/007.phpt b/sapi/cgi/tests/007.phpt
index f2c9c0226c..841137a046 100644
--- a/sapi/cgi/tests/007.phpt
+++ b/sapi/cgi/tests/007.phpt
@@ -17,6 +17,6 @@ var_dump(`"$php" -n -s -w -l`);
--EXPECTF--
string(25) "No input file specified.
"
-string(31) "No syntax errors detected in -
+string(49) "No syntax errors detected in Standard input code
"
===DONE===
diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4
index 04db2fecee..21681512a7 100644
--- a/sapi/cli/config.m4
+++ b/sapi/cli/config.m4
@@ -44,9 +44,6 @@ if test "$PHP_CLI" != "no"; then
*darwin*)
BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_BINARY_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
;;
- *netware*)
- BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp7lib -o \$(SAPI_CLI_PATH)"
- ;;
*)
BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_BINARY_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
;;
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 6a07878775..0c34afaac4 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -38,6 +38,7 @@
#ifdef PHP_WIN32
#include "win32/time.h"
#include "win32/signal.h"
+#include "win32/console.h"
#include <process.h>
#include <shellapi.h>
#endif
@@ -243,6 +244,9 @@ static void print_extensions(void) /* {{{ */
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
static inline int sapi_cli_select(int fd)
{
@@ -944,7 +948,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
/* here but this would make things only more complicated. And it */
/* is consitent with the way -R works where the stdin file handle*/
/* is also accessible. */
- file_handle.filename = "-";
+ file_handle.filename = "Standard input code";
file_handle.handle.fp = stdin;
}
file_handle.type = ZEND_HANDLE_FP;
@@ -983,7 +987,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
PG(during_request_startup) = 0;
switch (behavior) {
case PHP_MODE_STANDARD:
- if (strcmp(file_handle.filename, "-")) {
+ if (strcmp(file_handle.filename, "Standard input code")) {
cli_register_file_handles();
}
@@ -1125,7 +1129,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
}
case PHP_MODE_REFLECTION_EXT_INFO:
{
- int len = (int)strlen(reflection_what);
+ size_t len = strlen(reflection_what);
char *lcname = zend_str_tolower_dup(reflection_what, len);
zend_module_entry *module;
@@ -1201,7 +1205,7 @@ int main(int argc, char *argv[])
int php_optind = 1, use_extended_info = 0;
char *ini_path_override = NULL;
char *ini_entries = NULL;
- int ini_entries_len = 0;
+ size_t ini_entries_len = 0;
int ini_ignore = 0;
sapi_module_struct *sapi_module = &cli_sapi_module;
@@ -1211,6 +1215,11 @@ int main(int argc, char *argv[])
*/
argv = save_ps_args(argc, argv);
+#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE)
+ php_win32_console_fileno_set_vt100(STDOUT_FILENO, TRUE);
+ php_win32_console_fileno_set_vt100(STDERR_FILENO, TRUE);
+#endif
+
cli_sapi_module.additional_functions = additional_functions;
#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP)
@@ -1270,7 +1279,7 @@ int main(int argc, char *argv[])
break;
case 'd': {
/* define ini entries on command line */
- int len = (int)strlen(php_optarg);
+ size_t len = strlen(php_optarg);
char *val;
if ((val = strchr(php_optarg, '='))) {
@@ -1278,11 +1287,11 @@ int main(int argc, char *argv[])
if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') {
ini_entries = realloc(ini_entries, ini_entries_len + len + sizeof("\"\"\n\0"));
memcpy(ini_entries + ini_entries_len, php_optarg, (val - php_optarg));
- ini_entries_len += (int)(val - php_optarg);
+ ini_entries_len += (val - php_optarg);
memcpy(ini_entries + ini_entries_len, "\"", 1);
ini_entries_len++;
memcpy(ini_entries + ini_entries_len, val, len - (val - php_optarg));
- ini_entries_len += len - (int)(val - php_optarg);
+ ini_entries_len += len - (val - php_optarg);
memcpy(ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0"));
ini_entries_len += sizeof("\n\0\"") - 2;
} else {
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 0853db99bb..ac4dcb8b9a 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -410,7 +410,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{
do {
p++;
} while (*p == ' ' || *p == '\t');
- add_assoc_stringl_ex(return_value, s, (uint)len, p, h->header_len - (p - h->header));
+ add_assoc_stringl_ex(return_value, s, (uint32_t)len, p, h->header_len - (p - h->header));
free_alloca(s, use_heap);
}
}
@@ -604,7 +604,7 @@ static int sapi_cli_server_register_entry_cb(char **entry, int num_args, va_list
zval *track_vars_array = va_arg(args, zval *);
if (hash_key->key) {
char *real_key, *key;
- uint i;
+ uint32_t i;
key = estrndup(ZSTR_VAL(hash_key->key), ZSTR_LEN(hash_key->key));
for(i=0; i<ZSTR_LEN(hash_key->key); i++) {
if (key[i] == '-') {
@@ -1458,7 +1458,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
}
#ifdef PHP_WIN32
{
- uint i = 0;
+ uint32_t i = 0;
for (;i<request->vpath_len;i++) {
if (request->vpath[i] == '\\') {
request->vpath[i] = '/';
diff --git a/sapi/cli/tests/015.phpt b/sapi/cli/tests/015.phpt
index ab5918b4d2..62a007b6e4 100644
--- a/sapi/cli/tests/015.phpt
+++ b/sapi/cli/tests/015.phpt
@@ -24,7 +24,7 @@ echo "Done\n";
PHP %d.%d.%d%s(cli) (built: %s)%s
Array
(
- [0] => -
+ [0] => Standard input code
[1] => foo
[2] => bar
[3] => baz
diff --git a/sapi/fpm/.gitignore b/sapi/fpm/.gitignore
new file mode 100644
index 0000000000..3f8c0913a4
--- /dev/null
+++ b/sapi/fpm/.gitignore
@@ -0,0 +1,4 @@
+php-fpm.8
+php-fpm.service
+status.html
+www.conf
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index b497d2c82c..c9a946155a 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -146,6 +146,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
{ "access.format", &fpm_conf_set_string, WPO(access_format) },
{ "slowlog", &fpm_conf_set_string, WPO(slowlog) },
{ "request_slowlog_timeout", &fpm_conf_set_time, WPO(request_slowlog_timeout) },
+ { "request_slowlog_trace_depth", &fpm_conf_set_integer, WPO(request_slowlog_trace_depth) },
{ "request_terminate_timeout", &fpm_conf_set_time, WPO(request_terminate_timeout) },
{ "rlimit_files", &fpm_conf_set_integer, WPO(rlimit_files) },
{ "rlimit_core", &fpm_conf_set_rlimit_core, WPO(rlimit_core) },
@@ -970,6 +971,30 @@ static int fpm_conf_process_all_pools() /* {{{ */
}
}
+ /* request_slowlog_trace_depth */
+ if (wp->config->request_slowlog_trace_depth) {
+#if HAVE_FPM_TRACE
+ if (! (wp->config->slowlog && *wp->config->slowlog)) {
+ zlog(ZLOG_ERROR, "[pool %s] 'slowlog' must be specified for use with 'request_slowlog_trace_depth'", wp->config->name);
+ return -1;
+ }
+#else
+ static int warned = 0;
+
+ if (!warned) {
+ zlog(ZLOG_WARNING, "[pool %s] 'request_slowlog_trace_depth' is not supported on your system", wp->config->name);
+ warned = 1;
+ }
+#endif
+
+ if (wp->config->request_slowlog_trace_depth <= 0) {
+ zlog(ZLOG_ERROR, "[pool %s] 'request_slowlog_trace_depth' (%d) must be a positive value", wp->config->name, wp->config->request_slowlog_trace_depth);
+ return -1;
+ }
+ } else {
+ wp->config->request_slowlog_trace_depth = 20;
+ }
+
/* chroot */
if (wp->config->chroot && *wp->config->chroot) {
@@ -1635,6 +1660,7 @@ static void fpm_conf_dump() /* {{{ */
zlog(ZLOG_NOTICE, "\taccess.format = %s", STR2STR(wp->config->access_format));
zlog(ZLOG_NOTICE, "\tslowlog = %s", STR2STR(wp->config->slowlog));
zlog(ZLOG_NOTICE, "\trequest_slowlog_timeout = %ds", wp->config->request_slowlog_timeout);
+ zlog(ZLOG_NOTICE, "\trequest_slowlog_trace_depth = %d", wp->config->request_slowlog_trace_depth);
zlog(ZLOG_NOTICE, "\trequest_terminate_timeout = %ds", wp->config->request_terminate_timeout);
zlog(ZLOG_NOTICE, "\trlimit_files = %d", wp->config->rlimit_files);
zlog(ZLOG_NOTICE, "\trlimit_core = %d", wp->config->rlimit_core);
diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h
index 540b22795d..d56fcc4e78 100644
--- a/sapi/fpm/fpm/fpm_conf.h
+++ b/sapi/fpm/fpm/fpm_conf.h
@@ -78,6 +78,7 @@ struct fpm_worker_pool_config_s {
char *access_format;
char *slowlog;
int request_slowlog_timeout;
+ int request_slowlog_trace_depth;
int request_terminate_timeout;
int rlimit_files;
int rlimit_core;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 676811359c..2ed2d34f87 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -280,7 +280,7 @@ static void print_extensions(void) /* {{{ */
#define STDOUT_FILENO 1
#endif
-static inline size_t sapi_cgibin_single_write(const char *str, uint str_length) /* {{{ */
+static inline size_t sapi_cgibin_single_write(const char *str, uint32_t str_length) /* {{{ */
{
ssize_t ret;
@@ -310,7 +310,7 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length)
static size_t sapi_cgibin_ub_write(const char *str, size_t str_length) /* {{{ */
{
const char *ptr = str;
- uint remaining = str_length;
+ uint32_t remaining = str_length;
size_t ret;
while (remaining > 0) {
@@ -473,7 +473,7 @@ void fcgi_log(int type, const char *fmt, ...)
static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes) /* {{{ */
{
- uint read_bytes = 0;
+ uint32_t read_bytes = 0;
int tmp_read_bytes;
size_t remaining = SG(request_info).content_length - SG(read_post_bytes);
@@ -745,7 +745,7 @@ static int sapi_cgi_activate(void) /* {{{ */
{
fcgi_request *request = (fcgi_request*) SG(server_context);
char *path, *doc_root, *server_name;
- uint path_len, doc_root_len, server_name_len;
+ uint32_t path_len, doc_root_len, server_name_len;
/* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */
if (!SG(request_info).path_translated) {
diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c
index e6482b6380..a48f90ad81 100644
--- a/sapi/fpm/fpm/fpm_php_trace.c
+++ b/sapi/fpm/fpm/fpm_php_trace.c
@@ -42,7 +42,7 @@
static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ */
{
- int callers_limit = 20;
+ int callers_limit = child->wp->config->request_slowlog_trace_depth;
pid_t pid = child->pid;
struct timeval tv;
static const int buf_size = 1024;
@@ -80,7 +80,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ *
long function_name;
long file_name;
long prev;
- uint lineno = 0;
+ uint32_t lineno = 0;
if (0 > fpm_trace_get_long(execute_data + offsetof(zend_execute_data, func), &l)) {
return -1;
diff --git a/sapi/fpm/www.conf.in b/sapi/fpm/www.conf.in
index beddb1e2ef..e2c14f1316 100644
--- a/sapi/fpm/www.conf.in
+++ b/sapi/fpm/www.conf.in
@@ -322,6 +322,10 @@ pm.max_spare_servers = 3
; Default Value: 0
;request_slowlog_timeout = 0
+; Depth of slow log stack trace.
+; Default Value: 20
+;request_slowlog_trace_depth = 20
+
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 730070fd38..588a14518a 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -687,7 +687,7 @@ static void walk_down_the_path(char* path_start,
typedef struct {
char *path;
- uint path_len;
+ uint32_t path_len;
char *doc_root;
user_config_cache_entry *entry;
} _lsapi_activate_user_ini_ctx;
@@ -816,7 +816,7 @@ static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_c
void* next)
{
time_t request_time = sapi_get_request_time();
- uint path_len, docroot_len;
+ uint32_t path_len, docroot_len;
int rc = SUCCESS;
fn_activate_user_ini_chain_t *fn_next = next;
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 96f1613a59..2a25f10fcc 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -378,7 +378,7 @@ static PHP_FUNCTION(phpdbg_break_file)
return;
}
- phpdbg_set_breakpoint_file(file, line);
+ phpdbg_set_breakpoint_file(file, 0, line);
} /* }}} */
/* {{{ proto void phpdbg_break_method(string class, string method) */
@@ -2094,7 +2094,7 @@ phpdbg_out:
php_request_shutdown(NULL);
} zend_end_try();
- if (PHPDBG_G(exec) && !memcmp("-", PHPDBG_G(exec), 2)) { /* i.e. execution context has been read from stdin - back it up */
+ if (PHPDBG_G(exec) && strcmp("Standard input code", PHPDBG_G(exec)) == SUCCESS) { /* i.e. execution context has been read from stdin - back it up */
phpdbg_file_source *data = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), PHPDBG_G(exec), PHPDBG_G(exec_len));
backup_phpdbg_compile = zend_string_alloc(data->len + 2, 1);
sprintf(ZSTR_VAL(backup_phpdbg_compile), "?>%.*s", (int) data->len, data->buf);
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index 49f74b87a9..fd5589c0d1 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -237,12 +237,7 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */
}
} /* }}} */
-PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num) /* {{{ */
-{
- phpdbg_set_breakpoint_file_ex(path, 0, line_num);
-} /* }}} */
-
-PHPDBG_API void phpdbg_set_breakpoint_file_ex(const char *path, size_t path_len, long line_num) /* {{{ */
+PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, size_t path_len, long line_num) /* {{{ */
{
php_stream_statbuf ssb;
char realpath[MAXPATHLEN];
@@ -329,7 +324,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_ex(const char *path, size_t path_len,
zend_string_release(path_str);
} /* }}} */
-PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht) /* {{{ */
+PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint32_t filelen, zend_string *cur, HashTable *fileht) /* {{{ */
{
phpdbg_debug("file: %s, filelen: %u, cur: %s, curlen %u, pos: %c, memcmp: %d\n", file, filelen, ZSTR_VAL(cur), ZSTR_LEN(cur), filelen > ZSTR_LEN(cur) ? file[filelen - ZSTR_LEN(cur) - 1] : '?', filelen > ZSTR_LEN(cur) ? memcmp(file + filelen - ZSTR_LEN(cur), ZSTR_VAL(cur), ZSTR_LEN(cur)) : 0);
@@ -378,7 +373,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin
PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */
{
HashTable *fileht;
- uint filelen = strlen(file);
+ uint32_t filelen = strlen(file);
zend_string *cur;
phpdbg_debug("was compiled: %s\n", file);
diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h
index b44d5ec74e..4a1f6434bc 100644
--- a/sapi/phpdbg/phpdbg_bp.h
+++ b/sapi/phpdbg/phpdbg_bp.h
@@ -121,12 +121,11 @@ typedef struct _phpdbg_breakcond_t {
PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array);
PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array);
PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break);
-PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht);
+PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint32_t filelen, zend_string *cur, HashTable *fileht);
PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file); /* }}} */
/* {{{ Breakpoint Creation API */
-PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno);
-PHPDBG_API void phpdbg_set_breakpoint_file_ex(const char* filename, size_t path_len, long lineno);
+PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, size_t path_len, long lineno);
PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len);
PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name);
PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len);
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index eb62d76d2e..7f78ddadb6 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -382,8 +382,8 @@ phpdbg_help_text_t phpdbg_help_text[] = {
"Type **help <command>** or (**help alias**) to get detailed help on any of the above commands, "
"for example **help list** or **h l**. Note that help will also match partial commands if unique "
-"(and list out options if not unique), so **help clea** will give help on the **clean** command, "
-"but **help cl** will list the summary for **clean** and **clear**." CR CR
+"(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
"Type **help aliases** to show a full alias list, including any registered phpdginit functions" CR
"Type **help syntax** for a general introduction to the command syntax." CR
@@ -924,7 +924,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
" Enable refcount display when hitting watchpoints" CR CR
" $P S b 4 off" CR
-" Temporarily disable breakpoint 4. This can be subsequently reenabled by a **s b 4 on**." CR
+" Temporarily disable breakpoint 4. This can be subsequently reenabled by a **S b 4 on**." CR
//*********** check oplog syntax
},
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index a1138b4517..2219198cfe 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -129,9 +129,9 @@ PHPDBG_LIST(class) /* {{{ */
return SUCCESS;
} /* }}} */
-void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight) /* {{{ */
+void phpdbg_list_file(zend_string *filename, uint32_t count, int offset, uint32_t highlight) /* {{{ */
{
- uint line, lastline;
+ uint32_t line, lastline;
phpdbg_file_source *data;
if (!(data = zend_hash_find_ptr(&PHPDBG_G(file_sources), filename))) {
@@ -153,8 +153,8 @@ void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highli
phpdbg_xml("<list %r file=\"%s\">", ZSTR_VAL(filename));
for (line = offset; line < lastline;) {
- uint linestart = data->line[line++];
- uint linelen = data->line[line] - linestart;
+ uint32_t linestart = data->line[line++];
+ uint32_t linelen = data->line[line] - linestart;
char *buffer = data->buf + linestart;
if (!highlight) {
@@ -237,7 +237,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
zend_file_handle fake;
zend_op_array *ret;
char *filename;
- uint line;
+ uint32_t line;
char *bufptr, *endptr;
if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
@@ -261,11 +261,11 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
fake.filename = filename;
fake.opened_path = file->opened_path;
- *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * data.len)) = data;
+ *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * data.len)) = data;
for (line = 0, bufptr = data.buf - 1, endptr = data.buf + data.len; ++bufptr < endptr;) {
if (*bufptr == '\n') {
- dataptr->line[++line] = (uint)(bufptr - data.buf) + 1;
+ dataptr->line[++line] = (uint32_t)(bufptr - data.buf) + 1;
}
}
dataptr->lines = ++line;
@@ -283,7 +283,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
return NULL;
}
- dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
+ dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint32_t) * line);
zend_hash_add_ptr(&PHPDBG_G(file_sources), ret->filename, dataptr);
phpdbg_resolve_pending_file_break(ZSTR_VAL(ret->filename));
@@ -335,20 +335,20 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
zend_string *fake_name;
zend_op_array *op_array;
phpdbg_file_source *dataptr;
- uint line;
+ uint32_t line;
char *bufptr, *endptr;
if (PHPDBG_G(flags) & PHPDBG_IN_EVAL) {
return PHPDBG_G(compile_string)(source_string, filename);
}
- dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * Z_STRLEN_P(source_string));
+ dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * Z_STRLEN_P(source_string));
dataptr->buf = estrndup(Z_STRVAL_P(source_string), Z_STRLEN_P(source_string));
dataptr->len = Z_STRLEN_P(source_string);
dataptr->line[0] = 0;
for (line = 0, bufptr = dataptr->buf - 1, endptr = dataptr->buf + dataptr->len; ++bufptr < endptr;) {
if (*bufptr == '\n') {
- dataptr->line[++line] = (uint)(bufptr - dataptr->buf) + 1;
+ dataptr->line[++line] = (uint32_t)(bufptr - dataptr->buf) + 1;
}
}
dataptr->lines = ++line;
@@ -364,7 +364,7 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
fake_name = strpprintf(0, "%s%c%p", filename, 0, op_array->opcodes);
- dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
+ dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint32_t) * line);
zend_hash_add_ptr(&PHPDBG_G(file_sources), fake_name, dataptr);
zend_string_release(fake_name);
diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h
index 9adb69b6c9..2768a42ddd 100644
--- a/sapi/phpdbg/phpdbg_list.h
+++ b/sapi/phpdbg/phpdbg_list.h
@@ -34,7 +34,7 @@ PHPDBG_LIST(func);
void phpdbg_list_function_byname(const char *, size_t);
void phpdbg_list_function(const zend_function *);
-void phpdbg_list_file(zend_string *, uint, int, uint);
+void phpdbg_list_file(zend_string *, uint32_t, int, uint32_t);
extern const phpdbg_command_t phpdbg_list_commands[];
@@ -48,8 +48,8 @@ typedef struct {
void *map;
#endif
zend_op_array op_array;
- uint lines;
- uint line[1];
+ uint32_t lines;
+ uint32_t line[1];
} phpdbg_file_source;
#endif /* PHPDBG_LIST_H */
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 4655702fa8..a96563352d 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -58,9 +58,6 @@ extern int phpdbg_startup_run;
#include "win32/param.h"
#include "win32/winutil.h"
#define GET_DL_ERROR() php_win_err()
-#elif defined(NETWARE)
-#include <sys/param.h>
-#define GET_DL_ERROR() dlerror()
#else
#include <sys/param.h>
#define GET_DL_ERROR() DL_ERROR()
@@ -528,7 +525,7 @@ int phpdbg_compile_stdin(zend_string *code) {
ZVAL_STR(&zv, code);
- PHPDBG_G(ops) = zend_compile_string(&zv, "-");
+ PHPDBG_G(ops) = zend_compile_string(&zv, "Standard input code");
zend_string_release(code);
@@ -539,18 +536,18 @@ int phpdbg_compile_stdin(zend_string *code) {
if (PHPDBG_G(exec)) {
efree(PHPDBG_G(exec));
}
- PHPDBG_G(exec) = estrdup("-");
- PHPDBG_G(exec_len) = 1;
+ PHPDBG_G(exec) = estrdup("Standard input code");
+ PHPDBG_G(exec_len) = sizeof("Standard input code") - 1;
{ /* remove leading ?> from source */
int i;
/* remove trailing data after zero byte, used for avoiding conflicts in eval()'ed code snippets */
- zend_string *source_path = strpprintf(0, "-%c%p", 0, PHPDBG_G(ops)->opcodes);
+ zend_string *source_path = strpprintf(0, "Standard input code%c%p", 0, PHPDBG_G(ops)->opcodes);
phpdbg_file_source *data = zend_hash_find_ptr(&PHPDBG_G(file_sources), source_path);
dtor_func_t dtor = PHPDBG_G(file_sources).pDestructor;
PHPDBG_G(file_sources).pDestructor = NULL;
zend_hash_del(&PHPDBG_G(file_sources), source_path);
PHPDBG_G(file_sources).pDestructor = dtor;
- zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "-", 1, data);
+ zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "Standard input code", sizeof("Standard input code")-1, data);
zend_string_release(source_path);
for (i = 1; i <= data->lines; i++) {
@@ -560,7 +557,7 @@ int phpdbg_compile_stdin(zend_string *code) {
memmove(data->buf, data->buf + 2, data->len);
}
- phpdbg_notice("compile", "context=\"-\"", "Successful compilation of stdin input");
+ phpdbg_notice("compile", "context=\"Standard input code\"", "Successful compilation of stdin input");
return SUCCESS;
}
@@ -611,11 +608,11 @@ int phpdbg_compile(void) /* {{{ */
zend_hash_del(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename);
PHPDBG_G(file_sources).pDestructor = dtor;
- data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint) * ++data->lines);
- memmove(data->line + 1, data->line, sizeof(uint) * data->lines);
+ data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint32_t) * ++data->lines);
+ memmove(data->line + 1, data->line, sizeof(uint32_t) * data->lines);
data->line[0] = 0;
data->buf = erealloc(data->buf, data->len + start_line_len);
- memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint));
+ memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint32_t));
memcpy(data->buf, start_line, start_line_len);
efree(start_line);
data->len += start_line_len;
@@ -1208,7 +1205,7 @@ PHPDBG_COMMAND(break) /* {{{ */
{
if (!param) {
if (PHPDBG_G(exec)) {
- phpdbg_set_breakpoint_file_ex(
+ phpdbg_set_breakpoint_file(
zend_get_executed_filename(),
strlen(zend_get_executed_filename()),
zend_get_executed_lineno());
@@ -1221,7 +1218,7 @@ PHPDBG_COMMAND(break) /* {{{ */
break;
case NUMERIC_PARAM:
if (PHPDBG_G(exec)) {
- phpdbg_set_breakpoint_file_ex(phpdbg_current_file(), strlen(phpdbg_current_file()), param->num);
+ phpdbg_set_breakpoint_file(phpdbg_current_file(), strlen(phpdbg_current_file()), param->num);
} else {
phpdbg_error("inactive", "type=\"noexec\"", "Execution context not set!");
}
@@ -1236,7 +1233,7 @@ PHPDBG_COMMAND(break) /* {{{ */
phpdbg_set_breakpoint_function_opline(param->str, param->num);
break;
case FILE_PARAM:
- phpdbg_set_breakpoint_file(param->file.name, param->file.line);
+ phpdbg_set_breakpoint_file(param->file.name, 0, param->file.line);
break;
case NUMERIC_FILE_PARAM:
phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line);
diff --git a/sapi/phpdbg/tests/stdin_001.phpt b/sapi/phpdbg/tests/stdin_001.phpt
index 0bc940caef..2f93a2d956 100644
--- a/sapi/phpdbg/tests/stdin_001.phpt
+++ b/sapi/phpdbg/tests/stdin_001.phpt
@@ -13,13 +13,13 @@ r
q
--EXPECTF--
prompt> [Successful compilation of stdin input]
-prompt> [Breakpoint #0 added at -:3]
-prompt> [Breakpoint #0 at -:3, hits: 1]
+prompt> [Breakpoint #0 added at Standard input code:3]
+prompt> [Breakpoint #0 at Standard input code:3, hits: 1]
>00003: echo "Hello, world!\n";
00004:
prompt> Hello, world!
[Script ended normally]
-prompt> [Breakpoint #0 at -:3, hits: 1]
+prompt> [Breakpoint #0 at Standard input code:3, hits: 1]
>00003: echo "Hello, world!\n";
00004:
-prompt> \ No newline at end of file
+prompt>