From 614b4b781e277572244bee008caaf2aacd8128fd Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Sat, 17 Jul 1999 19:17:42 +0000 Subject: [PATCH] I was sure I committed these already. Weird --- cgi_main.c | 2 +- ext/standard/basic_functions.c | 5 +- ext/standard/info.c | 175 ++++++++++++++++++++++----------- ext/standard/info.h | 17 +++- main/main.c | 3 + 5 files changed, 135 insertions(+), 67 deletions(-) diff --git a/cgi_main.c b/cgi_main.c index 95ea9c70e87..7fa08698cec 100644 --- a/cgi_main.c +++ b/cgi_main.c @@ -331,7 +331,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine } cgi_started=1; php3_TreatHeaders(); - _php3_info(0xFFFFFFFF); + php_print_info(0xFFFFFFFF); exit(1); break; case 's': diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 07c672749db..86d4a0244e6 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -122,8 +122,9 @@ function_entry basic_functions[] = { {"parse_url", php3_parse_url, NULL}, {"parse_str", php3_parsestr, NULL}, - {"phpinfo", php3_info, NULL}, - {"phpversion", php3_version, NULL}, + PHP_FE(phpinfo, NULL) + PHP_FE(phpversion, NULL) + PHP_FE(phpcredits, NULL) {"strlen", php3_strlen, NULL}, {"strcmp", php3_strcmp, NULL}, {"strspn", php3_strspn, NULL}, diff --git a/ext/standard/info.c b/ext/standard/info.c index 77257b38187..84912123e43 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -47,7 +47,7 @@ static int _display_module_info(php3_module_entry *module) } -PHPAPI void _php3_info(int flag) +PHPAPI void php_print_info(int flag) { char **env,*tmp1,*tmp2; char *php3_uname; @@ -106,62 +106,13 @@ PHPAPI void _php3_info(int flag) PUTS("
"); if (flag & PHP_INFO_CREDITS) { - PUTS("

Credits

\n"); - - /* Language */ - PUTS("\n"); - PUTS("\n"); - php_info_print_table_header(2, "Contribution", "Authors"); - CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski"); - CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski"); - CREDIT_LINE("UNIX Build and Modularization", "Stig Sather Bakken"); - CREDIT_LINE("Win32 Port", "Shane Caraveo, Zeev Suraski"); - CREDIT_LINE("Server API (SAPI) Abstraction Layer", "Andi Gutmans, Shane Caraveo, Zeev Suraski"); - CREDIT_LINE("Apache SAPI Module", "Rasmus Lerdorf, Zeev Suraski"); - CREDIT_LINE("ISAPI SAPI Module", "Andi Gutmans, Zeev Suraski"); - CREDIT_LINE("CGI SAPI Module", "Rasmus Lerdorf, Stig Sather Bakken"); - PUTS("
PHP 4.0 Authors
\n"); - - /* Modules */ - PUTS("\n"); - PUTS("\n"); - php_info_print_table_header(2, "Module", "Authors"); - CREDIT_LINE("Apache", "Rasmus Lerdorf, Stig Sather Bakken, David Sklar"); - CREDIT_LINE("BC Math", "Andi Gutmans"); - CREDIT_LINE("Win32 COM", "Zeev Suraski"); - CREDIT_LINE("DAV", "Stig Sather Bakken"); - CREDIT_LINE("DBM", "Rasmus Lerdorf, Jim Winstead"); - CREDIT_LINE("dBase", "Jim Winstead"); - CREDIT_LINE("FDF", "Uwe Steinmann"); - CREDIT_LINE("FilePro", "Chad Robinson"); - CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Sather Bakken, Jim Winstead"); - CREDIT_LINE("GetText", "Alex Plotnick"); - CREDIT_LINE("HyperWave", "Uwe Steinmann"); - CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf"); - CREDIT_LINE("Informix", "Danny Heijl, Christian Cartus, Jouni Ahto"); - CREDIT_LINE("Interbase", "Jouni Ahto"); - CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson"); - CREDIT_LINE("mcrypt", "Sascha Schumann"); - CREDIT_LINE("mhash", "Sascha Schumann"); - CREDIT_LINE("mSQL", "Zeev Suraski"); - CREDIT_LINE("MySQL", "Zeev Suraski"); - CREDIT_LINE("OCI8", "Stig Sather Bakken, Thies C. Arntzen"); - CREDIT_LINE("ODBC", "Stig Sather Bakken, Andreas Karajannis, Frank M. Kromann"); - CREDIT_LINE("Oracle", "Stig Sather Bakken, Mitch Golden, Rasmus Lerdorf, Andreas Karajannis, Thies C. Arntzen"); - CREDIT_LINE("Perl Compatible Regexps", "Andrey Zmievski"); - CREDIT_LINE("PDF", "Uwe Steinmann"); - CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski"); - CREDIT_LINE("Sessions", "Sascha Schumann"); - CREDIT_LINE("SNMP", "Rasmus Lerdorf"); - CREDIT_LINE("Sybase", "Zeev Suraski"); - CREDIT_LINE("System V Shared Memory", "Christian Cartus"); - CREDIT_LINE("System V Semaphores", "Tom May"); - CREDIT_LINE("XML", "Stig Sather Bakken"); - CREDIT_LINE("Yellow Pages", "Stephanie Wehner"); - CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Ruhrich"); - PUTS("
Module Authors
\n"); - - /* Documentation */ + PUTS(""); + PUTS("

PHP 4.0 Credits

\n"); + PUTS("
\n"); } @@ -296,6 +247,81 @@ PHPAPI void _php3_info(int flag) } +void php_print_credits(int flag) +{ + if (flag & PHP_CREDITS_FULLPAGE) { + PUTS("PHP Credits\n"); + } + + PUTS("

Credits

\n"); + + if (flag & PHP_CREDITS_GENERAL) { + /* Language */ + PUTS("\n"); + PUTS("\n"); + php_info_print_table_header(2, "Contribution", "Authors"); + CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski"); + CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski"); + CREDIT_LINE("UNIX Build and Modularization", "Stig Sather Bakken"); + CREDIT_LINE("Win32 Port", "Shane Caraveo, Zeev Suraski"); + CREDIT_LINE("Server API (SAPI) Abstraction Layer", "Andi Gutmans, Shane Caraveo, Zeev Suraski"); + CREDIT_LINE("Apache SAPI Module", "Rasmus Lerdorf, Zeev Suraski"); + CREDIT_LINE("ISAPI SAPI Module", "Andi Gutmans, Zeev Suraski"); + CREDIT_LINE("CGI SAPI Module", "Rasmus Lerdorf, Stig Sather Bakken"); + PUTS("
PHP 4.0 Authors
\n"); + } + + if (flag & PHP_CREDITS_MODULES) { + /* Modules */ + PUTS("\n"); + PUTS("\n"); + php_info_print_table_header(2, "Module", "Authors"); + CREDIT_LINE("Apache", "Rasmus Lerdorf, Stig Sather Bakken, David Sklar"); + CREDIT_LINE("BC Math", "Andi Gutmans"); + CREDIT_LINE("Win32 COM", "Zeev Suraski"); + CREDIT_LINE("DAV", "Stig Sather Bakken"); + CREDIT_LINE("DBM", "Rasmus Lerdorf, Jim Winstead"); + CREDIT_LINE("dBase", "Jim Winstead"); + CREDIT_LINE("FDF", "Uwe Steinmann"); + CREDIT_LINE("FilePro", "Chad Robinson"); + CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Sather Bakken, Jim Winstead"); + CREDIT_LINE("GetText", "Alex Plotnick"); + CREDIT_LINE("HyperWave", "Uwe Steinmann"); + CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf"); + CREDIT_LINE("Informix", "Danny Heijl, Christian Cartus, Jouni Ahto"); + CREDIT_LINE("Interbase", "Jouni Ahto"); + CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson"); + CREDIT_LINE("mcrypt", "Sascha Schumann"); + CREDIT_LINE("mhash", "Sascha Schumann"); + CREDIT_LINE("mSQL", "Zeev Suraski"); + CREDIT_LINE("MySQL", "Zeev Suraski"); + CREDIT_LINE("OCI8", "Stig Sather Bakken, Thies C. Arntzen"); + CREDIT_LINE("ODBC", "Stig Sather Bakken, Andreas Karajannis, Frank M. Kromann"); + CREDIT_LINE("Oracle", "Stig Sather Bakken, Mitch Golden, Rasmus Lerdorf, Andreas Karajannis, Thies C. Arntzen"); + CREDIT_LINE("Perl Compatible Regexps", "Andrey Zmievski"); + CREDIT_LINE("PDF", "Uwe Steinmann"); + CREDIT_LINE("PostgreSQL", "Jouni Ahto, Zeev Suraski"); + CREDIT_LINE("Sessions", "Sascha Schumann"); + CREDIT_LINE("SNMP", "Rasmus Lerdorf"); + CREDIT_LINE("Sybase", "Zeev Suraski"); + CREDIT_LINE("System V Shared Memory", "Christian Cartus"); + CREDIT_LINE("System V Semaphores", "Tom May"); + CREDIT_LINE("XML", "Stig Sather Bakken"); + CREDIT_LINE("Yellow Pages", "Stephanie Wehner"); + CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Ruhrich"); + PUTS("
Module Authors
\n"); + } + + if (flag & PHP_CREDITS_DOCS) { + /* Documentation */ + } + + if (flag & PHP_CREDITS_FULLPAGE) { + PUTS("\n"); + } +} + + PHPAPI void php_info_print_table_header(int num_cols, ...) { int i; @@ -361,7 +387,7 @@ void register_phpinfo_constants(INIT_FUNC_ARGS) /* {{{ proto void phpinfo(void) Output a page of useful information about PHP and the current request */ -PHP_FUNCTION(info) +PHP_FUNCTION(phpinfo) { int flag; zval *flag_arg; @@ -382,19 +408,48 @@ PHP_FUNCTION(info) WRONG_PARAM_COUNT; break; } - _php3_info(flag); + php_print_info(flag); RETURN_TRUE; } /* }}} */ /* {{{ proto string phpversion(void) Return the current PHP version */ -PHP_FUNCTION(version) +PHP_FUNCTION(phpversion) { RETURN_STRING(PHP_VERSION,1); } /* }}} */ + +/* {{{ proto void phpcredits(int) + Prints the list of people who've contributed to the PHP project */ +PHP_FUNCTION(phpcredits) +{ + int flag; + zval *flag_arg; + + + switch (ARG_COUNT(ht)) { + case 0: + flag = 0xFFFFFFFF; + break; + case 1: + if (getParameters(ht, 1, &flag_arg)==FAILURE) { + RETURN_FALSE; + } + convert_to_long(flag_arg); + flag = flag_arg->value.lval; + break; + default: + WRONG_PARAM_COUNT; + break; + } + php_print_credits(flag); + RETURN_TRUE; +} +/* }}} */ + /* * Local variables: * tab-width: 4 diff --git a/ext/standard/info.h b/ext/standard/info.h index db8abb45fee..627accf2131 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -43,12 +43,21 @@ #define PHP_INFO_ENVIRONMENT (1<<4) #define PHP_INFO_VARIABLES (1<<5) #define PHP_INFO_LICENSE (1<<6) +#define PHP_INFO_ALL 0xFFFFFFFF -#define PHP_INFO_ALL 0xFFFFFFFF -PHP_FUNCTION(version); -PHP_FUNCTION(info); -PHPAPI void _php3_info(int flag); +#define PHP_CREDITS_GENERAL (1<<0) +#define PHP_CREDITS_MODULES (1<<1) +#define PHP_CREDITS_DOCS (1<<2) +#define PHP_CREDITS_FULLPAGE (1<<3) +#define PHP_CREDITS_ALL 0xFFFFFFFF + +PHP_FUNCTION(phpversion); +PHP_FUNCTION(phpinfo); +PHP_FUNCTION(phpcredits); +PHPAPI void php_print_info(int flag); +PHPAPI void php_print_credits(int flag); + PHPAPI void php_info_print_table_header(int num_cols, ...); PHPAPI void php_info_print_table_row(int num_cols, ...); diff --git a/main/main.c b/main/main.c index 50fe3558a75..6e801350d0e 100644 --- a/main/main.c +++ b/main/main.c @@ -1086,6 +1086,9 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ php4i_add_header_information(header_line, sizeof(CONTEXT_TYPE_IMAGE_GIF)-1); PHPWRITE(zend_logo, sizeof(zend_logo)); return; + } else if (!strcmp(SG(request_info).query_string+1, "PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000")) { + php_print_credits(PHP_CREDITS_ALL); + return; } }