PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/standard - info.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 419 451 92.9 %
Date: 2016-07-26 Functions: 30 32 93.8 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 7                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1997-2016 The PHP Group                                |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 3.01 of the PHP license,      |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.php.net/license/3_01.txt                                  |
      11             :    | If you did not receive a copy of the PHP license and are unable to   |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@php.net so we can mail you a copy immediately.               |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Rasmus Lerdorf <rasmus@php.net>                             |
      16             :    |          Zeev Suraski <zeev@zend.com>                                |
      17             :    |          Colin Viebrock <colin@viebrock.ca>                          |
      18             :    +----------------------------------------------------------------------+
      19             : */
      20             : 
      21             : /* $Id$ */
      22             : 
      23             : #include "php.h"
      24             : #include "php_ini.h"
      25             : #include "php_globals.h"
      26             : #include "ext/standard/head.h"
      27             : #include "ext/standard/html.h"
      28             : #include "info.h"
      29             : #include "credits.h"
      30             : #include "css.h"
      31             : #include "SAPI.h"
      32             : #include <time.h>
      33             : #include "php_main.h"
      34             : #include "zend_globals.h"             /* needs ELS */
      35             : #include "zend_extensions.h"
      36             : #include "zend_highlight.h"
      37             : #ifdef HAVE_SYS_UTSNAME_H
      38             : #include <sys/utsname.h>
      39             : #endif
      40             : #include "url.h"
      41             : #include "php_string.h"
      42             : 
      43             : #ifdef PHP_WIN32
      44             : typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
      45             : typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
      46             : # include "winver.h"
      47             : 
      48             : #endif
      49             : 
      50             : #define SECTION(name)   if (!sapi_module.phpinfo_as_text) { \
      51             :                                                         php_info_print("<h2>" name "</h2>\n"); \
      52             :                                                 } else { \
      53             :                                                         php_info_print_table_start(); \
      54             :                                                         php_info_print_table_header(1, name); \
      55             :                                                         php_info_print_table_end(); \
      56             :                                                 } \
      57             : 
      58             : PHPAPI extern char *php_ini_opened_path;
      59             : PHPAPI extern char *php_ini_scanned_path;
      60             : PHPAPI extern char *php_ini_scanned_files;
      61             : 
      62        1615 : static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */
      63             : {
      64             :         size_t written;
      65             :         zend_string *new_str;
      66             : 
      67        1615 :         new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8");
      68        1615 :         written = php_output_write(ZSTR_VAL(new_str), ZSTR_LEN(new_str));
      69             :         zend_string_free(new_str);
      70        1615 :         return written;
      71             : }
      72             : /* }}} */
      73             : 
      74        1866 : static int php_info_printf(const char *fmt, ...) /* {{{ */
      75             : {
      76             :         char *buf;
      77             :         size_t len, written;
      78             :         va_list argv;
      79             : 
      80        1866 :         va_start(argv, fmt);
      81        1866 :         len = vspprintf(&buf, 0, fmt, argv);
      82        1866 :         va_end(argv);
      83             : 
      84        1866 :         written = php_output_write(buf, len);
      85        1866 :         efree(buf);
      86        1866 :         return written;
      87             : }
      88             : /* }}} */
      89             : 
      90      505251 : static int php_info_print(const char *str) /* {{{ */
      91             : {
      92      505251 :         return php_output_write(str, strlen(str));
      93             : }
      94             : /* }}} */
      95             : 
      96         414 : static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ */
      97             : {
      98             :         zend_string *key;
      99             : 
     100         414 :         if (ht) {
     101         414 :                 if (zend_hash_num_elements(ht)) {
     102         414 :                         int first = 1;
     103             : 
     104         414 :                         if (!sapi_module.phpinfo_as_text) {
     105           3 :                                 php_info_printf("<tr><td class=\"e\">Registered %s</td><td class=\"v\">", name);
     106             :                         } else {
     107         411 :                                 php_info_printf("\nRegistered %s => ", name);
     108             :                         }
     109             : 
     110        9798 :                         ZEND_HASH_FOREACH_STR_KEY(ht, key) {
     111        4692 :                                 if (key) {
     112        4692 :                                         if (first) {
     113         414 :                                                 first = 0;
     114             :                                         } else {
     115        4278 :                                                 php_info_print(", ");
     116             :                                         }
     117        4692 :                                         if (!sapi_module.phpinfo_as_text) {
     118          34 :                                                 php_info_print_html_esc(ZSTR_VAL(key), ZSTR_LEN(key));
     119             :                                         } else {
     120        4658 :                                                 php_info_print(ZSTR_VAL(key));
     121             :                                         }
     122             :                                 }
     123             :                         } ZEND_HASH_FOREACH_END();
     124             : 
     125         414 :                         if (!sapi_module.phpinfo_as_text) {
     126           3 :                                 php_info_print("</td></tr>\n");
     127             :                         }
     128             :                 } else {
     129             :                         char reg_name[128];
     130           0 :                         snprintf(reg_name, sizeof(reg_name), "Registered %s", name);
     131           0 :                         php_info_print_table_row(2, reg_name, "none registered");
     132             :                 }
     133             :         } else {
     134           0 :                 php_info_print_table_row(2, name, "disabled");
     135             :         }
     136         414 : }
     137             : /* }}} */
     138             : 
     139       10504 : PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */
     140             : {
     141       21008 :         if (zend_module->info_func || zend_module->version) {
     142       10504 :                 if (!sapi_module.phpinfo_as_text) {
     143          71 :                         zend_string *url_name = php_url_encode(zend_module->name, strlen(zend_module->name));
     144             : 
     145          71 :                         php_strtolower(ZSTR_VAL(url_name), ZSTR_LEN(url_name));
     146          71 :                         php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", ZSTR_VAL(url_name), zend_module->name);
     147             : 
     148          71 :                         efree(url_name);
     149             :                 } else {
     150       10433 :                         php_info_print_table_start();
     151       10433 :                         php_info_print_table_header(1, zend_module->name);
     152       10433 :                         php_info_print_table_end();
     153             :                 }
     154       10504 :                 if (zend_module->info_func) {
     155       10204 :                         zend_module->info_func(zend_module);
     156             :                 } else {
     157         300 :                         php_info_print_table_start();
     158         300 :                         php_info_print_table_row(2, "Version", zend_module->version);
     159         300 :                         php_info_print_table_end();
     160         300 :                         DISPLAY_INI_ENTRIES();
     161             :                 }
     162             :         } else {
     163           0 :                 if (!sapi_module.phpinfo_as_text) {
     164           0 :                         php_info_printf("<tr><td class=\"v\">%s</td></tr>\n", zend_module->name);
     165             :                 } else {
     166           0 :                         php_info_printf("%s\n", zend_module->name);
     167             :                 }
     168             :         }
     169       10504 : }
     170             : /* }}} */
     171             : 
     172       10500 : static int _display_module_info_func(zval *el) /* {{{ */
     173             : {
     174       10500 :         zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el);
     175       10500 :         if (module->info_func || module->version) {
     176       10500 :                 php_info_print_module(module);
     177             :         }
     178       10500 :         return ZEND_HASH_APPLY_KEEP;
     179             : }
     180             : /* }}} */
     181             : 
     182       10500 : static int _display_module_info_def(zval *el) /* {{{ */
     183             : {
     184       10500 :         zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el);
     185       10500 :         if (!module->info_func && !module->version) {
     186           0 :                 php_info_print_module(module);
     187             :         }
     188       10500 :         return ZEND_HASH_APPLY_KEEP;
     189             : }
     190             : /* }}} */
     191             : 
     192             : /* {{{ php_print_gpcse_array
     193             :  */
     194         973 : static void php_print_gpcse_array(char *name, uint name_length)
     195             : {
     196             :         zval *data, *tmp, tmp2;
     197             :         zend_string *string_key;
     198             :         zend_ulong num_key;
     199             :         zend_string *key;
     200             : 
     201        1946 :         key = zend_string_init(name, name_length, 0);
     202         973 :         zend_is_auto_global(key);
     203             : 
     204        1946 :         if ((data = zend_hash_find(&EG(symbol_table), key)) != NULL && (Z_TYPE_P(data) == IS_ARRAY)) {
     205       31079 :                 ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_key, string_key, tmp) {
     206       15053 :                         if (!sapi_module.phpinfo_as_text) {
     207         113 :                                 php_info_print("<tr>");
     208         113 :                                 php_info_print("<td class=\"e\">");
     209             :                         }
     210             : 
     211       15053 :                         php_info_print("$");
     212       15053 :                         php_info_print(name);
     213       15053 :                         php_info_print("['");
     214             : 
     215       15053 :                         if (string_key != NULL) {
     216       15053 :                                 if (!sapi_module.phpinfo_as_text) {
     217         113 :                                         php_info_print_html_esc(ZSTR_VAL(string_key), ZSTR_LEN(string_key));
     218             :                                 } else {
     219       14940 :                                         php_info_print(ZSTR_VAL(string_key));
     220             :                                 }
     221             :                         } else {
     222           0 :                                 php_info_printf(ZEND_ULONG_FMT, num_key);
     223             :                         }
     224       15053 :                         php_info_print("']");
     225       15053 :                         if (!sapi_module.phpinfo_as_text) {
     226         113 :                                 php_info_print("</td><td class=\"v\">");
     227             :                         } else {
     228       14940 :                                 php_info_print(" => ");
     229             :                         }
     230       15053 :                         if (Z_TYPE_P(tmp) == IS_ARRAY) {
     231         139 :                                 if (!sapi_module.phpinfo_as_text) {
     232           1 :                                         zend_string *str = zend_print_zval_r_to_str(tmp, 0);
     233           1 :                                         php_info_print("<pre>");
     234           1 :                                         php_info_print_html_esc(ZSTR_VAL(str), ZSTR_LEN(str));
     235           1 :                                         php_info_print("</pre>");
     236             :                                         zend_string_release(str);
     237             :                                 } else {
     238         138 :                                         zend_print_zval_r(tmp, 0);
     239             :                                 }
     240             :                         } else {
     241       14914 :                                 ZVAL_COPY_VALUE(&tmp2, tmp);
     242       14914 :                                 if (Z_TYPE(tmp2) != IS_STRING) {
     243         417 :                                         tmp = NULL;
     244             :                                         zval_copy_ctor(&tmp2);
     245         417 :                                         convert_to_string(&tmp2);
     246             :                                 }
     247             : 
     248       14914 :                                 if (!sapi_module.phpinfo_as_text) {
     249         112 :                                         if (Z_STRLEN(tmp2) == 0) {
     250           1 :                                                 php_info_print("<i>no value</i>");
     251             :                                         } else {
     252         111 :                                                 php_info_print_html_esc(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
     253             :                                         }
     254             :                                 } else {
     255       14802 :                                         php_info_print(Z_STRVAL(tmp2));
     256             :                                 }
     257             : 
     258       14914 :                                 if (!tmp) {
     259             :                                         zval_dtor(&tmp2);
     260             :                                 }
     261             :                         }
     262       15053 :                         if (!sapi_module.phpinfo_as_text) {
     263         113 :                                 php_info_print("</td></tr>\n");
     264             :                         } else {
     265       14940 :                                 php_info_print("\n");
     266             :                         }
     267             :                 } ZEND_HASH_FOREACH_END();
     268             :         }
     269             :         zend_string_free(key);
     270         973 : }
     271             : /* }}} */
     272             : 
     273             : /* {{{ php_info_print_style
     274             :  */
     275           4 : void php_info_print_style(void)
     276             : {
     277           4 :         php_info_printf("<style type=\"text/css\">\n");
     278           4 :         php_info_print_css();
     279           4 :         php_info_printf("</style>\n");
     280           4 : }
     281             : /* }}} */
     282             : 
     283             : /* {{{ php_info_html_esc
     284             :  */
     285           0 : PHPAPI zend_string *php_info_html_esc(char *string)
     286             : {
     287           0 :         return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL);
     288             : }
     289             : /* }}} */
     290             : 
     291             : #ifdef PHP_WIN32
     292             : /* {{{  */
     293             : 
     294             : char* php_get_windows_name()
     295             : {
     296             :         OSVERSIONINFOEX osvi = EG(windows_version_info);
     297             :         SYSTEM_INFO si;
     298             :         PGNSI pGNSI;
     299             :         PGPI pGPI;
     300             :         DWORD dwType;
     301             :         char *major = NULL, *sub = NULL, *retval;
     302             : 
     303             :         ZeroMemory(&si, sizeof(SYSTEM_INFO));
     304             : 
     305             :         pGNSI = (PGNSI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo");
     306             :         if(NULL != pGNSI) {
     307             :                 pGNSI(&si);
     308             :         } else {
     309             :                 GetSystemInfo(&si);
     310             :         }
     311             : 
     312             :         if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 10) {
     313             :                 if (osvi.dwMajorVersion == 10) {
     314             :                         if( osvi.dwMinorVersion == 0 ) {
     315             :                                 if( osvi.wProductType == VER_NT_WORKSTATION ) {
     316             :                                         major = "Windows 10";
     317             :                                 } else {
     318             :                                         major = "Windows Server 2016";
     319             :                                 }
     320             :                         }
     321             :                 }
     322             :         } else if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 6) {
     323             :                 if (osvi.dwMajorVersion == 6) {
     324             :                         if( osvi.dwMinorVersion == 0 ) {
     325             :                                 if( osvi.wProductType == VER_NT_WORKSTATION ) {
     326             :                                         major = "Windows Vista";
     327             :                                 } else {
     328             :                                         major = "Windows Server 2008";
     329             :                                 }
     330             :                         } else if ( osvi.dwMinorVersion == 1 ) {
     331             :                                 if( osvi.wProductType == VER_NT_WORKSTATION )  {
     332             :                                         major = "Windows 7";
     333             :                                 } else {
     334             :                                         major = "Windows Server 2008 R2";
     335             :                                 }
     336             :                         } else if ( osvi.dwMinorVersion == 2 ) {
     337             :                                 /* could be Windows 8/Windows Server 2012, could be Windows 8.1/Windows Server 2012 R2 */
     338             :                                 /* XXX and one more X - the above comment is true if no manifest is used for two cases:
     339             :                                         - if the PHP build doesn't use the correct manifest
     340             :                                         - if PHP DLL loaded under some binary that doesn't use the correct manifest 
     341             :                                         
     342             :                                         So keep the handling here as is for now, even if we know 6.2 is win8 and nothing else, and think about an improvement. */
     343             :                                 OSVERSIONINFOEX osvi81;
     344             :                                 DWORDLONG dwlConditionMask = 0;
     345             :                                 int op = VER_GREATER_EQUAL;
     346             : 
     347             :                                 ZeroMemory(&osvi81, sizeof(OSVERSIONINFOEX));
     348             :                                 osvi81.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
     349             :                                 osvi81.dwMajorVersion = 6;
     350             :                                 osvi81.dwMinorVersion = 3;
     351             :                                 osvi81.wServicePackMajor = 0;
     352             : 
     353             :                                 VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, op);
     354             :                                 VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, op);
     355             :                                 VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMAJOR, op);
     356             : 
     357             :                                 if (VerifyVersionInfo(&osvi81,
     358             :                                         VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR,
     359             :                                         dwlConditionMask)) {
     360             :                                         osvi.dwMinorVersion = 3; /* Windows 8.1/Windows Server 2012 R2 */
     361             :                                         if( osvi.wProductType == VER_NT_WORKSTATION )  {
     362             :                                                 major = "Windows 8.1";
     363             :                                         } else {
     364             :                                                 major = "Windows Server 2012 R2";
     365             :                                         }
     366             :                                 } else {
     367             :                                         if( osvi.wProductType == VER_NT_WORKSTATION )  {
     368             :                                                 major = "Windows 8";
     369             :                                         } else {
     370             :                                                 major = "Windows Server 2012";
     371             :                                         }
     372             :                                 }
     373             :                         } else if (osvi.dwMinorVersion == 3) {
     374             :                                 if( osvi.wProductType == VER_NT_WORKSTATION )  {
     375             :                                         major = "Windows 8.1";
     376             :                                 } else {
     377             :                                         major = "Windows Server 2012 R2";
     378             :                                 }
     379             :                         } else {
     380             :                                 major = "Unknown Windows version";
     381             :                         }
     382             : 
     383             :                         pGPI = (PGPI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProductInfo");
     384             :                         pGPI(6, 0, 0, 0, &dwType);
     385             : 
     386             :                         switch (dwType) {
     387             :                                 case PRODUCT_ULTIMATE:
     388             :                                         sub = "Ultimate Edition";
     389             :                                         break;
     390             :                                 case PRODUCT_HOME_BASIC:
     391             :                                         sub = "Home Basic Edition";
     392             :                                         break;
     393             :                                 case PRODUCT_HOME_PREMIUM:
     394             :                                         sub = "Home Premium Edition";
     395             :                                         break;
     396             :                                 case PRODUCT_ENTERPRISE:
     397             :                                         sub = "Enterprise Edition";
     398             :                                         break;
     399             :                                 case PRODUCT_HOME_BASIC_N:
     400             :                                         sub = "Home Basic N Edition";
     401             :                                         break;
     402             :                                 case PRODUCT_BUSINESS:
     403             :                                         if ((osvi.dwMajorVersion > 6) || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion > 0)) {
     404             :                                                 sub = "Professional Edition";
     405             :                                         } else {
     406             :                                                 sub = "Business Edition";
     407             :                                         }
     408             :                                         break;
     409             :                                 case PRODUCT_STANDARD_SERVER:
     410             :                                         sub = "Standard Edition";
     411             :                                         break;
     412             :                                 case PRODUCT_DATACENTER_SERVER:
     413             :                                         sub = "Datacenter Edition";
     414             :                                         break;
     415             :                                 case PRODUCT_SMALLBUSINESS_SERVER:
     416             :                                         sub = "Small Business Server";
     417             :                                         break;
     418             :                                 case PRODUCT_ENTERPRISE_SERVER:
     419             :                                         sub = "Enterprise Edition";
     420             :                                         break;
     421             :                                 case PRODUCT_STARTER:
     422             :                                         if ((osvi.dwMajorVersion > 6) || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion > 0)) {
     423             :                                                 sub = "Starter N Edition";
     424             :                                         } else {
     425             :                                             sub = "Starter Edition";
     426             :                                         }
     427             :                                         break;
     428             :                                 case PRODUCT_DATACENTER_SERVER_CORE:
     429             :                                         sub = "Datacenter Edition (core installation)";
     430             :                                         break;
     431             :                                 case PRODUCT_STANDARD_SERVER_CORE:
     432             :                                         sub = "Standard Edition (core installation)";
     433             :                                         break;
     434             :                                 case PRODUCT_ENTERPRISE_SERVER_CORE:
     435             :                                         sub = "Enterprise Edition (core installation)";
     436             :                                         break;
     437             :                                 case PRODUCT_ENTERPRISE_SERVER_IA64:
     438             :                                         sub = "Enterprise Edition for Itanium-based Systems";
     439             :                                         break;
     440             :                                 case PRODUCT_BUSINESS_N:
     441             :                                         if ((osvi.dwMajorVersion > 6) || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion > 0)) {
     442             :                                                 sub = "Professional N Edition";
     443             :                                         } else {
     444             :                                                 sub = "Business N Edition";
     445             :                                         }
     446             :                                         break;
     447             :                                 case PRODUCT_WEB_SERVER:
     448             :                                         sub = "Web Server Edition";
     449             :                                         break;
     450             :                                 case PRODUCT_CLUSTER_SERVER:
     451             :                                         sub = "HPC Edition";
     452             :                                         break;
     453             :                                 case PRODUCT_HOME_SERVER:
     454             :                                         sub = "Storage Server Essentials Edition";
     455             :                                         break;
     456             :                                 case PRODUCT_STORAGE_EXPRESS_SERVER:
     457             :                                         sub = "Storage Server Express Edition";
     458             :                                         break;
     459             :                                 case PRODUCT_STORAGE_STANDARD_SERVER:
     460             :                                         sub = "Storage Server Standard Edition";
     461             :                                         break;
     462             :                                 case PRODUCT_STORAGE_WORKGROUP_SERVER:
     463             :                                         sub = "Storage Server Workgroup Edition";
     464             :                                         break;
     465             :                                 case PRODUCT_STORAGE_ENTERPRISE_SERVER:
     466             :                                         sub = "Storage Server Enterprise Edition";
     467             :                                         break;
     468             :                                 case PRODUCT_SERVER_FOR_SMALLBUSINESS:
     469             :                                         sub = "Essential Server Solutions Edition";
     470             :                                         break;
     471             :                                 case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
     472             :                                         sub = "Small Business Server Premium Edition";
     473             :                                         break;
     474             :                                 case PRODUCT_HOME_PREMIUM_N:
     475             :                                         sub = "Home Premium N Edition";
     476             :                                         break;
     477             :                                 case PRODUCT_ENTERPRISE_N:
     478             :                                         sub = "Enterprise N Edition";
     479             :                                         break;
     480             :                                 case PRODUCT_ULTIMATE_N:
     481             :                                         sub = "Ultimate N Edition";
     482             :                                         break;
     483             :                                 case PRODUCT_WEB_SERVER_CORE:
     484             :                                         sub = "Web Server Edition (core installation)";
     485             :                                         break;
     486             :                                 case PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT:
     487             :                                         sub = "Essential Business Server Management Server Edition";
     488             :                                         break;
     489             :                                 case PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY:
     490             :                                         sub = "Essential Business Server Management Security Edition";
     491             :                                         break;
     492             :                                 case PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING:
     493             :                                         sub = "Essential Business Server Management Messaging Edition";
     494             :                                         break;
     495             :                                 case PRODUCT_SERVER_FOUNDATION:
     496             :                                         sub = "Foundation Edition";
     497             :                                         break;
     498             :                                 case PRODUCT_HOME_PREMIUM_SERVER:
     499             :                                         sub = "Home Server 2011 Edition";
     500             :                                         break;
     501             :                                 case PRODUCT_SERVER_FOR_SMALLBUSINESS_V:
     502             :                                         sub = "Essential Server Solutions Edition (without Hyper-V)";
     503             :                                         break;
     504             :                                 case PRODUCT_STANDARD_SERVER_V:
     505             :                                         sub = "Standard Edition (without Hyper-V)";
     506             :                                         break;
     507             :                                 case PRODUCT_DATACENTER_SERVER_V:
     508             :                                         sub = "Datacenter Edition (without Hyper-V)";
     509             :                                         break;
     510             :                                 case PRODUCT_ENTERPRISE_SERVER_V:
     511             :                                         sub = "Enterprise Edition (without Hyper-V)";
     512             :                                         break;
     513             :                                 case PRODUCT_DATACENTER_SERVER_CORE_V:
     514             :                                         sub = "Datacenter Edition (core installation, without Hyper-V)";
     515             :                                         break;
     516             :                                 case PRODUCT_STANDARD_SERVER_CORE_V:
     517             :                                         sub = "Standard Edition (core installation, without Hyper-V)";
     518             :                                         break;
     519             :                                 case PRODUCT_ENTERPRISE_SERVER_CORE_V:
     520             :                                         sub = "Enterprise Edition (core installation, without Hyper-V)";
     521             :                                         break;
     522             :                                 case PRODUCT_HYPERV:
     523             :                                         sub = "Hyper-V Server";
     524             :                                         break;
     525             :                                 case PRODUCT_STORAGE_EXPRESS_SERVER_CORE:
     526             :                                         sub = "Storage Server Express Edition (core installation)";
     527             :                                         break;
     528             :                                 case PRODUCT_STORAGE_STANDARD_SERVER_CORE:
     529             :                                         sub = "Storage Server Standard Edition (core installation)";
     530             :                                         break;
     531             :                                 case PRODUCT_STORAGE_WORKGROUP_SERVER_CORE:
     532             :                                         sub = "Storage Server Workgroup Edition (core installation)";
     533             :                                         break;
     534             :                                 case PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE:
     535             :                                         sub = "Storage Server Enterprise Edition (core installation)";
     536             :                                         break;
     537             :                                 case PRODUCT_STARTER_N:
     538             :                                         sub = "Starter N Edition";
     539             :                                         break;
     540             :                                 case PRODUCT_PROFESSIONAL:
     541             :                                         sub = "Professional Edition";
     542             :                                         break;
     543             :                                 case PRODUCT_PROFESSIONAL_N:
     544             :                                         sub = "Professional N Edition";
     545             :                                         break;
     546             :                                 case PRODUCT_SB_SOLUTION_SERVER:
     547             :                                         sub = "Small Business Server 2011 Essentials Edition";
     548             :                                         break;
     549             :                                 case PRODUCT_SERVER_FOR_SB_SOLUTIONS:
     550             :                                         sub = "Server For SB Solutions Edition";
     551             :                                         break;
     552             :                                 case PRODUCT_STANDARD_SERVER_SOLUTIONS:
     553             :                                         sub = "Solutions Premium Edition";
     554             :                                         break;
     555             :                                 case PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE:
     556             :                                         sub = "Solutions Premium Edition (core installation)";
     557             :                                         break;
     558             :                                 case PRODUCT_SB_SOLUTION_SERVER_EM:
     559             :                                         sub = "Server For SB Solutions EM Edition";
     560             :                                         break;
     561             :                                 case PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM:
     562             :                                         sub = "Server For SB Solutions EM Edition";
     563             :                                         break;
     564             :                                 case PRODUCT_SOLUTION_EMBEDDEDSERVER:
     565             :                                         sub = "MultiPoint Server Edition";
     566             :                                         break;
     567             :                                 case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT:
     568             :                                         sub = "Essential Server Solution Management Edition";
     569             :                                         break;
     570             :                                 case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL:
     571             :                                         sub = "Essential Server Solution Additional Edition";
     572             :                                         break;
     573             :                                 case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC:
     574             :                                         sub = "Essential Server Solution Management SVC Edition";
     575             :                                         break;
     576             :                                 case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC:
     577             :                                         sub = "Essential Server Solution Additional SVC Edition";
     578             :                                         break;
     579             :                                 case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE:
     580             :                                         sub = "Small Business Server Premium Edition (core installation)";
     581             :                                         break;
     582             :                                 case PRODUCT_CLUSTER_SERVER_V:
     583             :                                         sub = "Hyper Core V Edition";
     584             :                                         break;
     585             :                                 case PRODUCT_STARTER_E:
     586             :                                         sub = "Hyper Core V Edition";
     587             :                                         break;
     588             :                                 case PRODUCT_ENTERPRISE_EVALUATION:
     589             :                                         sub = "Enterprise Edition (evaluation installation)";
     590             :                                         break;
     591             :                                 case PRODUCT_MULTIPOINT_STANDARD_SERVER:
     592             :                                         sub = "MultiPoint Server Standard Edition (full installation)";
     593             :                                         break;
     594             :                                 case PRODUCT_MULTIPOINT_PREMIUM_SERVER:
     595             :                                         sub = "MultiPoint Server Premium Edition (full installation)";
     596             :                                         break;
     597             :                                 case PRODUCT_STANDARD_EVALUATION_SERVER:
     598             :                                         sub = "Standard Edition (evaluation installation)";
     599             :                                         break;
     600             :                                 case PRODUCT_DATACENTER_EVALUATION_SERVER:
     601             :                                         sub = "Datacenter Edition (evaluation installation)";
     602             :                                         break;
     603             :                                 case PRODUCT_ENTERPRISE_N_EVALUATION:
     604             :                                         sub = "Enterprise N Edition (evaluation installation)";
     605             :                                         break;
     606             :                                 case PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER:
     607             :                                         sub = "Storage Server Workgroup Edition (evaluation installation)";
     608             :                                         break;
     609             :                                 case PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER:
     610             :                                         sub = "Storage Server Standard Edition (evaluation installation)";
     611             :                                         break;
     612             :                                 case PRODUCT_CORE_N:
     613             :                                         sub = "Windows 8 N Edition";
     614             :                                         break;
     615             :                                 case PRODUCT_CORE_COUNTRYSPECIFIC:
     616             :                                         sub = "Windows 8 China Edition";
     617             :                                         break;
     618             :                                 case PRODUCT_CORE_SINGLELANGUAGE:
     619             :                                         sub = "Windows 8 Single Language Edition";
     620             :                                         break;
     621             :                                 case PRODUCT_CORE:
     622             :                                         sub = "Windows 8 Edition";
     623             :                                         break;
     624             :                                 case PRODUCT_PROFESSIONAL_WMC:
     625             :                                         sub = "Professional with Media Center Edition";
     626             :                                         break;
     627             :                         }
     628             :                 }
     629             :         } else {
     630             :                 return NULL;
     631             :         }
     632             : 
     633             :         spprintf(&retval, 0, "%s%s%s%s%s", major, sub?" ":"", sub?sub:"", osvi.szCSDVersion[0] != '\0'?" ":"", osvi.szCSDVersion);
     634             :         return retval;
     635             : }
     636             : /* }}}  */
     637             : 
     638             : /* {{{  */
     639             : void php_get_windows_cpu(char *buf, int bufsize)
     640             : {
     641             :         SYSTEM_INFO SysInfo;
     642             :         GetSystemInfo(&SysInfo);
     643             :         switch (SysInfo.wProcessorArchitecture) {
     644             :                 case PROCESSOR_ARCHITECTURE_INTEL :
     645             :                         snprintf(buf, bufsize, "i%d", SysInfo.dwProcessorType);
     646             :                         break;
     647             :                 case PROCESSOR_ARCHITECTURE_MIPS :
     648             :                         snprintf(buf, bufsize, "MIPS R%d000", SysInfo.wProcessorLevel);
     649             :                         break;
     650             :                 case PROCESSOR_ARCHITECTURE_ALPHA :
     651             :                         snprintf(buf, bufsize, "Alpha %d", SysInfo.wProcessorLevel);
     652             :                         break;
     653             :                 case PROCESSOR_ARCHITECTURE_PPC :
     654             :                         snprintf(buf, bufsize, "PPC 6%02d", SysInfo.wProcessorLevel);
     655             :                         break;
     656             :                 case PROCESSOR_ARCHITECTURE_IA64 :
     657             :                         snprintf(buf, bufsize,  "IA64");
     658             :                         break;
     659             : #if defined(PROCESSOR_ARCHITECTURE_IA32_ON_WIN64)
     660             :                 case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 :
     661             :                         snprintf(buf, bufsize, "IA32");
     662             :                         break;
     663             : #endif
     664             : #if defined(PROCESSOR_ARCHITECTURE_AMD64)
     665             :                 case PROCESSOR_ARCHITECTURE_AMD64 :
     666             :                         snprintf(buf, bufsize, "AMD64");
     667             :                         break;
     668             : #endif
     669             :                 case PROCESSOR_ARCHITECTURE_UNKNOWN :
     670             :                 default:
     671             :                         snprintf(buf, bufsize, "Unknown");
     672             :                         break;
     673             :         }
     674             : }
     675             : /* }}}  */
     676             : #endif
     677             : 
     678             : /* {{{ php_get_uname
     679             :  */
     680        1235 : PHPAPI zend_string *php_get_uname(char mode)
     681             : {
     682             :         char *php_uname;
     683             :         char tmp_uname[256];
     684             : #ifdef PHP_WIN32
     685             :         DWORD dwBuild=0;
     686             :         DWORD dwVersion = GetVersion();
     687             :         DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
     688             :         DWORD dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
     689             :         DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
     690             :         char ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
     691             : 
     692             :         GetComputerName(ComputerName, &dwSize);
     693             : 
     694             :         if (mode == 's') {
     695             :                 php_uname = "Windows NT";
     696             :         } else if (mode == 'r') {
     697             :                 snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d", dwWindowsMajorVersion, dwWindowsMinorVersion);
     698             :                 php_uname = tmp_uname;
     699             :         } else if (mode == 'n') {
     700             :                 php_uname = ComputerName;
     701             :         } else if (mode == 'v') {
     702             :                 char *winver = php_get_windows_name();
     703             :                 dwBuild = (DWORD)(HIWORD(dwVersion));
     704             :                 if(winver == NULL) {
     705             :                         snprintf(tmp_uname, sizeof(tmp_uname), "build %d", dwBuild);
     706             :                 } else {
     707             :                         snprintf(tmp_uname, sizeof(tmp_uname), "build %d (%s)", dwBuild, winver);
     708             :                 }
     709             :                 php_uname = tmp_uname;
     710             :                 if(winver) {
     711             :                         efree(winver);
     712             :                 }
     713             :         } else if (mode == 'm') {
     714             :                 php_get_windows_cpu(tmp_uname, sizeof(tmp_uname));
     715             :                 php_uname = tmp_uname;
     716             :         } else { /* assume mode == 'a' */
     717             :                 char *winver = php_get_windows_name();
     718             :                 char wincpu[20];
     719             : 
     720             :                 ZEND_ASSERT(winver != NULL);
     721             : 
     722             :                 php_get_windows_cpu(wincpu, sizeof(wincpu));
     723             :                 dwBuild = (DWORD)(HIWORD(dwVersion));
     724             : 
     725             :                 /* Windows "version" 6.2 could be Windows 8/Windows Server 2012, but also Windows 8.1/Windows Server 2012 R2 */
     726             :                 if (dwWindowsMajorVersion == 6 && dwWindowsMinorVersion == 2) {
     727             :                         if (strncmp(winver, "Windows 8.1", 11) == 0 || strncmp(winver, "Windows Server 2012 R2", 22) == 0) {
     728             :                                 dwWindowsMinorVersion = 3;
     729             :                         }
     730             :                 }
     731             : 
     732             :                 snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s",
     733             :                                  "Windows NT", ComputerName,
     734             :                                  dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown", wincpu);
     735             :                 if(winver) {
     736             :                         efree(winver);
     737             :                 }
     738             :                 php_uname = tmp_uname;
     739             :         }
     740             : #else
     741             : #ifdef HAVE_SYS_UTSNAME_H
     742             :         struct utsname buf;
     743        1235 :         if (uname((struct utsname *)&buf) == -1) {
     744           0 :                 php_uname = PHP_UNAME;
     745             :         } else {
     746             : #ifdef NETWARE
     747             :                 if (mode == 's') {
     748             :                         php_uname = buf.sysname;
     749             :                 } else if (mode == 'r') {
     750             :                         snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d",
     751             :                                          buf.netware_major, buf.netware_minor, buf.netware_revision);
     752             :                         php_uname = tmp_uname;
     753             :                 } else if (mode == 'n') {
     754             :                         php_uname = buf.servername;
     755             :                 } else if (mode == 'v') {
     756             :                         snprintf(tmp_uname, sizeof(tmp_uname), "libc-%d.%d.%d #%d",
     757             :                                          buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold);
     758             :                         php_uname = tmp_uname;
     759             :                 } else if (mode == 'm') {
     760             :                         php_uname = buf.machine;
     761             :                 } else { /* assume mode == 'a' */
     762             :                         snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d.%d libc-%d.%d.%d #%d %s",
     763             :                                          buf.sysname, buf.servername,
     764             :                                          buf.netware_major, buf.netware_minor, buf.netware_revision,
     765             :                                          buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold,
     766             :                                          buf.machine);
     767             :                         php_uname = tmp_uname;
     768             :                 }
     769             : #else
     770        1235 :                 if (mode == 's') {
     771           2 :                         php_uname = buf.sysname;
     772        1233 :                 } else if (mode == 'r') {
     773           1 :                         php_uname = buf.release;
     774        1232 :                 } else if (mode == 'n') {
     775        1067 :                         php_uname = buf.nodename;
     776         165 :                 } else if (mode == 'v') {
     777           1 :                         php_uname = buf.version;
     778         164 :                 } else if (mode == 'm') {
     779           2 :                         php_uname = buf.machine;
     780             :                 } else { /* assume mode == 'a' */
     781         162 :                         snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %s %s %s",
     782             :                                          buf.sysname, buf.nodename, buf.release, buf.version,
     783             :                                          buf.machine);
     784         162 :                         php_uname = tmp_uname;
     785             :                 }
     786             : #endif /* NETWARE */
     787             :         }
     788             : #else
     789             :         php_uname = PHP_UNAME;
     790             : #endif
     791             : #endif
     792        2470 :         return zend_string_init(php_uname, strlen(php_uname), 0);
     793             : }
     794             : /* }}} */
     795             : 
     796             : /* {{{ php_print_info_htmlhead
     797             :  */
     798           4 : PHPAPI void php_print_info_htmlhead(void)
     799             : {
     800           4 :         php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
     801           4 :         php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
     802           4 :         php_info_print("<head>\n");
     803           4 :         php_info_print_style();
     804           4 :         php_info_print("<title>phpinfo()</title>");
     805           4 :         php_info_print("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />");
     806           4 :         php_info_print("</head>\n");
     807           4 :         php_info_print("<body><div class=\"center\">\n");
     808           4 : }
     809             : /* }}} */
     810             : 
     811             : /* {{{ module_name_cmp */
     812       53255 : static int module_name_cmp(const void *a, const void *b)
     813             : {
     814       53255 :         Bucket *f = (Bucket *) a;
     815       53255 :         Bucket *s = (Bucket *) b;
     816             : 
     817       53255 :         return strcasecmp(((zend_module_entry *)Z_PTR(f->val))->name,
     818       53255 :                                   ((zend_module_entry *)Z_PTR(s->val))->name);
     819             : }
     820             : /* }}} */
     821             : 
     822             : /* {{{ php_print_info
     823             :  */
     824         155 : PHPAPI void php_print_info(int flag)
     825             : {
     826             :         char **env, *tmp1, *tmp2;
     827             :         zend_string *php_uname;
     828             : 
     829         155 :         if (!sapi_module.phpinfo_as_text) {
     830           3 :                 php_print_info_htmlhead();
     831             :         } else {
     832         152 :                 php_info_print("phpinfo()\n");
     833             :         }
     834             : 
     835         155 :         if (flag & PHP_INFO_GENERAL) {
     836         138 :                 char *zend_version = get_zend_version();
     837             :                 char temp_api[10];
     838             : 
     839         138 :                 php_uname = php_get_uname('a');
     840             : 
     841         138 :                 if (!sapi_module.phpinfo_as_text) {
     842           1 :                         php_info_print_box_start(1);
     843             :                 }
     844             : 
     845         138 :                 if (!sapi_module.phpinfo_as_text) {
     846             :                 time_t the_time;
     847             :                 struct tm *ta, tmbuf;
     848             : 
     849           1 :                 the_time = time(NULL);
     850           1 :                 ta = php_localtime_r(&the_time, &tmbuf);
     851             : 
     852           1 :             php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
     853           1 :                 if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
     854           0 :                         php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
     855             :                 } else {
     856           1 :                         php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
     857             :                         }
     858             :                 }
     859             : 
     860         138 :                 if (!sapi_module.phpinfo_as_text) {
     861           1 :                         php_info_printf("<h1 class=\"p\">PHP Version %s</h1>\n", PHP_VERSION);
     862             :                 } else {
     863         137 :                         php_info_print_table_row(2, "PHP Version", PHP_VERSION);
     864             :                 }
     865         138 :                 php_info_print_box_end();
     866         138 :                 php_info_print_table_start();
     867         138 :                 php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
     868         138 :                 php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
     869             : #ifdef COMPILER
     870             :                 php_info_print_table_row(2, "Compiler", COMPILER);
     871             : #endif
     872             : #ifdef ARCHITECTURE
     873             :                 php_info_print_table_row(2, "Architecture", ARCHITECTURE);
     874             : #endif
     875             : #ifdef CONFIGURE_COMMAND
     876         138 :                 php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND );
     877             : #endif
     878             : 
     879         138 :                 if (sapi_module.pretty_name) {
     880         138 :                         php_info_print_table_row(2, "Server API", sapi_module.pretty_name );
     881             :                 }
     882             : 
     883             : #ifdef VIRTUAL_DIR
     884             :                 php_info_print_table_row(2, "Virtual Directory Support", "enabled" );
     885             : #else
     886         138 :                 php_info_print_table_row(2, "Virtual Directory Support", "disabled" );
     887             : #endif
     888             : 
     889         138 :                 php_info_print_table_row(2, "Configuration File (php.ini) Path", PHP_CONFIG_FILE_PATH);
     890         138 :                 php_info_print_table_row(2, "Loaded Configuration File", php_ini_opened_path ? php_ini_opened_path : "(none)");
     891         138 :                 php_info_print_table_row(2, "Scan this dir for additional .ini files", php_ini_scanned_path ? php_ini_scanned_path : "(none)");
     892         138 :                 php_info_print_table_row(2, "Additional .ini files parsed", php_ini_scanned_files ? php_ini_scanned_files : "(none)");
     893             : 
     894         138 :                 snprintf(temp_api, sizeof(temp_api), "%d", PHP_API_VERSION);
     895         138 :                 php_info_print_table_row(2, "PHP API", temp_api);
     896             : 
     897         138 :                 snprintf(temp_api, sizeof(temp_api), "%d", ZEND_MODULE_API_NO);
     898         138 :                 php_info_print_table_row(2, "PHP Extension", temp_api);
     899             : 
     900         138 :                 snprintf(temp_api, sizeof(temp_api), "%d", ZEND_EXTENSION_API_NO);
     901         138 :                 php_info_print_table_row(2, "Zend Extension", temp_api);
     902             : 
     903         138 :                 php_info_print_table_row(2, "Zend Extension Build", ZEND_EXTENSION_BUILD_ID);
     904         138 :                 php_info_print_table_row(2, "PHP Extension Build", ZEND_MODULE_BUILD_ID);
     905             : 
     906             : #if ZEND_DEBUG
     907             :                 php_info_print_table_row(2, "Debug Build", "yes" );
     908             : #else
     909         138 :                 php_info_print_table_row(2, "Debug Build", "no" );
     910             : #endif
     911             : 
     912             : #ifdef ZTS
     913             :                 php_info_print_table_row(2, "Thread Safety", "enabled" );
     914             : #else
     915         138 :                 php_info_print_table_row(2, "Thread Safety", "disabled" );
     916             : #endif
     917             : 
     918             : #ifdef ZEND_SIGNALS
     919         138 :                 php_info_print_table_row(2, "Zend Signal Handling", "enabled" );
     920             : #else
     921             :                 php_info_print_table_row(2, "Zend Signal Handling", "disabled" );
     922             : #endif
     923             : 
     924         138 :                 php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm() ? "enabled" : "disabled" );
     925             : 
     926             :                 {
     927         138 :                         const zend_multibyte_functions *functions = zend_multibyte_get_functions();
     928             :                         char *descr;
     929         138 :                         if (functions) {
     930         138 :                                 spprintf(&descr, 0, "provided by %s", functions->provider_name);
     931             :                         } else {
     932           0 :                                 descr = estrdup("disabled");
     933             :                         }
     934         138 :             php_info_print_table_row(2, "Zend Multibyte Support", descr);
     935         138 :                         efree(descr);
     936             :                 }
     937             : 
     938             : #if HAVE_IPV6
     939         138 :                 php_info_print_table_row(2, "IPv6 Support", "enabled" );
     940             : #else
     941             :                 php_info_print_table_row(2, "IPv6 Support", "disabled" );
     942             : #endif
     943             : 
     944             : #if HAVE_DTRACE
     945             :                 php_info_print_table_row(2, "DTrace Support", "enabled" );
     946             : #else
     947         138 :                 php_info_print_table_row(2, "DTrace Support", "disabled" );
     948             : #endif
     949             : 
     950         138 :                 php_info_print_stream_hash("PHP Streams",  php_stream_get_url_stream_wrappers_hash());
     951         138 :                 php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash());
     952         138 :                 php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash());
     953             : 
     954         138 :                 php_info_print_table_end();
     955             : 
     956             :                 /* Zend Engine */
     957         138 :                 php_info_print_box_start(0);
     958         138 :                 if (!sapi_module.phpinfo_as_text) {
     959           1 :                         php_info_print("<a href=\"http://www.zend.com/\"><img border=\"0\" src=\"");
     960           1 :                         php_info_print(ZEND_LOGO_DATA_URI "\" alt=\"Zend logo\" /></a>\n");
     961             :                 }
     962         138 :                 php_info_print("This program makes use of the Zend Scripting Language Engine:");
     963         138 :                 php_info_print(!sapi_module.phpinfo_as_text?"<br />":"\n");
     964         138 :                 if (sapi_module.phpinfo_as_text) {
     965         137 :                         php_info_print(zend_version);
     966             :                 } else {
     967           1 :                         zend_html_puts(zend_version, strlen(zend_version));
     968             :                 }
     969         138 :                 php_info_print_box_end();
     970             :                 zend_string_free(php_uname);
     971             :         }
     972             : 
     973         155 :         zend_ini_sort_entries();
     974             : 
     975         155 :         if (flag & PHP_INFO_CONFIGURATION) {
     976         138 :                 php_info_print_hr();
     977         138 :                 if (!sapi_module.phpinfo_as_text) {
     978           1 :                         php_info_print("<h1>Configuration</h1>\n");
     979             :                 } else {
     980         137 :                         SECTION("Configuration");
     981             :                 }
     982         138 :                 if (!(flag & PHP_INFO_MODULES)) {
     983           0 :                         SECTION("PHP Core");
     984           0 :                         display_ini_entries(NULL);
     985             :                 }
     986             :         }
     987             : 
     988         155 :         if (flag & PHP_INFO_MODULES) {
     989             :                 HashTable sorted_registry;
     990             : 
     991         150 :                 zend_hash_init(&sorted_registry, zend_hash_num_elements(&module_registry), NULL, NULL, 1);
     992         150 :                 zend_hash_copy(&sorted_registry, &module_registry, NULL);
     993         150 :                 zend_hash_sort(&sorted_registry, module_name_cmp, 0);
     994             : 
     995         150 :                 zend_hash_apply(&sorted_registry, _display_module_info_func);
     996             : 
     997         150 :                 SECTION("Additional Modules");
     998         150 :                 php_info_print_table_start();
     999         150 :                 php_info_print_table_header(1, "Module Name");
    1000         150 :                 zend_hash_apply(&sorted_registry, _display_module_info_def);
    1001         150 :                 php_info_print_table_end();
    1002             : 
    1003         150 :                 zend_hash_destroy(&sorted_registry);
    1004             :         }
    1005             : 
    1006         155 :         if (flag & PHP_INFO_ENVIRONMENT) {
    1007         138 :                 SECTION("Environment");
    1008         138 :                 php_info_print_table_start();
    1009         138 :                 php_info_print_table_header(2, "Variable", "Value");
    1010        7177 :                 for (env=environ; env!=NULL && *env !=NULL; env++) {
    1011        7039 :                         tmp1 = estrdup(*env);
    1012        7039 :                         if (!(tmp2=strchr(tmp1,'='))) { /* malformed entry? */
    1013           0 :                                 efree(tmp1);
    1014           0 :                                 continue;
    1015             :                         }
    1016        7039 :                         *tmp2 = 0;
    1017        7039 :                         tmp2++;
    1018        7039 :                         php_info_print_table_row(2, tmp1, tmp2);
    1019        7039 :                         efree(tmp1);
    1020             :                 }
    1021         138 :                 php_info_print_table_end();
    1022             :         }
    1023             : 
    1024         155 :         if (flag & PHP_INFO_VARIABLES) {
    1025             :                 zval *data;
    1026             : 
    1027         139 :                 SECTION("PHP Variables");
    1028             : 
    1029         139 :                 php_info_print_table_start();
    1030         139 :                 php_info_print_table_header(2, "Variable", "Value");
    1031         140 :                 if ((data = zend_hash_str_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) {
    1032           0 :                         php_info_print_table_row(2, "PHP_SELF", Z_STRVAL_P(data));
    1033             :                 }
    1034         139 :                 if ((data = zend_hash_str_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) {
    1035           0 :                         php_info_print_table_row(2, "PHP_AUTH_TYPE", Z_STRVAL_P(data));
    1036             :                 }
    1037         139 :                 if ((data = zend_hash_str_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) {
    1038           0 :                         php_info_print_table_row(2, "PHP_AUTH_USER", Z_STRVAL_P(data));
    1039             :                 }
    1040         139 :                 if ((data = zend_hash_str_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) {
    1041           0 :                         php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_P(data));
    1042             :                 }
    1043         139 :                 php_print_gpcse_array(ZEND_STRL("_REQUEST"));
    1044         139 :                 php_print_gpcse_array(ZEND_STRL("_GET"));
    1045         139 :                 php_print_gpcse_array(ZEND_STRL("_POST"));
    1046         139 :                 php_print_gpcse_array(ZEND_STRL("_FILES"));
    1047         139 :                 php_print_gpcse_array(ZEND_STRL("_COOKIE"));
    1048         139 :                 php_print_gpcse_array(ZEND_STRL("_SERVER"));
    1049         139 :                 php_print_gpcse_array(ZEND_STRL("_ENV"));
    1050         139 :                 php_info_print_table_end();
    1051             :         }
    1052             : 
    1053             : 
    1054         155 :         if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
    1055           1 :                 php_info_print_hr();
    1056           1 :                 php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE);
    1057             :         }
    1058             : 
    1059         155 :         if (flag & PHP_INFO_LICENSE) {
    1060         140 :                 if (!sapi_module.phpinfo_as_text) {
    1061           2 :                         SECTION("PHP License");
    1062           2 :                         php_info_print_box_start(0);
    1063           2 :                         php_info_print("<p>\n");
    1064           2 :                         php_info_print("This program is free software; you can redistribute it and/or modify ");
    1065           2 :                         php_info_print("it under the terms of the PHP License as published by the PHP Group ");
    1066           2 :                         php_info_print("and included in the distribution in the file:  LICENSE\n");
    1067           2 :                         php_info_print("</p>\n");
    1068           2 :                         php_info_print("<p>");
    1069           2 :                         php_info_print("This program is distributed in the hope that it will be useful, ");
    1070           2 :                         php_info_print("but WITHOUT ANY WARRANTY; without even the implied warranty of ");
    1071           2 :                         php_info_print("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
    1072           2 :                         php_info_print("</p>\n");
    1073           2 :                         php_info_print("<p>");
    1074           2 :                         php_info_print("If you did not receive a copy of the PHP license, or have any questions about ");
    1075           2 :                         php_info_print("PHP licensing, please contact license@php.net.\n");
    1076           2 :                         php_info_print("</p>\n");
    1077           2 :                         php_info_print_box_end();
    1078             :                 } else {
    1079         138 :                         php_info_print("\nPHP License\n");
    1080         138 :                         php_info_print("This program is free software; you can redistribute it and/or modify\n");
    1081         138 :                         php_info_print("it under the terms of the PHP License as published by the PHP Group\n");
    1082         138 :                         php_info_print("and included in the distribution in the file:  LICENSE\n");
    1083         138 :                         php_info_print("\n");
    1084         138 :                         php_info_print("This program is distributed in the hope that it will be useful,\n");
    1085         138 :                         php_info_print("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
    1086         138 :                         php_info_print("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
    1087         138 :                         php_info_print("\n");
    1088         138 :                         php_info_print("If you did not receive a copy of the PHP license, or have any\n");
    1089         138 :                         php_info_print("questions about PHP licensing, please contact license@php.net.\n");
    1090             :                 }
    1091             :         }
    1092             : 
    1093         155 :         if (!sapi_module.phpinfo_as_text) {
    1094           3 :                 php_info_print("</div></body></html>");
    1095             :         }
    1096         155 : }
    1097             : /* }}} */
    1098             : 
    1099       27481 : PHPAPI void php_info_print_table_start(void) /* {{{ */
    1100             : {
    1101       27481 :         if (!sapi_module.phpinfo_as_text) {
    1102         131 :                 php_info_print("<table>\n");
    1103             :         } else {
    1104       27350 :                 php_info_print("\n");
    1105             :         }
    1106       27481 : }
    1107             : /* }}} */
    1108             : 
    1109       27618 : PHPAPI void php_info_print_table_end(void) /* {{{ */
    1110             : {
    1111       27618 :         if (!sapi_module.phpinfo_as_text) {
    1112         131 :                 php_info_print("</table>\n");
    1113             :         }
    1114             : 
    1115       27618 : }
    1116             : /* }}} */
    1117             : 
    1118         291 : PHPAPI void php_info_print_box_start(int flag) /* {{{ */
    1119             : {
    1120         291 :         php_info_print_table_start();
    1121         291 :         if (flag) {
    1122           1 :                 if (!sapi_module.phpinfo_as_text) {
    1123           1 :                         php_info_print("<tr class=\"h\"><td>\n");
    1124             :                 }
    1125             :         } else {
    1126         290 :                 if (!sapi_module.phpinfo_as_text) {
    1127           4 :                         php_info_print("<tr class=\"v\"><td>\n");
    1128             :                 } else {
    1129         286 :                         php_info_print("\n");
    1130             :                 }
    1131             :         }
    1132         291 : }
    1133             : /* }}} */
    1134             : 
    1135         428 : PHPAPI void php_info_print_box_end(void) /* {{{ */
    1136             : {
    1137         428 :         if (!sapi_module.phpinfo_as_text) {
    1138           5 :                 php_info_print("</td></tr>\n");
    1139             :         }
    1140         428 :         php_info_print_table_end();
    1141         428 : }
    1142             : /* }}} */
    1143             : 
    1144         139 : PHPAPI void php_info_print_hr(void) /* {{{ */
    1145             : {
    1146         139 :         if (!sapi_module.phpinfo_as_text) {
    1147           2 :                 php_info_print("<hr />\n");
    1148             :         } else {
    1149         137 :                 php_info_print("\n\n _______________________________________________________________________\n\n");
    1150             :         }
    1151         139 : }
    1152             : /* }}} */
    1153             : 
    1154          15 : PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* {{{ */
    1155             : {
    1156             :         int spaces;
    1157             : 
    1158          15 :         if (!sapi_module.phpinfo_as_text) {
    1159          10 :                 php_info_printf("<tr class=\"h\"><th colspan=\"%d\">%s</th></tr>\n", num_cols, header );
    1160             :         } else {
    1161           5 :                 spaces = (int)(74 - strlen(header));
    1162           5 :                 php_info_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " ");
    1163             :         }
    1164          15 : }
    1165             : /* }}} */
    1166             : 
    1167             : /* {{{ php_info_print_table_header
    1168             :  */
    1169       19995 : PHPAPI void php_info_print_table_header(int num_cols, ...)
    1170             : {
    1171             :         int i;
    1172             :         va_list row_elements;
    1173             :         char *row_element;
    1174             : 
    1175       19995 :         va_start(row_elements, num_cols);
    1176       19995 :         if (!sapi_module.phpinfo_as_text) {
    1177          74 :                 php_info_print("<tr class=\"h\">");
    1178             :         }
    1179       52882 :         for (i=0; i<num_cols; i++) {
    1180       32887 :                 row_element = va_arg(row_elements, char *);
    1181       32887 :                 if (!row_element || !*row_element) {
    1182         300 :                         row_element = " ";
    1183             :                 }
    1184       32887 :                 if (!sapi_module.phpinfo_as_text) {
    1185         168 :                         php_info_print("<th>");
    1186         168 :                         php_info_print(row_element);
    1187         168 :                         php_info_print("</th>");
    1188             :                 } else {
    1189       32719 :                         php_info_print(row_element);
    1190       32719 :                         if (i < num_cols-1) {
    1191       12798 :                                 php_info_print(" => ");
    1192             :                         } else {
    1193       19921 :                                 php_info_print("\n");
    1194             :                         }
    1195             :                 }
    1196             :         }
    1197       19995 :         if (!sapi_module.phpinfo_as_text) {
    1198          74 :                 php_info_print("</tr>\n");
    1199             :         }
    1200             : 
    1201       19995 :         va_end(row_elements);
    1202       19995 : }
    1203             : /* }}} */
    1204             : 
    1205             : /* {{{ php_info_print_table_row_internal
    1206             :  */
    1207       69937 : static void php_info_print_table_row_internal(int num_cols,
    1208             :                 const char *value_class, va_list row_elements)
    1209             : {
    1210             :         int i;
    1211             :         char *row_element;
    1212             : 
    1213       69937 :         if (!sapi_module.phpinfo_as_text) {
    1214         682 :                 php_info_print("<tr>");
    1215             :         }
    1216      209800 :         for (i=0; i<num_cols; i++) {
    1217      139863 :                 if (!sapi_module.phpinfo_as_text) {
    1218        1357 :                         php_info_printf("<td class=\"%s\">",
    1219             :                            (i==0 ? "e" : value_class )
    1220             :                         );
    1221             :                 }
    1222      139863 :                 row_element = va_arg(row_elements, char *);
    1223      140013 :                 if (!row_element || !*row_element) {
    1224         150 :                         if (!sapi_module.phpinfo_as_text) {
    1225           1 :                                 php_info_print( "<i>no value</i>" );
    1226             :                         } else {
    1227         149 :                                 php_info_print( " " );
    1228             :                         }
    1229             :                 } else {
    1230      139713 :                         if (!sapi_module.phpinfo_as_text) {
    1231        1356 :                                 php_info_print_html_esc(row_element, strlen(row_element));
    1232             :                         } else {
    1233      138357 :                                 php_info_print(row_element);
    1234      138357 :                                 if (i < num_cols-1) {
    1235       69251 :                                         php_info_print(" => ");
    1236             :                                 }
    1237             :                         }
    1238             :                 }
    1239      139863 :                 if (!sapi_module.phpinfo_as_text) {
    1240        1357 :                         php_info_print(" </td>");
    1241      138506 :                 } else if (i == (num_cols - 1)) {
    1242       69255 :                         php_info_print("\n");
    1243             :                 }
    1244             :         }
    1245       69937 :         if (!sapi_module.phpinfo_as_text) {
    1246         682 :                 php_info_print("</tr>\n");
    1247             :         }
    1248       69937 : }
    1249             : /* }}} */
    1250             : 
    1251             : /* {{{ php_info_print_table_row
    1252             :  */
    1253       69937 : PHPAPI void php_info_print_table_row(int num_cols, ...)
    1254             : {
    1255             :         va_list row_elements;
    1256             : 
    1257       69937 :         va_start(row_elements, num_cols);
    1258       69937 :         php_info_print_table_row_internal(num_cols, "v", row_elements);
    1259       69937 :         va_end(row_elements);
    1260       69937 : }
    1261             : /* }}} */
    1262             : 
    1263             : /* {{{ php_info_print_table_row_ex
    1264             :  */
    1265           0 : PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class,
    1266             :                 ...)
    1267             : {
    1268             :         va_list row_elements;
    1269             : 
    1270           0 :         va_start(row_elements, value_class);
    1271           0 :         php_info_print_table_row_internal(num_cols, value_class, row_elements);
    1272           0 :         va_end(row_elements);
    1273           0 : }
    1274             : /* }}} */
    1275             : 
    1276             : /* {{{ register_phpinfo_constants
    1277             :  */
    1278       23453 : void register_phpinfo_constants(INIT_FUNC_ARGS)
    1279             : {
    1280       23453 :         REGISTER_LONG_CONSTANT("INFO_GENERAL", PHP_INFO_GENERAL, CONST_PERSISTENT|CONST_CS);
    1281       23453 :         REGISTER_LONG_CONSTANT("INFO_CREDITS", PHP_INFO_CREDITS, CONST_PERSISTENT|CONST_CS);
    1282       23453 :         REGISTER_LONG_CONSTANT("INFO_CONFIGURATION", PHP_INFO_CONFIGURATION, CONST_PERSISTENT|CONST_CS);
    1283       23453 :         REGISTER_LONG_CONSTANT("INFO_MODULES", PHP_INFO_MODULES, CONST_PERSISTENT|CONST_CS);
    1284       23453 :         REGISTER_LONG_CONSTANT("INFO_ENVIRONMENT", PHP_INFO_ENVIRONMENT, CONST_PERSISTENT|CONST_CS);
    1285       23453 :         REGISTER_LONG_CONSTANT("INFO_VARIABLES", PHP_INFO_VARIABLES, CONST_PERSISTENT|CONST_CS);
    1286       23453 :         REGISTER_LONG_CONSTANT("INFO_LICENSE", PHP_INFO_LICENSE, CONST_PERSISTENT|CONST_CS);
    1287       23453 :         REGISTER_LONG_CONSTANT("INFO_ALL", PHP_INFO_ALL, CONST_PERSISTENT|CONST_CS);
    1288       23453 :         REGISTER_LONG_CONSTANT("CREDITS_GROUP",       PHP_CREDITS_GROUP, CONST_PERSISTENT|CONST_CS);
    1289       23453 :         REGISTER_LONG_CONSTANT("CREDITS_GENERAL",     PHP_CREDITS_GENERAL, CONST_PERSISTENT|CONST_CS);
    1290       23453 :         REGISTER_LONG_CONSTANT("CREDITS_SAPI",        PHP_CREDITS_SAPI, CONST_PERSISTENT|CONST_CS);
    1291       23453 :         REGISTER_LONG_CONSTANT("CREDITS_MODULES",     PHP_CREDITS_MODULES, CONST_PERSISTENT|CONST_CS);
    1292       23453 :         REGISTER_LONG_CONSTANT("CREDITS_DOCS",        PHP_CREDITS_DOCS, CONST_PERSISTENT|CONST_CS);
    1293       23453 :         REGISTER_LONG_CONSTANT("CREDITS_FULLPAGE",    PHP_CREDITS_FULLPAGE, CONST_PERSISTENT|CONST_CS);
    1294       23453 :         REGISTER_LONG_CONSTANT("CREDITS_QA",  PHP_CREDITS_QA, CONST_PERSISTENT|CONST_CS);
    1295       23453 :         REGISTER_LONG_CONSTANT("CREDITS_ALL", PHP_CREDITS_ALL, CONST_PERSISTENT|CONST_CS);
    1296       23453 : }
    1297             : /* }}} */
    1298             : 
    1299             : /* {{{ proto void phpinfo([int what])
    1300             :    Output a page of useful information about PHP and the current request */
    1301         156 : PHP_FUNCTION(phpinfo)
    1302             : {
    1303         156 :         zend_long flag = PHP_INFO_ALL;
    1304             : 
    1305         156 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
    1306           2 :                 return;
    1307             :         }
    1308             : 
    1309             :         /* Andale!  Andale!  Yee-Hah! */
    1310         154 :         php_output_start_default();
    1311         154 :         php_print_info((int)flag);
    1312         154 :         php_output_end();
    1313             : 
    1314         154 :         RETURN_TRUE;
    1315             : }
    1316             : 
    1317             : /* }}} */
    1318             : 
    1319             : /* {{{ proto string phpversion([string extension])
    1320             :    Return the current PHP version */
    1321          17 : PHP_FUNCTION(phpversion)
    1322             : {
    1323          17 :         char *ext_name = NULL;
    1324          17 :         size_t ext_name_len = 0;
    1325             : 
    1326          17 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext_name, &ext_name_len) == FAILURE) {
    1327           0 :                 return;
    1328             :         }
    1329             : 
    1330          17 :         if (!ext_name) {
    1331          32 :                 RETURN_STRING(PHP_VERSION);
    1332             :         } else {
    1333             :                 const char *version;
    1334           1 :                 version = zend_get_module_version(ext_name);
    1335           1 :                 if (version == NULL) {
    1336           0 :                         RETURN_FALSE;
    1337             :                 }
    1338           2 :                 RETURN_STRING(version);
    1339             :         }
    1340             : }
    1341             : /* }}} */
    1342             : 
    1343             : /* {{{ proto void phpcredits([int flag])
    1344             :    Prints the list of people who've contributed to the PHP project */
    1345           8 : PHP_FUNCTION(phpcredits)
    1346             : {
    1347           8 :         zend_long flag = PHP_CREDITS_ALL;
    1348             : 
    1349           8 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
    1350           2 :                 return;
    1351             :         }
    1352             : 
    1353           6 :         php_print_credits((int)flag);
    1354           6 :         RETURN_TRUE;
    1355             : }
    1356             : /* }}} */
    1357             : 
    1358             : /* {{{ proto string php_sapi_name(void)
    1359             :    Return the current SAPI module name */
    1360          95 : PHP_FUNCTION(php_sapi_name)
    1361             : {
    1362          95 :         if (zend_parse_parameters_none() == FAILURE) {
    1363           0 :                 return;
    1364             :         }
    1365             : 
    1366          95 :         if (sapi_module.name) {
    1367         190 :                 RETURN_STRING(sapi_module.name);
    1368             :         } else {
    1369           0 :                 RETURN_FALSE;
    1370             :         }
    1371             : }
    1372             : 
    1373             : /* }}} */
    1374             : 
    1375             : /* {{{ proto string php_uname(void)
    1376             :    Return information about the system PHP was built on */
    1377        1102 : PHP_FUNCTION(php_uname)
    1378             : {
    1379        1102 :         char *mode = "a";
    1380        1102 :         size_t modelen = sizeof("a")-1;
    1381             : 
    1382        1102 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &mode, &modelen) == FAILURE) {
    1383           5 :                 return;
    1384             :         }
    1385        1097 :         RETURN_STR(php_get_uname(*mode));
    1386             : }
    1387             : 
    1388             : /* }}} */
    1389             : 
    1390             : /* {{{ proto string php_ini_scanned_files(void)
    1391             :    Return comma-separated string of .ini files parsed from the additional ini dir */
    1392           2 : PHP_FUNCTION(php_ini_scanned_files)
    1393             : {
    1394           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1395           0 :                 return;
    1396             :         }
    1397             : 
    1398           2 :         if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) {
    1399             :                 RETURN_STRING(php_ini_scanned_files);
    1400             :         } else {
    1401           2 :                 RETURN_FALSE;
    1402             :         }
    1403             : }
    1404             : /* }}} */
    1405             : 
    1406             : /* {{{ proto string php_ini_loaded_file(void)
    1407             :    Return the actual loaded ini filename */
    1408           2 : PHP_FUNCTION(php_ini_loaded_file)
    1409             : {
    1410           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1411           0 :                 return;
    1412             :         }
    1413             : 
    1414           2 :         if (php_ini_opened_path) {
    1415           2 :                 RETURN_STRING(php_ini_opened_path);
    1416             :         } else {
    1417           1 :                 RETURN_FALSE;
    1418             :         }
    1419             : }
    1420             : /* }}} */
    1421             : 
    1422             : /*
    1423             :  * Local variables:
    1424             :  * tab-width: 4
    1425             :  * c-basic-offset: 4
    1426             :  * End:
    1427             :  * vim600: sw=4 ts=4 fdm=marker
    1428             :  * vim<600: sw=4 ts=4
    1429             :  */

Generated by: LCOV version 1.10

Generated at Tue, 26 Jul 2016 17:07:46 +0000 (2 hours ago)

Copyright © 2005-2016 The PHP Group
All rights reserved.