Пример #1
0
    $Index->form = false;
    switch ($Index->route_path[2]) {
        case 'phpinfo':
            $Index->Content = ob_wrapper(function () {
                phpinfo();
            });
            break;
        case 'readme.html':
            $Index->Content = file_get_contents(DIR . '/readme.html');
    }
    $Index->stop;
    return;
}
$hhvm_version = defined('HHVM_VERSION') ? HHVM_VERSION : false;
$Index->form = false;
$Index->content(h::{'table.cs-table-borderless.cs-left-even.cs-right-odd tr| td'}([h::{'a.cs-button[target=_blank]'}('phpinfo()', ['href' => "{$Index->action}/phpinfo"]) . h::{'a.cs-button[target=_blank]'}($L->information_about_system, ['href' => "{$Index->action}/readme.html"]) . h::{'div#cs-system-license.uk-modal pre.uk-modal-dialog-large'}(file_get_contents(DIR . '/license.txt'), ['title' => "{$L->system} » {$L->license}"]) . h::{'button#cs-system-license-open'}($L->license, ['data-title' => $L->click_to_view_details]), ['colspan' => 2]], ["{$L->operation_system}:", php_uname('s') . ' ' . php_uname('r') . ' ' . php_uname('v')], ["{$L->server_type}:", server_api()], preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE']) ? [$L->version_of('Apache') . ':', apache_version()] : false, preg_match('/nginx/i', $_SERVER['SERVER_SOFTWARE']) ? [$L->version_of('Nginx') . ':', explode('/', $_SERVER['SERVER_SOFTWARE'])[1]] : false, $hhvm_version ? [$L->version_of('HHVM') . ':', $hhvm_version] : false, $hhvm_version ? false : ["{$L->available_ram}:", str_replace(['K', 'M', 'G'], [" {$L->KB}", " {$L->MB}", " {$L->GB}"], ini_get('memory_limit'))], [$L->version_of('PHP') . ':', PHP_VERSION], ["{$L->php_components}:", h::{'table.cs-left-odd.cs-table-borderless tr| td'}(["{$L->mcrypt}:", [check_mcrypt() ? $L->on : $L->off . h::icon('info-sign', ['data-title' => $L->mcrypt_warning]), ['class' => state(check_mcrypt())]]], ["{$L->zlib}:", $L->get(zlib())], zlib() ? ["{$L->zlib_compression}:", $L->get(zlib_compression())] : false, zlib_compression() ? ["{$L->zlib_compression_level}:", zlib_compression_level()] : false, ["{$L->curl_lib}:", [$L->get(curl()), ['class' => state(curl())]]], ["{$L->apc_module}:", [$L->get(apc()), ['class' => version_compare(PHP_VERSION, '5.5', '>=') ? false : state(apc())]]], ["{$L->memcached_module}:", [$L->get(memcached())]])], ["{$L->main_db}:", $Core->db_type], ["{$L->properties} {$Core->db_type}:", h::{'table.cs-left-odd.cs-table-borderless tr| td'}(["{$L->host}:", $Core->db_host], [$L->version_of($Core->db_type) . ':', [DB::instance()->server()]], ["{$L->name_of_db}:", $Core->db_name], ["{$L->prefix_for_db_tables}:", $Core->db_prefix])], ["{$L->main_storage}:", $Core->storage_type], ["{$L->cache_engine}:", $Core->cache_engine], ["{$L->free_disk_space}:", format_filesize(disk_free_space('./'), 2)], ["{$L->php_ini_settings}:", h::{'table.cs-left-odd.cs-table-borderless tr| td'}(["{$L->allow_file_upload}:", [$L->get(ini_get('file_uploads')), ['class' => state(ini_get('file_uploads'))]]], $hhvm_version ? false : ["{$L->max_file_uploads}:", ini_get('max_file_uploads')], ["{$L->upload_limit}:", format_filesize(str_replace(['K', 'M', 'G'], [" {$L->KB}", " {$L->MB}", " {$L->GB}"], ini_get('upload_max_filesize')))], ["{$L->post_max_size}:", format_filesize(str_replace(['K', 'M', 'G'], [" {$L->KB}", " {$L->MB}", " {$L->GB}"], ini_get('post_max_size')))], $hhvm_version ? false : ["{$L->max_execution_time}:", format_time(ini_get('max_execution_time'))], $hhvm_version ? false : ["{$L->max_input_time}:", format_time(ini_get('max_input_time'))], $hhvm_version ? false : ["{$L->default_socket_timeout}:", format_time(ini_get('default_socket_timeout'))], ["{$L->allow_url_fopen}:", [$L->get(ini_get('allow_url_fopen')), ['class' => state(ini_get('allow_url_fopen'))]]], ["{$L->display_errors}:", [$L->get(display_errors()), ['class' => state(!display_errors())]]])]));
function state($state)
{
    return $state ? 'uk-alert-success' : 'uk-alert-danger';
}
/**
 * Returns server type
 *
 * @return string
 */
function server_api()
{
    $phpinfo = ob_wrapper(function () {
        phpinfo();
    });
    if (preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE'])) {
Пример #2
0
/**
 * Check autocompression state of zlib library
 *
 * @return bool
 */
function zlib_compression()
{
    return zlib() && strtolower(ini_get('zlib.output_compression')) != 'off';
}