Exemplo n.º 1
0
 print '<tr valign="top">';
 print '<td align="center" width="100%">';
 print '	<table width="100%" cellspacing="0" cellpadding="4" border="0" class="std">';
 print '	<tr valign="top">';
 print '		<th width="100%">System Environment</th>';
 print '	</tr>';
 print '	<tr valign="top">';
 print '	<td width="100%">';
 print '		<p><b>web2Project ' . $AppUI->getVersion() . '</b></p>';
 print '		<p>PHP version nr: ' . PHP_VERSION . '</p>';
 print '		<p>DB provider and version nr: ' . $db->dataProvider . ' ' . $db_info['version'] . ' (' . $db_info['description'] . ')</p>';
 print '		<p>DB Table Prefix: "' . w2PgetConfig('dbprefix') . '"</p>';
 print '		<p>Web Server: ' . safe_get_env('SERVER_SOFTWARE') . '</p>';
 print '		<p>Server Protocol | Gateway Interface: ' . safe_get_env('SERVER_PROTOCOL') . ' | ' . safe_get_env('GATEWAY_INTERFACE') . '</p>';
 print '		<p>Client Browser: ' . safe_get_env('HTTP_USER_AGENT') . '</p>';
 print '		<p>URL Query: ' . safe_get_env('QUERY_STRING') . '</p>';
 if (file_exists($module_file)) {
     $script_handle = fopen($module_file, "r");
     if ($script_handle) {
         $script_first_line = fgets($script_handle, 4096);
         fclose($script_handle);
     }
     $script_first_line = substr(trim($script_first_line), 10, -4);
     print '		<p>File Version ' . $script_first_line . '</p>';
 }
 $right_now_is = new w2p_Utilities_Date();
 print '		<p>Server Time | Timezone: ' . $right_now_is->format(FMT_DATERFC822) . ' | ' . date('T') . '</p>';
 print '		<p>PHP Max. Execution Time: ' . ini_get('max_execution_time') . ' seconds</p>';
 print '		<p>Memory Limit: ' . (ini_get('memory_limit') ? str_replace('M', ' Mb', ini_get('memory_limit')) : 'Not Defined') . '</p>';
 print '	</td>';
 print '	</tr>';
Exemplo n.º 2
0
 * only rely on env variables if not using a apache handler
 */
function safe_get_env($name)
{
    if (isset($_SERVER[$name])) {
        return $_SERVER[$name];
    } elseif (strpos(php_sapi_name(), 'apache') === false) {
        getenv($name);
    } else {
        return '';
    }
}
// automatically define the base url
$baseUrl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://';
$baseUrl .= safe_get_env('HTTP_HOST');
$baseUrl .= dirname(safe_get_env('SCRIPT_NAME'));
$baseUrl = preg_replace('#/$#D', '', $baseUrl);
// Note: This resolves http://bugs.web2project.net/view.php?id=1081 on IIS, but I'm not sure I like it..
$baseUrl = stripslashes($baseUrl);
// Note: If your url resolution isn't working as expected, uncomment the next line and manually set the correct value.
//$baseUrl = 'http://add-your-correct-url-here.wontwork';
// Defines to deprecate the global baseUrl/baseDir
define('W2P_BASE_DIR', $baseDir);
define('W2P_BASE_URL', $baseUrl);
// Set the ADODB directory
if (!defined('ADODB_DIR')) {
    define('ADODB_DIR', W2P_BASE_DIR . '/lib/adodb');
}
/*
 *  This  is set to get past the dotProject security sentinel.  It is only
 * required during the conversion process to load config.php.  Hopefully we
Exemplo n.º 3
0
        return $_SERVER[$name];
    } else {
        if (mb_strpos(php_sapi_name(), 'apache') === false) {
            getenv($name);
        } else {
            return '';
        }
    }
}
// automatically define the base url
$baseUrl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ? 'https://' : 'http://';
$baseUrl .= safe_get_env('HTTP_HOST');
$pathInfo = safe_get_env('PATH_INFO');
if (@$pathInfo) {
    $baseUrl .= str_replace('\\', '/', dirname($pathInfo));
} else {
    $baseUrl .= str_replace('\\', '/', dirname(safe_get_env('SCRIPT_NAME')));
}
$baseUrl = preg_replace('#/$#D', '', $baseUrl);
// Define to deprecate the global baseUrl
define('DP_BASE_URL', $baseUrl);
// And now we need to ensure we have a valid path for included pear libraries.
// This dependency sucks, but if we don't do it we have no idea what versions we have
$dpLib = DP_BASE_DIR . DIRECTORY_SEPARATOR . 'lib';
$pear = $dpLib . DIRECTORY_SEPARATOR . 'PEAR';
// If you want a really secure path, comment the second one out and uncomment this
// set_include_path('.'.PATH_SEPARATOR.$dpLib.PATH_SEPARATOR.$pear);
set_include_path('.' . PATH_SEPARATOR . $dpLib . PATH_SEPARATOR . $pear . PATH_SEPARATOR . get_include_path());
// required includes for start-up
global $dPconfig;
$dPconfig = array();