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: 472 525 89.9 %
Date: 2014-07-23 Functions: 34 35 97.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* 
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 5                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1997-2013 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@easydns.com>                          |
      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             : 
      41             : #ifdef PHP_WIN32
      42             : typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
      43             : typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
      44             : 
      45             : # include "winver.h"
      46             : 
      47             : #if _MSC_VER < 1300
      48             : # define OSVERSIONINFOEX php_win_OSVERSIONINFOEX
      49             : #endif
      50             : 
      51             : #endif
      52             : 
      53             : #if HAVE_MBSTRING
      54             : #include "ext/mbstring/mbstring.h"
      55             : ZEND_EXTERN_MODULE_GLOBALS(mbstring)
      56             : #endif
      57             : 
      58             : #if HAVE_ICONV
      59             : #include "ext/iconv/php_iconv.h"
      60             : ZEND_EXTERN_MODULE_GLOBALS(iconv)
      61             : #endif
      62             : 
      63             : #define SECTION(name)   if (!sapi_module.phpinfo_as_text) { \
      64             :                                                         PUTS("<h2>" name "</h2>\n"); \
      65             :                                                 } else { \
      66             :                                                         php_info_print_table_start(); \
      67             :                                                         php_info_print_table_header(1, name); \
      68             :                                                         php_info_print_table_end(); \
      69             :                                                 } \
      70             : 
      71             : PHPAPI extern char *php_ini_opened_path;
      72             : PHPAPI extern char *php_ini_scanned_path;
      73             : PHPAPI extern char *php_ini_scanned_files;
      74             :         
      75           3 : static int php_info_write_wrapper(const char *str, uint str_length)
      76             : {
      77             :         int new_len, written;
      78             :         char *elem_esc;
      79             : 
      80             :         TSRMLS_FETCH();
      81             : 
      82           3 :         elem_esc = php_escape_html_entities((unsigned char *)str, str_length, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
      83             : 
      84           3 :         written = php_body_write(elem_esc, new_len TSRMLS_CC);
      85             : 
      86           3 :         efree(elem_esc);
      87             : 
      88           3 :         return written;
      89             : }
      90             : 
      91             : 
      92       11105 : PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {{{ */
      93             : {
      94       21766 :         if (zend_module->info_func || zend_module->version) {
      95       10661 :                 if (!sapi_module.phpinfo_as_text) {
      96          73 :                         php_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", zend_module->name, zend_module->name);
      97             :                 } else {
      98       10588 :                         php_info_print_table_start();
      99       10588 :                         php_info_print_table_header(1, zend_module->name);
     100       10588 :                         php_info_print_table_end();
     101             :                 }
     102       10661 :                 if (zend_module->info_func) {
     103       10661 :                         zend_module->info_func(zend_module TSRMLS_CC);
     104             :                 } else {
     105           0 :                         php_info_print_table_start();
     106           0 :                         php_info_print_table_row(2, "Version", zend_module->version);
     107           0 :                         php_info_print_table_end();
     108           0 :                         DISPLAY_INI_ENTRIES();
     109             :                 }
     110             :         } else {
     111         444 :                 if (!sapi_module.phpinfo_as_text) {
     112           3 :                         php_printf("<tr><td>%s</td></tr>\n", zend_module->name);
     113             :                 } else {
     114         441 :                         php_printf("%s\n", zend_module->name);
     115             :                 }       
     116             :         }
     117       11105 : }
     118             : /* }}} */
     119             : 
     120       11101 : static int _display_module_info_func(zend_module_entry *module TSRMLS_DC) /* {{{ */
     121             : {
     122       11101 :         if (module->info_func || module->version) {
     123       10657 :                 php_info_print_module(module TSRMLS_CC);
     124             :         }
     125       11101 :         return ZEND_HASH_APPLY_KEEP;
     126             : }
     127             : /* }}} */
     128             : 
     129       11101 : static int _display_module_info_def(zend_module_entry *module TSRMLS_DC) /* {{{ */
     130             : {
     131       11101 :         if (!module->info_func && !module->version) {
     132         444 :                 php_info_print_module(module TSRMLS_CC);
     133             :         }
     134       11101 :         return ZEND_HASH_APPLY_KEEP;
     135             : }
     136             : /* }}} */
     137             : 
     138             : /* {{{ php_print_gpcse_array
     139             :  */
     140         966 : static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
     141             : {
     142             :         zval **data, **tmp, tmp2;
     143             :         char *string_key;
     144             :         uint string_len;
     145             :         ulong num_key;
     146             : 
     147         966 :         zend_is_auto_global(name, name_length TSRMLS_CC);
     148             : 
     149        1932 :         if (zend_hash_find(&EG(symbol_table), name, name_length+1, (void **) &data)!=FAILURE
     150        1932 :                 && (Z_TYPE_PP(data)==IS_ARRAY)) {
     151         966 :                 zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data));
     152       15926 :                 while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) {
     153       13994 :                         if (!sapi_module.phpinfo_as_text) {
     154         106 :                                 PUTS("<tr>");
     155         106 :                                 PUTS("<td class=\"e\">");
     156             : 
     157             :                         }
     158             : 
     159       13994 :                         PUTS(name);
     160       13994 :                         PUTS("[\"");
     161             :                         
     162       13994 :                         switch (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL)) {
     163             :                                 case HASH_KEY_IS_STRING:
     164       13994 :                                         if (!sapi_module.phpinfo_as_text) {
     165         106 :                                                 php_info_html_esc_write(string_key, string_len - 1 TSRMLS_CC);
     166             :                                         } else {
     167       13888 :                                                 PHPWRITE(string_key, string_len - 1);
     168             :                                         }       
     169       13994 :                                         break;
     170             :                                 case HASH_KEY_IS_LONG:
     171           0 :                                         php_printf("%ld", num_key);
     172             :                                         break;
     173             :                         }
     174       13994 :                         PUTS("\"]");
     175       13994 :                         if (!sapi_module.phpinfo_as_text) {
     176         106 :                                 PUTS("</td><td class=\"v\">");
     177             :                         } else {
     178       13888 :                                 PUTS(" => ");
     179             :                         }
     180       13994 :                         if (Z_TYPE_PP(tmp) == IS_ARRAY) {
     181         138 :                                 if (!sapi_module.phpinfo_as_text) {
     182           1 :                                         PUTS("<pre>");
     183           1 :                                         zend_print_zval_r_ex((zend_write_func_t) php_info_write_wrapper, *tmp, 0 TSRMLS_CC);
     184           1 :                                         PUTS("</pre>");
     185             :                                 } else {
     186         137 :                                         zend_print_zval_r(*tmp, 0 TSRMLS_CC);
     187             :                                 }
     188       13856 :                         } else if (Z_TYPE_PP(tmp) != IS_STRING) {
     189         276 :                                 tmp2 = **tmp;
     190         276 :                                 zval_copy_ctor(&tmp2);
     191         276 :                                 convert_to_string(&tmp2);
     192         276 :                                 if (!sapi_module.phpinfo_as_text) {
     193           2 :                                         if (Z_STRLEN(tmp2) == 0) {
     194           0 :                                                 PUTS("<i>no value</i>");
     195             :                                         } else {
     196           2 :                                                 php_info_html_esc_write(Z_STRVAL(tmp2), Z_STRLEN(tmp2) TSRMLS_CC);
     197             :                                         } 
     198             :                                 } else {
     199         274 :                                         PHPWRITE(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
     200             :                                 }       
     201         276 :                                 zval_dtor(&tmp2);
     202             :                         } else {
     203       13580 :                                 if (!sapi_module.phpinfo_as_text) {
     204         103 :                                         if (Z_STRLEN_PP(tmp) == 0) {
     205           1 :                                                 PUTS("<i>no value</i>");
     206             :                                         } else {
     207         102 :                                                 php_info_html_esc_write(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp) TSRMLS_CC);
     208             :                                         }
     209             :                                 } else {
     210       13477 :                                         PHPWRITE(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
     211             :                                 }       
     212             :                         }
     213       13994 :                         if (!sapi_module.phpinfo_as_text) {
     214         106 :                                 PUTS("</td></tr>\n");
     215             :                         } else {
     216       13888 :                                 PUTS("\n");
     217             :                         }       
     218       13994 :                         zend_hash_move_forward(Z_ARRVAL_PP(data));
     219             :                 }
     220             :         }
     221         966 : }
     222             : /* }}} */
     223             : 
     224             : /* {{{ php_info_print_style
     225             :  */
     226           4 : void php_info_print_style(TSRMLS_D)
     227             : {
     228           4 :         php_printf("<style type=\"text/css\">\n");
     229           4 :         php_info_print_css(TSRMLS_C);
     230           4 :         php_printf("</style>\n");
     231           4 : }
     232             : /* }}} */
     233             : 
     234             : /* {{{ php_info_html_esc_write
     235             :  */
     236         210 : PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC)
     237             : {
     238             :         int new_len;
     239         210 :         char *ret = php_escape_html_entities((unsigned char *)string, str_len, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
     240             : 
     241         210 :         PHPWRITE(ret, new_len);
     242         210 :         efree(ret);
     243         210 : }
     244             : /* }}} */
     245             : 
     246             : /* {{{ php_info_html_esc
     247             :  */
     248        1151 : PHPAPI char *php_info_html_esc(char *string TSRMLS_DC)
     249             : {
     250             :         int new_len;
     251        1151 :         return php_escape_html_entities((unsigned char *)string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
     252             : }
     253             : /* }}} */
     254             : 
     255             : 
     256             : #ifdef PHP_WIN32
     257             : /* {{{  */
     258             : char* php_get_windows_name()
     259             : {
     260             :         OSVERSIONINFOEX osvi;
     261             :         SYSTEM_INFO si;
     262             :         PGNSI pGNSI;
     263             :         PGPI pGPI;
     264             :         BOOL bOsVersionInfoEx;
     265             :         DWORD dwType;
     266             :         char *major = NULL, *sub = NULL, *retval;
     267             : 
     268             :         ZeroMemory(&si, sizeof(SYSTEM_INFO));
     269             :         ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
     270             :         osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
     271             : 
     272             :         if (!(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi))) {
     273             :                 return NULL;
     274             :         }
     275             : 
     276             :         pGNSI = (PGNSI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo");
     277             :         if(NULL != pGNSI) {
     278             :                 pGNSI(&si);
     279             :         } else {
     280             :                 GetSystemInfo(&si);
     281             :         }
     282             : 
     283             :         if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion > 4 ) {
     284             :                 if (osvi.dwMajorVersion == 6) {
     285             :                         if( osvi.dwMinorVersion == 0 ) {
     286             :                                 if( osvi.wProductType == VER_NT_WORKSTATION ) {
     287             :                                         major = "Windows Vista";
     288             :                                 } else {
     289             :                                         major = "Windows Server 2008";
     290             :                                 }
     291             :                         } else
     292             :                         if ( osvi.dwMinorVersion == 1 ) {
     293             :                                 if( osvi.wProductType == VER_NT_WORKSTATION )  {
     294             :                                         major = "Windows 7";
     295             :                                 } else {
     296             :                                         major = "Windows Server 2008 R2";
     297             :                                 }
     298             :                         } else {
     299             :                                 major = "Unknow Windows version";
     300             :                         }
     301             : 
     302             :                         pGPI = (PGPI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProductInfo");
     303             :                         pGPI(6, 0, 0, 0, &dwType);
     304             : 
     305             :                         switch (dwType) {
     306             :                                 case PRODUCT_ULTIMATE:
     307             :                                         sub = "Ultimate Edition";
     308             :                                         break;
     309             :                                 case PRODUCT_HOME_PREMIUM:
     310             :                                         sub = "Home Premium Edition";
     311             :                                         break;
     312             :                                 case PRODUCT_HOME_BASIC:
     313             :                                         sub = "Home Basic Edition";
     314             :                                         break;
     315             :                                 case PRODUCT_ENTERPRISE:
     316             :                                         sub = "Enterprise Edition";
     317             :                                         break;
     318             :                                 case PRODUCT_BUSINESS:
     319             :                                         sub = "Business Edition";
     320             :                                         break;
     321             :                                 case PRODUCT_STARTER:
     322             :                                         sub = "Starter Edition";
     323             :                                         break;
     324             :                                 case PRODUCT_CLUSTER_SERVER:
     325             :                                         sub = "Cluster Server Edition";
     326             :                                         break;
     327             :                                 case PRODUCT_DATACENTER_SERVER:
     328             :                                         sub = "Datacenter Edition";
     329             :                                         break;
     330             :                                 case PRODUCT_DATACENTER_SERVER_CORE:
     331             :                                         sub = "Datacenter Edition (core installation)";
     332             :                                         break;
     333             :                                 case PRODUCT_ENTERPRISE_SERVER:
     334             :                                         sub = "Enterprise Edition";
     335             :                                         break;
     336             :                                 case PRODUCT_ENTERPRISE_SERVER_CORE:
     337             :                                         sub = "Enterprise Edition (core installation)";
     338             :                                         break;
     339             :                                 case PRODUCT_ENTERPRISE_SERVER_IA64:
     340             :                                         sub = "Enterprise Edition for Itanium-based Systems";
     341             :                                         break;
     342             :                                 case PRODUCT_SMALLBUSINESS_SERVER:
     343             :                                         sub = "Small Business Server";
     344             :                                         break;
     345             :                                 case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
     346             :                                         sub = "Small Business Server Premium Edition";
     347             :                                         break;
     348             :                                 case PRODUCT_STANDARD_SERVER:
     349             :                                         sub = "Standard Edition";
     350             :                                         break;
     351             :                                 case PRODUCT_STANDARD_SERVER_CORE:
     352             :                                         sub = "Standard Edition (core installation)";
     353             :                                         break;
     354             :                                 case PRODUCT_WEB_SERVER:
     355             :                                         sub = "Web Server Edition";
     356             :                                         break;
     357             :                         }
     358             :                 }
     359             : 
     360             :                 if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )     {
     361             :                         if (GetSystemMetrics(SM_SERVERR2))
     362             :                                 major = "Windows Server 2003 R2";
     363             :                         else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER)
     364             :                                 major = "Windows Storage Server 2003";
     365             :                         else if (osvi.wSuiteMask == VER_SUITE_WH_SERVER)
     366             :                                 major = "Windows Home Server";
     367             :                         else if (osvi.wProductType == VER_NT_WORKSTATION &&
     368             :                                 si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) {
     369             :                                 major = "Windows XP Professional x64 Edition";
     370             :                         } else {
     371             :                                 major = "Windows Server 2003";
     372             :                         }
     373             : 
     374             :                         /* Test for the server type. */
     375             :                         if ( osvi.wProductType != VER_NT_WORKSTATION ) {
     376             :                                 if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64 ) {
     377             :                                         if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
     378             :                                                 sub = "Datacenter Edition for Itanium-based Systems";
     379             :                                         else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
     380             :                                                 sub = "Enterprise Edition for Itanium-based Systems";
     381             :                                 }
     382             : 
     383             :                                 else if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 ) {
     384             :                                         if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
     385             :                                                 sub = "Datacenter x64 Edition";
     386             :                                         else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
     387             :                                                 sub = "Enterprise x64 Edition";
     388             :                                         else sub = "Standard x64 Edition";
     389             :                                 } else {
     390             :                                         if ( osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER )
     391             :                                                 sub = "Compute Cluster Edition";
     392             :                                         else if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
     393             :                                                 sub = "Datacenter Edition";
     394             :                                         else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
     395             :                                                 sub = "Enterprise Edition";
     396             :                                         else if ( osvi.wSuiteMask & VER_SUITE_BLADE )
     397             :                                                 sub = "Web Edition";
     398             :                                         else sub = "Standard Edition";
     399             :                                 }
     400             :                         } 
     401             :                 }
     402             : 
     403             :                 if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )     {
     404             :                         major = "Windows XP";
     405             :                         if( osvi.wSuiteMask & VER_SUITE_PERSONAL )
     406             :                                 sub = "Home Edition";
     407             :                         else sub = "Professional";
     408             :                 }
     409             : 
     410             :                 if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) {
     411             :                         major = "Windows 2000";
     412             : 
     413             :                         if (osvi.wProductType == VER_NT_WORKSTATION ) {
     414             :                                 sub = "Professional";
     415             :                         } else {
     416             :                                 if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
     417             :                                         sub = "Datacenter Server";
     418             :                                 else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
     419             :                                         sub = "Advanced Server";
     420             :                                 else sub = "Server";
     421             :                         }
     422             :                 }
     423             :         } else {
     424             :                 return NULL;
     425             :         }
     426             : 
     427             :         spprintf(&retval, 0, "%s%s%s%s%s", major, sub?" ":"", sub?sub:"", osvi.szCSDVersion[0] != '\0'?" ":"", osvi.szCSDVersion);
     428             :         return retval;
     429             : }
     430             : /* }}}  */
     431             : 
     432             : /* {{{  */
     433             : void php_get_windows_cpu(char *buf, int bufsize)
     434             : {
     435             :         SYSTEM_INFO SysInfo;
     436             :         GetSystemInfo(&SysInfo);
     437             :         switch (SysInfo.wProcessorArchitecture) {
     438             :                 case PROCESSOR_ARCHITECTURE_INTEL :
     439             :                         snprintf(buf, bufsize, "i%d", SysInfo.dwProcessorType);
     440             :                         break;
     441             :                 case PROCESSOR_ARCHITECTURE_MIPS :
     442             :                         snprintf(buf, bufsize, "MIPS R%d000", SysInfo.wProcessorLevel);
     443             :                         break;
     444             :                 case PROCESSOR_ARCHITECTURE_ALPHA :
     445             :                         snprintf(buf, bufsize, "Alpha %d", SysInfo.wProcessorLevel);
     446             :                         break;
     447             :                 case PROCESSOR_ARCHITECTURE_PPC :
     448             :                         snprintf(buf, bufsize, "PPC 6%02d", SysInfo.wProcessorLevel);
     449             :                         break;
     450             :                 case PROCESSOR_ARCHITECTURE_IA64 :
     451             :                         snprintf(buf, bufsize,  "IA64");
     452             :                         break;
     453             : #if defined(PROCESSOR_ARCHITECTURE_IA32_ON_WIN64)
     454             :                 case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 :
     455             :                         snprintf(buf, bufsize, "IA32");
     456             :                         break;
     457             : #endif
     458             : #if defined(PROCESSOR_ARCHITECTURE_AMD64)
     459             :                 case PROCESSOR_ARCHITECTURE_AMD64 :
     460             :                         snprintf(buf, bufsize, "AMD64");
     461             :                         break;
     462             : #endif
     463             :                 case PROCESSOR_ARCHITECTURE_UNKNOWN :
     464             :                 default:
     465             :                         snprintf(buf, bufsize, "Unknown");
     466             :                         break;
     467             :         }
     468             : }
     469             : /* }}}  */
     470             : #endif
     471             : 
     472             : /* {{{ php_get_uname
     473             :  */
     474        1141 : PHPAPI char *php_get_uname(char mode)
     475             : {
     476             :         char *php_uname;
     477             :         char tmp_uname[256];
     478             : #ifdef PHP_WIN32
     479             :         DWORD dwBuild=0;
     480             :         DWORD dwVersion = GetVersion();
     481             :         DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
     482             :         DWORD dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
     483             :         DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
     484             :         char ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
     485             :         
     486             :         GetComputerName(ComputerName, &dwSize);
     487             : 
     488             :         if (mode == 's') {
     489             :                 if (dwVersion < 0x80000000) {
     490             :                         php_uname = "Windows NT";
     491             :                 } else {
     492             :                         php_uname = "Windows 9x";
     493             :                 }
     494             :         } else if (mode == 'r') {
     495             :                 snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d", dwWindowsMajorVersion, dwWindowsMinorVersion);
     496             :                 php_uname = tmp_uname;
     497             :         } else if (mode == 'n') {
     498             :                 php_uname = ComputerName;
     499             :         } else if (mode == 'v') {
     500             :                 char *winver = php_get_windows_name();
     501             :                 dwBuild = (DWORD)(HIWORD(dwVersion));
     502             :                 if(winver == NULL) {
     503             :                         snprintf(tmp_uname, sizeof(tmp_uname), "build %d", dwBuild);
     504             :                 } else {
     505             :                         snprintf(tmp_uname, sizeof(tmp_uname), "build %d (%s)", dwBuild, winver);
     506             :                 }
     507             :                 php_uname = tmp_uname;
     508             :                 if(winver) {
     509             :                         efree(winver);
     510             :                 }
     511             :         } else if (mode == 'm') {
     512             :                 php_get_windows_cpu(tmp_uname, sizeof(tmp_uname));
     513             :                 php_uname = tmp_uname;
     514             :         } else { /* assume mode == 'a' */
     515             :                 /* Get build numbers for Windows NT or Win95 */
     516             :                 if (dwVersion < 0x80000000){
     517             :                         char *winver = php_get_windows_name();
     518             :                         char wincpu[20];
     519             : 
     520             :                         php_get_windows_cpu(wincpu, sizeof(wincpu));
     521             :                         dwBuild = (DWORD)(HIWORD(dwVersion));
     522             :                         snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s",
     523             :                                          "Windows NT", ComputerName,
     524             :                                          dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown", wincpu);
     525             :                         if(winver) {
     526             :                                 efree(winver);
     527             :                         }
     528             :                 } else {
     529             :                         snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d",
     530             :                                          "Windows 9x", ComputerName,
     531             :                                          dwWindowsMajorVersion, dwWindowsMinorVersion);
     532             :                 }
     533             :                 php_uname = tmp_uname;
     534             :         }
     535             : #else
     536             : #ifdef HAVE_SYS_UTSNAME_H
     537             :         struct utsname buf;
     538        1141 :         if (uname((struct utsname *)&buf) == -1) {
     539           0 :                 php_uname = PHP_UNAME;
     540             :         } else {
     541             : #ifdef NETWARE
     542             :                 if (mode == 's') {
     543             :                         php_uname = buf.sysname;
     544             :                 } else if (mode == 'r') {
     545             :                         snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d", 
     546             :                                          buf.netware_major, buf.netware_minor, buf.netware_revision);
     547             :                         php_uname = tmp_uname;
     548             :                 } else if (mode == 'n') {
     549             :                         php_uname = buf.servername;
     550             :                 } else if (mode == 'v') {
     551             :                         snprintf(tmp_uname, sizeof(tmp_uname), "libc-%d.%d.%d #%d",
     552             :                                          buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold);
     553             :                         php_uname = tmp_uname;
     554             :                 } else if (mode == 'm') {
     555             :                         php_uname = buf.machine;
     556             :                 } else { /* assume mode == 'a' */
     557             :                         snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d.%d libc-%d.%d.%d #%d %s",
     558             :                                          buf.sysname, buf.servername,
     559             :                                          buf.netware_major, buf.netware_minor, buf.netware_revision,
     560             :                                          buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold,
     561             :                                          buf.machine);
     562             :                         php_uname = tmp_uname;
     563             :                 }
     564             : #else
     565        1141 :                 if (mode == 's') {
     566           2 :                         php_uname = buf.sysname;
     567        1139 :                 } else if (mode == 'r') {
     568           1 :                         php_uname = buf.release;
     569        1138 :                 } else if (mode == 'n') {
     570         973 :                         php_uname = buf.nodename;
     571         165 :                 } else if (mode == 'v') {
     572           1 :                         php_uname = buf.version;
     573         164 :                 } else if (mode == 'm') {
     574           2 :                         php_uname = buf.machine;
     575             :                 } else { /* assume mode == 'a' */
     576         162 :                         snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %s %s %s",
     577             :                                          buf.sysname, buf.nodename, buf.release, buf.version,
     578             :                                          buf.machine);
     579         162 :                         php_uname = tmp_uname;
     580             :                 }
     581             : #endif /* NETWARE */
     582             :         }
     583             : #else
     584             :         php_uname = PHP_UNAME;
     585             : #endif
     586             : #endif
     587        1141 :         return estrdup(php_uname);
     588             : }
     589             : /* }}} */
     590             : 
     591             : 
     592             : /* {{{ php_print_info_htmlhead
     593             :  */
     594           4 : PHPAPI void php_print_info_htmlhead(TSRMLS_D)
     595             : {
     596             : 
     597             : /*** none of this is needed now ***
     598             : 
     599             :         const char *charset = NULL;
     600             : 
     601             :         if (SG(default_charset)) {
     602             :                 charset = SG(default_charset);
     603             :         }
     604             : 
     605             : #if HAVE_MBSTRING
     606             :         if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) {
     607             :                 if (MBSTRG(current_http_output_encoding) == mbfl_no_encoding_pass) {
     608             :                         charset = "US-ASCII";
     609             :                 } else {
     610             :                         charset = mbfl_no2preferred_mime_name(MBSTRG(current_http_output_encoding));
     611             :                 }
     612             :         }
     613             : #endif   
     614             : 
     615             : #if HAVE_ICONV
     616             :         if (php_ob_handler_used("ob_iconv_handler" TSRMLS_CC)) {
     617             :                 charset = ICONVG(output_encoding);
     618             :         }
     619             : #endif
     620             : 
     621             :         if (!charset || !charset[0]) {
     622             :                 charset = "US-ASCII";
     623             :         }
     624             : 
     625             : *** none of that is needed now ***/
     626             : 
     627             : 
     628           4 :         PUTS("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
     629           4 :         PUTS("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
     630           4 :         PUTS("<head>\n");
     631           4 :         php_info_print_style(TSRMLS_C);
     632           4 :         PUTS("<title>phpinfo()</title>");
     633           4 :         PUTS("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />");
     634             : /*
     635             :         php_printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />\n", charset);
     636             : */
     637           4 :         PUTS("</head>\n");
     638           4 :         PUTS("<body><div class=\"center\">\n");
     639           4 : }
     640             : /* }}} */
     641             : 
     642             : /* {{{ module_name_cmp */
     643       57732 : static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
     644             : {
     645       57732 :         Bucket *f = *((Bucket **) a);
     646       57732 :         Bucket *s = *((Bucket **) b);
     647             : 
     648       57732 :         return strcasecmp(((zend_module_entry *)f->pData)->name,
     649       57732 :                                   ((zend_module_entry *)s->pData)->name);
     650             : }
     651             : /* }}} */
     652             : 
     653             : /* {{{ php_print_info
     654             :  */
     655         152 : PHPAPI void php_print_info(int flag TSRMLS_DC)
     656             : {
     657             :         char **env, *tmp1, *tmp2;
     658             :         char *php_uname;
     659         152 :         int expose_php = INI_INT("expose_php");
     660             : 
     661         152 :         if (!sapi_module.phpinfo_as_text) {
     662           3 :                 php_print_info_htmlhead(TSRMLS_C);
     663             :         } else {
     664         149 :                 PUTS("phpinfo()\n");
     665             :         }       
     666             : 
     667         152 :         if (flag & PHP_INFO_GENERAL) {
     668         138 :                 char *zend_version = get_zend_version();
     669             :                 char temp_api[10];
     670             :                 char *logo_guid;
     671             : 
     672         138 :                 php_uname = php_get_uname('a');
     673             :                 
     674         138 :                 if (!sapi_module.phpinfo_as_text) {
     675           1 :                         php_info_print_box_start(1);
     676             :                 }
     677             : 
     678         138 :                 if (expose_php && !sapi_module.phpinfo_as_text) {
     679           1 :                         PUTS("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
     680           1 :                         if (SG(request_info).request_uri) {
     681           0 :                                 char *elem_esc = php_info_html_esc(SG(request_info).request_uri TSRMLS_CC);
     682           0 :                                 PUTS(elem_esc);
     683           0 :                                 efree(elem_esc);
     684             :                         }
     685           1 :                         PUTS("?=");
     686           1 :                         logo_guid = php_logo_guid();
     687           1 :                         PUTS(logo_guid);
     688           1 :                         efree(logo_guid);
     689           1 :                         PUTS("\" alt=\"PHP Logo\" /></a>");
     690             :                 }
     691             : 
     692         138 :                 if (!sapi_module.phpinfo_as_text) {
     693           1 :                         php_printf("<h1 class=\"p\">PHP Version %s</h1>\n", PHP_VERSION);
     694             :                 } else {
     695         137 :                         php_info_print_table_row(2, "PHP Version", PHP_VERSION);
     696             :                 }       
     697         138 :                 php_info_print_box_end();
     698         138 :                 php_info_print_table_start();
     699         138 :                 php_info_print_table_row(2, "System", php_uname );
     700         138 :                 php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__ );
     701             : #ifdef COMPILER
     702             :                 php_info_print_table_row(2, "Compiler", COMPILER);
     703             : #endif
     704             : #ifdef ARCHITECTURE
     705             :                 php_info_print_table_row(2, "Architecture", ARCHITECTURE);
     706             : #endif
     707             : #ifdef CONFIGURE_COMMAND
     708         138 :                 php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND );
     709             : #endif
     710             : 
     711         138 :                 if (sapi_module.pretty_name) {
     712         138 :                         php_info_print_table_row(2, "Server API", sapi_module.pretty_name );
     713             :                 }
     714             : 
     715             : #ifdef VIRTUAL_DIR
     716             :                 php_info_print_table_row(2, "Virtual Directory Support", "enabled" );
     717             : #else
     718         138 :                 php_info_print_table_row(2, "Virtual Directory Support", "disabled" );
     719             : #endif
     720             : 
     721         138 :                 php_info_print_table_row(2, "Configuration File (php.ini) Path", PHP_CONFIG_FILE_PATH);
     722         138 :                 php_info_print_table_row(2, "Loaded Configuration File", php_ini_opened_path ? php_ini_opened_path : "(none)");
     723         138 :                 php_info_print_table_row(2, "Scan this dir for additional .ini files", php_ini_scanned_path ? php_ini_scanned_path : "(none)");
     724         138 :                 php_info_print_table_row(2, "Additional .ini files parsed", php_ini_scanned_files ? php_ini_scanned_files : "(none)");
     725             : 
     726         138 :                 snprintf(temp_api, sizeof(temp_api), "%d", PHP_API_VERSION);
     727         138 :                 php_info_print_table_row(2, "PHP API", temp_api);
     728             : 
     729         138 :                 snprintf(temp_api, sizeof(temp_api), "%d", ZEND_MODULE_API_NO);
     730         138 :                 php_info_print_table_row(2, "PHP Extension", temp_api);
     731             : 
     732         138 :                 snprintf(temp_api, sizeof(temp_api), "%d", ZEND_EXTENSION_API_NO);
     733         138 :                 php_info_print_table_row(2, "Zend Extension", temp_api);
     734             : 
     735         138 :                 php_info_print_table_row(2, "Zend Extension Build", ZEND_EXTENSION_BUILD_ID);
     736         138 :                 php_info_print_table_row(2, "PHP Extension Build", ZEND_MODULE_BUILD_ID);
     737             : 
     738             : #if ZEND_DEBUG
     739             :                 php_info_print_table_row(2, "Debug Build", "yes" );
     740             : #else
     741         138 :                 php_info_print_table_row(2, "Debug Build", "no" );
     742             : #endif
     743             : 
     744             : #ifdef ZTS
     745             :                 php_info_print_table_row(2, "Thread Safety", "enabled" );
     746             : #else
     747         138 :                 php_info_print_table_row(2, "Thread Safety", "disabled" );
     748             : #endif
     749             : 
     750         138 :                 php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C) ? "enabled" : "disabled" );
     751             : 
     752             : #ifdef ZEND_MULTIBYTE
     753             :                 php_info_print_table_row(2, "Zend Multibyte Support", "enabled");
     754             : #else
     755         138 :                 php_info_print_table_row(2, "Zend Multibyte Support", "disabled");
     756             : #endif
     757             : 
     758             : #if HAVE_IPV6
     759         138 :                 php_info_print_table_row(2, "IPv6 Support", "enabled" );
     760             : #else
     761             :                 php_info_print_table_row(2, "IPv6 Support", "disabled" );
     762             : #endif
     763             :                 {
     764             :                         HashTable *url_stream_wrappers_hash;
     765         138 :                         char *stream_protocol, *stream_protocols_buf = NULL;
     766         138 :                         int stream_protocol_len, stream_protocols_buf_len = 0;
     767             :                         ulong num_key;
     768             : 
     769         138 :                         if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) {
     770             :                                 HashPosition pos;
     771        2898 :                                 for (zend_hash_internal_pointer_reset_ex(url_stream_wrappers_hash, &pos);
     772        2760 :                                                 zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, (uint *)&stream_protocol_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING;
     773        2622 :                                                 zend_hash_move_forward_ex(url_stream_wrappers_hash, &pos)) {
     774        2622 :                                         stream_protocols_buf = erealloc(stream_protocols_buf, stream_protocols_buf_len + stream_protocol_len + 2 + 1);
     775        2622 :                                         memcpy(stream_protocols_buf + stream_protocols_buf_len, stream_protocol, stream_protocol_len - 1);
     776        2622 :                                         stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len - 1] = ',';
     777        2622 :                                         stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len] = ' ';
     778        2622 :                                         stream_protocols_buf_len += stream_protocol_len + 1;
     779             :                                 }
     780         138 :                                 if (stream_protocols_buf) {
     781         138 :                                         stream_protocols_buf[stream_protocols_buf_len - 2] = ' ';
     782         138 :                                         stream_protocols_buf[stream_protocols_buf_len] = 0;
     783         138 :                                         php_info_print_table_row(2, "Registered PHP Streams", stream_protocols_buf);
     784         138 :                                         efree(stream_protocols_buf);
     785             :                                 } else {
     786             :                                         /* Any chances we will ever hit this? */
     787           0 :                                         php_info_print_table_row(2, "Registered PHP Streams", "no streams registered");
     788             :                                 }
     789             :                         } else {
     790             :                                 /* Any chances we will ever hit this? */
     791           0 :                                 php_info_print_table_row(2, "PHP Streams", "disabled"); /* ?? */
     792             :                         }
     793             :                 }
     794             : 
     795             :                 {
     796             :                         HashTable *stream_xport_hash;
     797         138 :                         char *xport_name, *xport_buf = NULL;
     798         138 :                         int xport_name_len, xport_buf_len = 0, xport_buf_size = 0;
     799             :                         ulong num_key;
     800             : 
     801         138 :                         if ((stream_xport_hash = php_stream_xport_get_hash())) {
     802             :                                 HashPosition pos;
     803        1380 :                                 for(zend_hash_internal_pointer_reset_ex(stream_xport_hash, &pos);
     804        1242 :                                         zend_hash_get_current_key_ex(stream_xport_hash, &xport_name, (uint *)&xport_name_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING;
     805        1104 :                                         zend_hash_move_forward_ex(stream_xport_hash, &pos)) {
     806        1104 :                                         if (xport_buf_len + xport_name_len + 2 > xport_buf_size) {
     807         414 :                                                 while (xport_buf_len + xport_name_len + 2 > xport_buf_size) {
     808         138 :                                                         xport_buf_size += 256;
     809             :                                                 }
     810         138 :                                                 if (xport_buf) {
     811           0 :                                                         xport_buf = erealloc(xport_buf, xport_buf_size);
     812             :                                                 } else {
     813         138 :                                                         xport_buf = emalloc(xport_buf_size);
     814             :                                                 }
     815             :                                         }
     816        1104 :                                         if (xport_buf_len > 0) {
     817         966 :                                                 xport_buf[xport_buf_len++] = ',';
     818         966 :                                                 xport_buf[xport_buf_len++] = ' ';
     819             :                                         }
     820        1104 :                                         memcpy(xport_buf + xport_buf_len, xport_name, xport_name_len - 1);
     821        1104 :                                         xport_buf_len += xport_name_len - 1;
     822        1104 :                                         xport_buf[xport_buf_len] = '\0';
     823             :                                 }
     824         138 :                                 if (xport_buf) {
     825         138 :                                         php_info_print_table_row(2, "Registered Stream Socket Transports", xport_buf);
     826         138 :                                         efree(xport_buf);
     827             :                                 } else {
     828             :                                         /* Any chances we will ever hit this? */
     829           0 :                                         php_info_print_table_row(2, "Registered Stream Socket Transports", "no transports registered");
     830             :                                 }
     831             :                         } else {
     832             :                                 /* Any chances we will ever hit this? */
     833           0 :                                 php_info_print_table_row(2, "Stream Socket Transports", "disabled"); /* ?? */
     834             :                         }
     835             :                 }
     836             : 
     837             :                 {
     838             :                         HashTable *stream_filter_hash;
     839         138 :                         char *filter_name, *filter_buf = NULL;
     840         138 :                         int filter_name_len, filter_buf_len = 0, filter_buf_size = 0;
     841             :                         ulong num_key;
     842             : 
     843         138 :                         if ((stream_filter_hash = php_get_stream_filters_hash())) {
     844             :                                 HashPosition pos;
     845        1932 :                                 for(zend_hash_internal_pointer_reset_ex(stream_filter_hash, &pos);
     846        1794 :                                         zend_hash_get_current_key_ex(stream_filter_hash, &filter_name, (uint *)&filter_name_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING;
     847        1656 :                                         zend_hash_move_forward_ex(stream_filter_hash, &pos)) {
     848        1656 :                                         if (filter_buf_len + filter_name_len + 2 > filter_buf_size) {
     849         414 :                                                 while (filter_buf_len + filter_name_len + 2 > filter_buf_size) {
     850         138 :                                                         filter_buf_size += 256;
     851             :                                                 }
     852         138 :                                                 if (filter_buf) {
     853           0 :                                                         filter_buf = erealloc(filter_buf, filter_buf_size);
     854             :                                                 } else {
     855         138 :                                                         filter_buf = emalloc(filter_buf_size);
     856             :                                                 }
     857             :                                         }
     858        1656 :                                         if (filter_buf_len > 0) {
     859        1518 :                                                 filter_buf[filter_buf_len++] = ',';
     860        1518 :                                                 filter_buf[filter_buf_len++] = ' ';
     861             :                                         }
     862        1656 :                                         memcpy(filter_buf + filter_buf_len, filter_name, filter_name_len - 1);
     863        1656 :                                         filter_buf_len += filter_name_len - 1;
     864        1656 :                                         filter_buf[filter_buf_len] = '\0';
     865             :                                 }
     866         138 :                                 if (filter_buf) {
     867         138 :                                         php_info_print_table_row(2, "Registered Stream Filters", filter_buf);
     868         138 :                                         efree(filter_buf);
     869             :                                 } else {
     870             :                                         /* Any chances we will ever hit this? */
     871           0 :                                         php_info_print_table_row(2, "Registered Stream Filters", "no filters registered");
     872             :                                 }
     873             :                         } else {
     874             :                                 /* Any chances we will ever hit this? */
     875           0 :                                 php_info_print_table_row(2, "Stream Filters", "disabled"); /* ?? */
     876             :                         }
     877             :                 }
     878             :                 
     879         138 :                 php_info_print_table_end();
     880             : 
     881             :                 /* Zend Engine */
     882         138 :                 php_info_print_box_start(0);
     883         138 :                 if (expose_php && !sapi_module.phpinfo_as_text) {
     884           1 :                         PUTS("<a href=\"http://www.zend.com/\"><img border=\"0\" src=\"");
     885           1 :                         if (SG(request_info).request_uri) {
     886           0 :                                 char *elem_esc = php_info_html_esc(SG(request_info).request_uri TSRMLS_CC);
     887           0 :                                 PUTS(elem_esc);
     888           0 :                                 efree(elem_esc);
     889             :                         }
     890           1 :                         PUTS("?="ZEND_LOGO_GUID"\" alt=\"Zend logo\" /></a>\n");
     891             :                 }
     892         138 :                 PUTS("This program makes use of the Zend Scripting Language Engine:");
     893         138 :                 PUTS(!sapi_module.phpinfo_as_text?"<br />":"\n");
     894         138 :                 if (sapi_module.phpinfo_as_text) {
     895         137 :                         PUTS(zend_version);
     896             :                 } else {
     897           1 :                         zend_html_puts(zend_version, strlen(zend_version) TSRMLS_CC);
     898             :                 }
     899         138 :                 php_info_print_box_end();
     900         138 :                 efree(php_uname);
     901             :         }
     902             : 
     903         152 :         if ((flag & PHP_INFO_CREDITS) && expose_php && !sapi_module.phpinfo_as_text) {      
     904           1 :                 php_info_print_hr();
     905           1 :                 PUTS("<h1><a href=\"");
     906           1 :                 if (SG(request_info).request_uri) {
     907           0 :                         char *elem_esc = php_info_html_esc(SG(request_info).request_uri TSRMLS_CC);
     908           0 :                         PUTS(elem_esc);
     909           0 :                         efree(elem_esc);
     910             :                 }
     911           1 :                 PUTS("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000\">");
     912           1 :                 PUTS("PHP Credits");
     913           1 :                 PUTS("</a></h1>\n");
     914             :         }
     915             : 
     916         152 :         zend_ini_sort_entries(TSRMLS_C);
     917             : 
     918         152 :         if (flag & PHP_INFO_CONFIGURATION) {
     919         138 :                 php_info_print_hr();
     920         138 :                 if (!sapi_module.phpinfo_as_text) {
     921           1 :                         PUTS("<h1>Configuration</h1>\n");
     922             :                 } else {
     923         137 :                         SECTION("Configuration");
     924             :                 }       
     925         138 :                 if (!(flag & PHP_INFO_MODULES)) {
     926           0 :                         SECTION("PHP Core");
     927           0 :                         display_ini_entries(NULL);
     928             :                 }
     929             :         }
     930             : 
     931         152 :         if (flag & PHP_INFO_MODULES) {
     932             :                 HashTable sorted_registry;
     933             :                 zend_module_entry tmp;
     934             : 
     935         148 :                 zend_hash_init(&sorted_registry, zend_hash_num_elements(&module_registry), NULL, NULL, 1);
     936         148 :                 zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry));
     937         148 :                 zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC);
     938             : 
     939         148 :                 zend_hash_apply(&sorted_registry, (apply_func_t) _display_module_info_func TSRMLS_CC);
     940             : 
     941         148 :                 SECTION("Additional Modules");
     942         148 :                 php_info_print_table_start();
     943         148 :                 php_info_print_table_header(1, "Module Name");
     944         148 :                 zend_hash_apply(&sorted_registry, (apply_func_t) _display_module_info_def TSRMLS_CC);
     945         148 :                 php_info_print_table_end();
     946             : 
     947         148 :                 zend_hash_destroy(&sorted_registry);
     948             :         }
     949             : 
     950         152 :         if (flag & PHP_INFO_ENVIRONMENT) {
     951         138 :                 SECTION("Environment");
     952         138 :                 php_info_print_table_start();
     953         138 :                 php_info_print_table_header(2, "Variable", "Value");
     954        6770 :                 for (env=environ; env!=NULL && *env !=NULL; env++) {
     955        6632 :                         tmp1 = estrdup(*env);
     956        6632 :                         if (!(tmp2=strchr(tmp1,'='))) { /* malformed entry? */
     957           0 :                                 efree(tmp1);
     958           0 :                                 continue;
     959             :                         }
     960        6632 :                         *tmp2 = 0;
     961        6632 :                         tmp2++;
     962        6632 :                         php_info_print_table_row(2, tmp1, tmp2);
     963        6632 :                         efree(tmp1);
     964             :                 }
     965         138 :                 php_info_print_table_end();
     966             :         }
     967             : 
     968         152 :         if (flag & PHP_INFO_VARIABLES) {
     969             :                 zval **data;
     970             : 
     971         138 :                 SECTION("PHP Variables");
     972             : 
     973         138 :                 php_info_print_table_start();
     974         138 :                 php_info_print_table_header(2, "Variable", "Value");
     975         138 :                 if (zend_hash_find(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void **) &data) != FAILURE) {
     976           0 :                         php_info_print_table_row(2, "PHP_SELF", Z_STRVAL_PP(data));
     977             :                 }
     978         138 :                 if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_TYPE", sizeof("PHP_AUTH_TYPE"), (void **) &data) != FAILURE) {
     979           0 :                         php_info_print_table_row(2, "PHP_AUTH_TYPE", Z_STRVAL_PP(data));
     980             :                 }
     981         138 :                 if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_USER", sizeof("PHP_AUTH_USER"), (void **) &data) != FAILURE) {
     982           0 :                         php_info_print_table_row(2, "PHP_AUTH_USER", Z_STRVAL_PP(data));
     983             :                 }
     984         138 :                 if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) {
     985           0 :                         php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_PP(data));
     986             :                 }
     987         138 :                 php_print_gpcse_array("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
     988         138 :                 php_print_gpcse_array("_GET", sizeof("_GET")-1 TSRMLS_CC);
     989         138 :                 php_print_gpcse_array("_POST", sizeof("_POST")-1 TSRMLS_CC);
     990         138 :                 php_print_gpcse_array("_FILES", sizeof("_FILES")-1 TSRMLS_CC);
     991         138 :                 php_print_gpcse_array("_COOKIE", sizeof("_COOKIE")-1 TSRMLS_CC);
     992         138 :                 php_print_gpcse_array("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
     993         138 :                 php_print_gpcse_array("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
     994         138 :                 php_info_print_table_end();
     995             :         }
     996             : 
     997         152 :         if (flag & PHP_INFO_LICENSE) {
     998         140 :                 if (!sapi_module.phpinfo_as_text) {
     999           2 :                         SECTION("PHP License");
    1000           2 :                         php_info_print_box_start(0);
    1001           2 :                         PUTS("<p>\n");
    1002           2 :                         PUTS("This program is free software; you can redistribute it and/or modify ");
    1003           2 :                         PUTS("it under the terms of the PHP License as published by the PHP Group ");
    1004           2 :                         PUTS("and included in the distribution in the file:  LICENSE\n");
    1005           2 :                         PUTS("</p>\n");
    1006           2 :                         PUTS("<p>");
    1007           2 :                         PUTS("This program is distributed in the hope that it will be useful, ");
    1008           2 :                         PUTS("but WITHOUT ANY WARRANTY; without even the implied warranty of ");
    1009           2 :                         PUTS("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
    1010           2 :                         PUTS("</p>\n");
    1011           2 :                         PUTS("<p>");
    1012           2 :                         PUTS("If you did not receive a copy of the PHP license, or have any questions about ");
    1013           2 :                         PUTS("PHP licensing, please contact license@php.net.\n");
    1014           2 :                         PUTS("</p>\n");
    1015           2 :                         php_info_print_box_end();
    1016             :                 } else {
    1017         138 :                         PUTS("\nPHP License\n");
    1018         138 :                         PUTS("This program is free software; you can redistribute it and/or modify\n");
    1019         138 :                         PUTS("it under the terms of the PHP License as published by the PHP Group\n");
    1020         138 :                         PUTS("and included in the distribution in the file:  LICENSE\n");
    1021         138 :                         PUTS("\n");
    1022         138 :                         PUTS("This program is distributed in the hope that it will be useful,\n");
    1023         138 :                         PUTS("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
    1024         138 :                         PUTS("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
    1025         138 :                         PUTS("\n");
    1026         138 :                         PUTS("If you did not receive a copy of the PHP license, or have any\n");
    1027         138 :                         PUTS("questions about PHP licensing, please contact license@php.net.\n");
    1028             :                 }
    1029             :         }
    1030         152 :         if (!sapi_module.phpinfo_as_text) {
    1031           3 :                 PUTS("</div></body></html>");
    1032             :         }       
    1033         152 : }
    1034             : /* }}} */
    1035             : 
    1036             : 
    1037       27562 : PHPAPI void php_info_print_table_start(void)
    1038             : {
    1039       27562 :         if (!sapi_module.phpinfo_as_text) {
    1040         124 :                 php_printf("<table border=\"0\" cellpadding=\"3\" width=\"600\">\n");
    1041             :         } else {
    1042       27438 :                 php_printf("\n");
    1043             :         }       
    1044       27562 : }
    1045             : 
    1046       27699 : PHPAPI void php_info_print_table_end(void)
    1047             : {
    1048       27699 :         if (!sapi_module.phpinfo_as_text) {
    1049         124 :                 php_printf("</table><br />\n");
    1050             :         }
    1051             : 
    1052       27699 : }
    1053             : 
    1054         289 : PHPAPI void php_info_print_box_start(int flag)
    1055             : {
    1056         289 :         php_info_print_table_start();
    1057         289 :         if (flag) {
    1058           1 :                 if (!sapi_module.phpinfo_as_text) {
    1059           1 :                         php_printf("<tr class=\"h\"><td>\n");
    1060             :                 }
    1061             :         } else {
    1062         288 :                 if (!sapi_module.phpinfo_as_text) {
    1063           4 :                         php_printf("<tr class=\"v\"><td>\n");
    1064             :                 } else {
    1065         284 :                         php_printf("\n");
    1066             :                 }       
    1067             :         }
    1068         289 : }
    1069             : 
    1070         426 : PHPAPI void php_info_print_box_end(void)
    1071             : {
    1072         426 :         if (!sapi_module.phpinfo_as_text) {
    1073           5 :                 php_printf("</td></tr>\n");
    1074             :         }
    1075         426 :         php_info_print_table_end();
    1076         426 : }
    1077             : 
    1078         139 : PHPAPI void php_info_print_hr(void)
    1079             : {
    1080         139 :         if (!sapi_module.phpinfo_as_text) {
    1081           2 :                 php_printf("<hr />\n");
    1082             :         } else {
    1083         137 :                 php_printf("\n\n _______________________________________________________________________\n\n");
    1084             :         }
    1085         139 : }
    1086             : 
    1087          10 : PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header)
    1088             : {
    1089             :         int spaces;
    1090             : 
    1091          10 :         if (!sapi_module.phpinfo_as_text) {
    1092           5 :                 php_printf("<tr class=\"h\"><th colspan=\"%d\">%s</th></tr>\n", num_cols, header );
    1093             :         } else {
    1094           5 :                 spaces = (74 - strlen(header));
    1095           5 :                 php_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " ");
    1096             :         }       
    1097          10 : }
    1098             : 
    1099             : /* {{{ php_info_print_table_header
    1100             :  */
    1101       20173 : PHPAPI void php_info_print_table_header(int num_cols, ...)
    1102             : {
    1103             :         int i;
    1104             :         va_list row_elements;
    1105             :         char *row_element;
    1106             : 
    1107             :         TSRMLS_FETCH();
    1108             : 
    1109       20173 :         va_start(row_elements, num_cols);
    1110       20173 :         if (!sapi_module.phpinfo_as_text) {
    1111          69 :                 php_printf("<tr class=\"h\">");
    1112             :         }       
    1113       53364 :         for (i=0; i<num_cols; i++) {
    1114       33191 :                 row_element = va_arg(row_elements, char *);
    1115       33191 :                 if (!row_element || !*row_element) {
    1116         148 :                         row_element = " ";
    1117             :                 }
    1118       33191 :                 if (!sapi_module.phpinfo_as_text) {
    1119         162 :                         PUTS("<th>");
    1120         162 :                         PUTS(row_element);
    1121         162 :                         PUTS("</th>");
    1122             :                 } else {
    1123       33029 :                         PUTS(row_element);
    1124       33029 :                         if (i < num_cols-1) {
    1125       12925 :                                 PUTS(" => ");
    1126             :                         } else {
    1127       20104 :                                 PUTS("\n");
    1128             :                         }       
    1129             :                 }       
    1130             :         }
    1131       20173 :         if (!sapi_module.phpinfo_as_text) {
    1132          69 :                 php_printf("</tr>\n");
    1133             :         }       
    1134             : 
    1135       20173 :         va_end(row_elements);
    1136       20173 : }
    1137             : /* }}} */
    1138             : 
    1139             : /* {{{ php_info_print_table_row_internal
    1140             :  */
    1141       68057 : static void php_info_print_table_row_internal(int num_cols, 
    1142             :                 const char *value_class, va_list row_elements)
    1143             : {
    1144             :         int i;
    1145             :         char *row_element;
    1146       68057 :         char *elem_esc = NULL;
    1147             : /*
    1148             :         int elem_esc_len;
    1149             : */
    1150             : 
    1151             :         TSRMLS_FETCH();
    1152             : 
    1153       68057 :         if (!sapi_module.phpinfo_as_text) {
    1154         578 :                 php_printf("<tr>");
    1155             :         }       
    1156      204163 :         for (i=0; i<num_cols; i++) {
    1157      136106 :                 if (!sapi_module.phpinfo_as_text) {
    1158        1152 :                         php_printf("<td class=\"%s\">",
    1159             :                            (i==0 ? "e" : value_class )
    1160             :                         );
    1161             :                 }       
    1162      136106 :                 row_element = va_arg(row_elements, char *);
    1163      136254 :                 if (!row_element || !*row_element) {
    1164         148 :                         if (!sapi_module.phpinfo_as_text) {
    1165           1 :                                 PUTS( "<i>no value</i>" );
    1166             :                         } else {
    1167         147 :                                 PUTS( " " );
    1168             :                         }
    1169             :                 } else {
    1170      135958 :                         if (!sapi_module.phpinfo_as_text) {
    1171        1151 :                                 elem_esc = php_info_html_esc(row_element TSRMLS_CC);
    1172        1151 :                                 PUTS(elem_esc);
    1173        1151 :                                 efree(elem_esc);
    1174             :                         } else {
    1175      134807 :                                 PUTS(row_element);
    1176      134807 :                                 if (i < num_cols-1) {
    1177       67475 :                                         PUTS(" => ");
    1178             :                                 }       
    1179             :                         }
    1180             :                 }
    1181      136106 :                 if (!sapi_module.phpinfo_as_text) {
    1182        1152 :                         php_printf(" </td>");
    1183      134954 :                 } else if (i == (num_cols - 1)) {
    1184       67479 :                         PUTS("\n");
    1185             :                 }
    1186             :         }
    1187       68057 :         if (!sapi_module.phpinfo_as_text) {
    1188         578 :                 php_printf("</tr>\n");
    1189             :         }
    1190       68057 : }
    1191             : /* }}} */
    1192             : 
    1193             : /* {{{ php_info_print_table_row
    1194             :  */
    1195       68057 : PHPAPI void php_info_print_table_row(int num_cols, ...)
    1196             : {
    1197             :         va_list row_elements;
    1198             :         
    1199       68057 :         va_start(row_elements, num_cols);
    1200       68057 :         php_info_print_table_row_internal(num_cols, "v", row_elements);
    1201       68057 :         va_end(row_elements);
    1202       68057 : }
    1203             : /* }}} */
    1204             : 
    1205             : /* {{{ php_info_print_table_row_ex
    1206             :  */
    1207           0 : PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class, 
    1208             :                 ...)
    1209             : {
    1210             :         va_list row_elements;
    1211             :         
    1212           0 :         va_start(row_elements, value_class);
    1213           0 :         php_info_print_table_row_internal(num_cols, value_class, row_elements);
    1214           0 :         va_end(row_elements);
    1215           0 : }
    1216             : /* }}} */
    1217             : 
    1218             : /* {{{ register_phpinfo_constants
    1219             :  */
    1220       19341 : void register_phpinfo_constants(INIT_FUNC_ARGS)
    1221             : {
    1222       19341 :         REGISTER_LONG_CONSTANT("INFO_GENERAL", PHP_INFO_GENERAL, CONST_PERSISTENT|CONST_CS);
    1223       19341 :         REGISTER_LONG_CONSTANT("INFO_CREDITS", PHP_INFO_CREDITS, CONST_PERSISTENT|CONST_CS);
    1224       19341 :         REGISTER_LONG_CONSTANT("INFO_CONFIGURATION", PHP_INFO_CONFIGURATION, CONST_PERSISTENT|CONST_CS);
    1225       19341 :         REGISTER_LONG_CONSTANT("INFO_MODULES", PHP_INFO_MODULES, CONST_PERSISTENT|CONST_CS);
    1226       19341 :         REGISTER_LONG_CONSTANT("INFO_ENVIRONMENT", PHP_INFO_ENVIRONMENT, CONST_PERSISTENT|CONST_CS);
    1227       19341 :         REGISTER_LONG_CONSTANT("INFO_VARIABLES", PHP_INFO_VARIABLES, CONST_PERSISTENT|CONST_CS);
    1228       19341 :         REGISTER_LONG_CONSTANT("INFO_LICENSE", PHP_INFO_LICENSE, CONST_PERSISTENT|CONST_CS);
    1229       19341 :         REGISTER_LONG_CONSTANT("INFO_ALL", PHP_INFO_ALL, CONST_PERSISTENT|CONST_CS);
    1230       19341 :         REGISTER_LONG_CONSTANT("CREDITS_GROUP",       PHP_CREDITS_GROUP, CONST_PERSISTENT|CONST_CS);
    1231       19341 :         REGISTER_LONG_CONSTANT("CREDITS_GENERAL",     PHP_CREDITS_GENERAL, CONST_PERSISTENT|CONST_CS);
    1232       19341 :         REGISTER_LONG_CONSTANT("CREDITS_SAPI",        PHP_CREDITS_SAPI, CONST_PERSISTENT|CONST_CS);
    1233       19341 :         REGISTER_LONG_CONSTANT("CREDITS_MODULES",     PHP_CREDITS_MODULES, CONST_PERSISTENT|CONST_CS);
    1234       19341 :         REGISTER_LONG_CONSTANT("CREDITS_DOCS",        PHP_CREDITS_DOCS, CONST_PERSISTENT|CONST_CS);
    1235       19341 :         REGISTER_LONG_CONSTANT("CREDITS_FULLPAGE",    PHP_CREDITS_FULLPAGE, CONST_PERSISTENT|CONST_CS);
    1236       19341 :         REGISTER_LONG_CONSTANT("CREDITS_QA",  PHP_CREDITS_QA, CONST_PERSISTENT|CONST_CS);
    1237       19341 :         REGISTER_LONG_CONSTANT("CREDITS_ALL", PHP_CREDITS_ALL, CONST_PERSISTENT|CONST_CS);
    1238       19341 : }
    1239             : /* }}} */
    1240             : 
    1241             : /* {{{ proto void phpinfo([int what])
    1242             :    Output a page of useful information about PHP and the current request */
    1243         153 : PHP_FUNCTION(phpinfo)
    1244             : {
    1245         153 :         long flag = PHP_INFO_ALL;
    1246             : 
    1247         153 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
    1248           2 :                 return;
    1249             :         }
    1250             : 
    1251             :         /* Andale!  Andale!  Yee-Hah! */
    1252         151 :         php_start_ob_buffer(NULL, 4096, 0 TSRMLS_CC);
    1253         151 :         php_print_info(flag TSRMLS_CC);
    1254         151 :         php_end_ob_buffer(1, 0 TSRMLS_CC);
    1255             : 
    1256         151 :         RETURN_TRUE;
    1257             : }
    1258             : 
    1259             : /* }}} */
    1260             : 
    1261             : /* {{{ proto string phpversion([string extension])
    1262             :    Return the current PHP version */
    1263           9 : PHP_FUNCTION(phpversion)
    1264             : {
    1265             :         zval **arg;
    1266             :         const char *version;
    1267           9 :         int argc = ZEND_NUM_ARGS();
    1268             : 
    1269           9 :         if (argc == 0) {
    1270           9 :                 RETURN_STRING(PHP_VERSION, 1);
    1271             :         } else {
    1272           0 :                 if (zend_parse_parameters(argc TSRMLS_CC, "Z", &arg) == FAILURE) {
    1273           0 :                         return;
    1274             :                 }
    1275             :                         
    1276           0 :                 convert_to_string_ex(arg);
    1277           0 :                 version = zend_get_module_version(Z_STRVAL_PP(arg));
    1278             :                 
    1279           0 :                 if (version == NULL) {
    1280           0 :                         RETURN_FALSE;
    1281             :                 }
    1282           0 :                 RETURN_STRING(version, 1);
    1283             :         }
    1284             : }
    1285             : /* }}} */
    1286             : 
    1287             : /* {{{ proto void phpcredits([int flag])
    1288             :    Prints the list of people who've contributed to the PHP project */
    1289           8 : PHP_FUNCTION(phpcredits)
    1290             : {
    1291           8 :         long flag = PHP_CREDITS_ALL;
    1292             : 
    1293           8 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
    1294           2 :                 return;
    1295             :         }
    1296             : 
    1297           6 :         php_print_credits(flag TSRMLS_CC);
    1298           6 :         RETURN_TRUE;
    1299             : }
    1300             : /* }}} */
    1301             : 
    1302             : 
    1303             : /* {{{ php_logo_guid
    1304             :  */
    1305           3 : PHPAPI char *php_logo_guid(void)
    1306             : {
    1307             :         char *logo_guid;
    1308             : 
    1309             :         time_t the_time;
    1310             :         struct tm *ta, tmbuf;
    1311             : 
    1312           3 :         the_time = time(NULL);
    1313           3 :         ta = php_localtime_r(&the_time, &tmbuf);
    1314             : 
    1315           3 :         if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
    1316           0 :                 logo_guid = PHP_EGG_LOGO_GUID;
    1317             :         } else {
    1318           3 :                 logo_guid = PHP_LOGO_GUID;
    1319             :         }
    1320             : 
    1321           3 :         return estrdup(logo_guid);
    1322             : 
    1323             : }
    1324             : /* }}} */
    1325             : 
    1326             : /* {{{ proto string php_logo_guid(void)
    1327             :    Return the special ID used to request the PHP logo in phpinfo screens*/
    1328           2 : PHP_FUNCTION(php_logo_guid)
    1329             : {
    1330             : 
    1331           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1332           0 :                 return;
    1333             :         }
    1334             : 
    1335           2 :         RETURN_STRING(php_logo_guid(), 0);
    1336             : }
    1337             : /* }}} */
    1338             : 
    1339             : /* {{{ proto string php_real_logo_guid(void)
    1340             :    Return the special ID used to request the PHP logo in phpinfo screens*/
    1341           2 : PHP_FUNCTION(php_real_logo_guid)
    1342             : {
    1343             : 
    1344           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1345           0 :                 return;
    1346             :         }
    1347             : 
    1348           2 :         RETURN_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1);
    1349             : }
    1350             : /* }}} */
    1351             : 
    1352             : /* {{{ proto string php_egg_logo_guid(void)
    1353             :    Return the special ID used to request the PHP logo in phpinfo screens*/
    1354           1 : PHP_FUNCTION(php_egg_logo_guid)
    1355             : {
    1356           1 :         if (zend_parse_parameters_none() == FAILURE) {
    1357           0 :                 return;
    1358             :         }
    1359             : 
    1360           1 :         RETURN_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1);
    1361             : }
    1362             : /* }}} */
    1363             : 
    1364             : /* {{{ proto string zend_logo_guid(void)
    1365             :    Return the special ID used to request the Zend logo in phpinfo screens*/
    1366           2 : PHP_FUNCTION(zend_logo_guid)
    1367             : {
    1368           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1369           0 :                 return;
    1370             :         }
    1371             : 
    1372           2 :         RETURN_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1);
    1373             : }
    1374             : /* }}} */
    1375             : 
    1376             : /* {{{ proto string php_sapi_name(void)
    1377             :    Return the current SAPI module name */
    1378          45 : PHP_FUNCTION(php_sapi_name)
    1379             : {
    1380          45 :         if (zend_parse_parameters_none() == FAILURE) {
    1381           0 :                 return;
    1382             :         }
    1383             : 
    1384          45 :         if (sapi_module.name) {
    1385          45 :                 RETURN_STRING(sapi_module.name, 1);
    1386             :         } else {
    1387           0 :                 RETURN_FALSE;
    1388             :         }
    1389             : }
    1390             : 
    1391             : /* }}} */
    1392             : 
    1393             : /* {{{ proto string php_uname(void)
    1394             :    Return information about the system PHP was built on */
    1395        1008 : PHP_FUNCTION(php_uname)
    1396             : {
    1397        1008 :         char *mode = "a";
    1398        1008 :         int modelen = sizeof("a")-1;
    1399        1008 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) {
    1400           5 :                 return;
    1401             :         }
    1402        1003 :         RETURN_STRING(php_get_uname(*mode), 0);
    1403             : }
    1404             : 
    1405             : /* }}} */
    1406             : 
    1407             : /* {{{ proto string php_ini_scanned_files(void)
    1408             :    Return comma-separated string of .ini files parsed from the additional ini dir */
    1409           2 : PHP_FUNCTION(php_ini_scanned_files)
    1410             : {
    1411           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1412           0 :                 return;
    1413             :         }
    1414             :         
    1415           2 :         if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) {
    1416             :                 RETURN_STRING(php_ini_scanned_files, 1);
    1417             :         } else {
    1418           2 :                 RETURN_FALSE;
    1419             :         }
    1420             : }
    1421             : /* }}} */
    1422             : 
    1423             : /* {{{ proto string php_ini_loaded_file(void)
    1424             :    Return the actual loaded ini filename */
    1425           2 : PHP_FUNCTION(php_ini_loaded_file)
    1426             : {
    1427           2 :         if (zend_parse_parameters_none() == FAILURE) {
    1428           0 :                 return;
    1429             :         }
    1430             :         
    1431           2 :         if (php_ini_opened_path) {
    1432           1 :                 RETURN_STRING(php_ini_opened_path, 1);
    1433             :         } else {
    1434           1 :                 RETURN_FALSE;
    1435             :         }
    1436             : }
    1437             : /* }}} */
    1438             : 
    1439             : /*
    1440             :  * Local variables:
    1441             :  * tab-width: 4
    1442             :  * c-basic-offset: 4
    1443             :  * End:
    1444             :  * vim600: sw=4 ts=4 fdm=marker
    1445             :  * vim<600: sw=4 ts=4
    1446             :  */

Generated by: LCOV version 1.10

Generated at Wed, 23 Jul 2014 19:58:40 +0000 (6 hours ago)

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