function phpconfig_page()
{
    info_disabled_check();
    $sys = get_sysinfo();
    $download = get_request_parameter('download');
    $ini_file_name = '';
    if (!empty($download)) {
        $ini_file_name = get_request_parameter('ininame');
        if (empty($ini_file_name)) {
            $ini_file_name = ini_file_name();
        }
        header('Content-Type: text/plain');
        header('Content-Disposition: attachment; filename=' . $ini_file_name);
    } else {
        header('Content-Type: text/plain');
    }
    $exclude_original = get_request_parameter('newlinesonly');
    $prepend = get_request_parameter('prepend');
    $stype = get_request_parameter('stype');
    $server_type = find_server_type($stype);
    if (!empty($exclude_original) || !empty($prepend)) {
        $loader_dir = loader_install_dir($server_type);
        $zend_lines = zend_extension_lines($loader_dir);
        echo join(PHP_EOL, $zend_lines);
        echo PHP_EOL;
    }
    if (empty($ini_file_name) || empty($sys['PHP_INI_DIR']) || $sys['PHP_INI_BASENAME'] == $ini_file_name) {
        $original_ini_file = isset($sys['PHP_INI']) ? $sys['PHP_INI'] : '';
    } else {
        $original_ini_file = $sys['PHP_INI_DIR'] . DIRECTORY_SEPARATOR . $ini_file_name;
    }
    if (empty($exclude_original) && !empty($original_ini_file) && @file_exists($original_ini_file)) {
        if (!empty($download)) {
            @readfile($original_ini_file);
        } else {
            echo all_ini_contents();
        }
    }
}
Example #2
0
function phpini_page()
{
    if (empty($loader_dir)) {
        $loader_dir = get_default_loader_dir();
    }
    $loader_name = get_loader_name();
    $loader_loc = $loader_dir . "/" . $loader_name;
    $loader_loc = get_loader_location(get_request_parameter('ldpath'));
    header('Content-Type: text/plain');
    header('Content-Disposition: attachment; filename=' . ini_file_name());
    echo php_ini_contents($loader_loc);
}
Example #3
0
function phpconfig_page()
{
    $sys = get_sysinfo();
    if (isset($sys['PHP_INI']) && file_exists($sys['PHP_INI'])) {
        $download = get_request_parameter('download');
        if (!empty($download)) {
            $ini_file_name = ini_file_name();
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename=' . $ini_file_name);
        } else {
            header('Content-Type: text/plain');
        }
        $prepend = get_request_parameter('prepend');
        if (!empty($prepend)) {
            $server_type = find_server_type();
            $loader_dir = loader_install_dir($server_type);
            $zend_lines = zend_extension_lines($loader_dir);
            echo join(PHP_EOL,$zend_lines);
            echo PHP_EOL;
        }
        @readfile($sys['PHP_INI']);
    } else {
        echo "php.ini file could not be read.";
    }
}