summaryrefslogtreecommitdiff
path: root/ext/standard/info.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2012-08-05 21:13:39 -0700
committerStanislav Malyshev <stas@php.net>2012-08-05 21:15:53 -0700
commitc9eb64127e2d25c09672beacffdd34c8e7e3ddd2 (patch)
tree46bd068f2cf0cd9c6ab8774fe3ae0f17d970b449 /ext/standard/info.c
parent1a41607d462ec2bfe9725821c541bae78282d8a5 (diff)
parentb1a997e2a25d1f1422a237e12cff19a70a8eb317 (diff)
downloadphp-git-c9eb64127e2d25c09672beacffdd34c8e7e3ddd2.tar.gz
Merge branch 'pull-request/132'
* pull-request/132: OK, bye bye JavaScript, let's just include credits before license Nicer (JSLint-compliant!) credits reveal JavaScript Removed now-unnecessary expose_php checks for logo Fixed small misalignment in prev commit Removed Logo GUIDs and replaced with Data URIs and div hidden with JS
Diffstat (limited to 'ext/standard/info.c')
-rw-r--r--ext/standard/info.c123
1 files changed, 22 insertions, 101 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 07e152874a..089f515d95 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -92,14 +92,6 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
}
/* }}} */
-static void php_info_print_request_uri(TSRMLS_D) /* {{{ */
-{
- if (SG(request_info).request_uri) {
- php_info_print_html_esc(SG(request_info).request_uri, strlen(SG(request_info).request_uri));
- }
-}
-/* }}} */
-
static int php_info_print(const char *str) /* {{{ */
{
TSRMLS_FETCH();
@@ -660,7 +652,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
{
char **env, *tmp1, *tmp2;
char *php_uname;
- int expose_php = INI_INT("expose_php");
if (!sapi_module.phpinfo_as_text) {
php_print_info_htmlhead(TSRMLS_C);
@@ -671,7 +662,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if (flag & PHP_INFO_GENERAL) {
char *zend_version = get_zend_version();
char temp_api[10];
- char *logo_guid;
php_uname = php_get_uname('a');
@@ -679,14 +669,19 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_box_start(1);
}
- if (expose_php && !sapi_module.phpinfo_as_text) {
- php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
- php_info_print_request_uri(TSRMLS_C);
- php_info_print("?=");
- logo_guid = php_logo_guid();
- php_info_print(logo_guid);
- efree(logo_guid);
- php_info_print("\" alt=\"PHP Logo\" /></a>");
+ if (!sapi_module.phpinfo_as_text) {
+ time_t the_time;
+ struct tm *ta, tmbuf;
+
+ the_time = time(NULL);
+ ta = php_localtime_r(&the_time, &tmbuf);
+
+ php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
+ if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
+ php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
+ } else {
+ php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
+ }
}
if (!sapi_module.phpinfo_as_text) {
@@ -787,10 +782,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
/* Zend Engine */
php_info_print_box_start(0);
- if (expose_php && !sapi_module.phpinfo_as_text) {
+ if (!sapi_module.phpinfo_as_text) {
php_info_print("<a href=\"http://www.zend.com/\"><img border=\"0\" src=\"");
- php_info_print_request_uri(TSRMLS_C);
- php_info_print("?="ZEND_LOGO_GUID"\" alt=\"Zend logo\" /></a>\n");
+ php_info_print(ZEND_LOGO_DATA_URI "\" alt=\"Zend logo\" /></a>\n");
}
php_info_print("This program makes use of the Zend Scripting Language Engine:");
php_info_print(!sapi_module.phpinfo_as_text?"<br />":"\n");
@@ -803,15 +797,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
efree(php_uname);
}
- if ((flag & PHP_INFO_CREDITS) && expose_php && !sapi_module.phpinfo_as_text) {
- php_info_print_hr();
- php_info_print("<h1><a href=\"");
- php_info_print_request_uri(TSRMLS_C);
- php_info_print("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000\">");
- php_info_print("PHP Credits");
- php_info_print("</a></h1>\n");
- }
-
zend_ini_sort_entries(TSRMLS_C);
if (flag & PHP_INFO_CONFIGURATION) {
@@ -893,6 +878,12 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_end();
}
+
+ if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
+ php_info_print_hr();
+ php_print_credits(PHP_CREDITS_ALL TSRMLS_CC);
+ }
+
if (flag & PHP_INFO_LICENSE) {
if (!sapi_module.phpinfo_as_text) {
SECTION("PHP License");
@@ -926,6 +917,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print("questions about PHP licensing, please contact license@php.net.\n");
}
}
+
if (!sapi_module.phpinfo_as_text) {
php_info_print("</div></body></html>");
}
@@ -1191,77 +1183,6 @@ PHP_FUNCTION(phpcredits)
}
/* }}} */
-/* {{{ php_logo_guid
- */
-PHPAPI char *php_logo_guid(void)
-{
- char *logo_guid;
-
- time_t the_time;
- struct tm *ta, tmbuf;
-
- the_time = time(NULL);
- ta = php_localtime_r(&the_time, &tmbuf);
-
- if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
- logo_guid = PHP_EGG_LOGO_GUID;
- } else {
- logo_guid = PHP_LOGO_GUID;
- }
-
- return estrdup(logo_guid);
-
-}
-/* }}} */
-
-/* {{{ proto string php_logo_guid(void)
- Return the special ID used to request the PHP logo in phpinfo screens*/
-PHP_FUNCTION(php_logo_guid)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- return;
- }
-
- RETURN_STRING(php_logo_guid(), 0);
-}
-/* }}} */
-
-/* {{{ proto string php_real_logo_guid(void)
- Return the special ID used to request the PHP logo in phpinfo screens*/
-PHP_FUNCTION(php_real_logo_guid)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- return;
- }
-
- RETURN_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1);
-}
-/* }}} */
-
-/* {{{ proto string php_egg_logo_guid(void)
- Return the special ID used to request the PHP logo in phpinfo screens*/
-PHP_FUNCTION(php_egg_logo_guid)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- return;
- }
-
- RETURN_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1);
-}
-/* }}} */
-
-/* {{{ proto string zend_logo_guid(void)
- Return the special ID used to request the Zend logo in phpinfo screens*/
-PHP_FUNCTION(zend_logo_guid)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- return;
- }
-
- RETURN_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1);
-}
-/* }}} */
-
/* {{{ proto string php_sapi_name(void)
Return the current SAPI module name */
PHP_FUNCTION(php_sapi_name)