com php-src: make it possible to show specific help pages without interactive session: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_ help.c
sapi/phpdbg/phpdbg_help.h

From: Date: Sun, 20 Nov 2016 05:25:42 +0000
Subject: com php-src: make it possible to show specific help pages without interactive session: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_ help.c
sapi/phpdbg/phpdbg_help.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95889@lists.php.net to get a copy of this message
Commit: 56f9a93939a96f93210809e99fe1d4f536b56b2d Author: Joe Watkins <krakjoe@php.net> Sun, 20 Nov 2016 05:24:14 +0000 Parents: c7d0571ef4f83f9f674325d9bfacd740ed1c3bcd Branches: PHP-7.1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=56f9a93939a96f93210809e99fe1d4f536b56b2d Log: make it possible to show specific help pages without interactive session Changed paths: M sapi/phpdbg/phpdbg.c M sapi/phpdbg/phpdbg_help.c M sapi/phpdbg/phpdbg_help.h Diff: diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index f570763..2adca8e 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1695,7 +1695,7 @@ phpdbg_main: PHPDBG_G(io)[PHPDBG_STDOUT].ptr = stdout; PHPDBG_G(io)[PHPDBG_STDOUT].fd = fileno(stdout); if (show_help) { - phpdbg_do_help(NULL); + phpdbg_do_help_cmd(exec); } else if (show_version) { phpdbg_out( "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2016 The PHP Group\n%s", diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index 0943a7e..eb62d76 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -209,6 +209,26 @@ static int get_command( } /* }}} */ +void phpdbg_do_help_cmd(char *type) { /* {{{ */ + char *help; + + if (!type) { + pretty_print(get_help("overview!")); + return; + } + + help = get_help(type); + + if (!help || memcmp(help, "", sizeof("")) == SUCCESS) { + pretty_print(get_help("overview!")); + pretty_print( + "\nrequested help page could not be found"); + return; + } + + pretty_print(help); +} /* }}} */ + PHPDBG_COMMAND(help) /* {{{ */ { phpdbg_command_t const *cmd; diff --git a/sapi/phpdbg/phpdbg_help.h b/sapi/phpdbg/phpdbg_help.h index 7473684..d44eca1 100644 --- a/sapi/phpdbg/phpdbg_help.h +++ b/sapi/phpdbg/phpdbg_help.h @@ -45,4 +45,6 @@ typedef struct _phpdbg_help_text_t { } phpdbg_help_text_t; extern phpdbg_help_text_t phpdbg_help_text[]; + +extern void phpdbg_do_help_cmd(char *type); #endif /* PHPDBG_HELP_H */

« previous php.cvs (#95889) next »