Esempio n. 1
0
 /**
  * Detection of encryption support
  */
 protected function construct()
 {
     if ($this->encrypt_support = check_mcrypt()) {
         $Core = Core::instance();
         $this->key = $Core->key;
         $this->iv = $Core->iv;
     }
 }
Esempio n. 2
0
        return true;
    }
    return false;
}
function getServerVar($name)
{
    return isset($_SERVER[$name]) ? $_SERVER[$name] : null;
}
function find_in_path($needle, array $extrapath = array())
{
    $paths = explode(PATH_SEPARATOR, getServerVar('PATH'));
    $paths = array_merge($paths, $extrapath);
    $exts = explode(PATH_SEPARATOR, getServerVar('PATHEXT'));
    foreach ($paths as $path) {
        $file = $path . DIRECTORY_SEPARATOR . $needle;
        if (file_exists($file)) {
            return $file;
        }
        // W32 needs this
        foreach ($exts as $ext) {
            if (file_exists($file . $ext)) {
                return $file . $ext;
            }
        }
    }
}
$found_bins = array();
// will be filled by the check functions
$required_checks = array("check_php_version" => check_php_version(), "check_database_support" => check_database_support(), "check_webserver" => check_webserver(), "check_accept_path_info" => check_accept_path_info(), "check_zend_compat" => check_zend_compat(), "check_ariadne_inc_read" => check_ariadne_inc_read(), "check_ariadne_path" => check_ariadne_path(), "check_files_write" => check_files_write(), "check_base_ax" => check_base_ax(), "check_tar_class" => check_tar_class(), "check_mb_functions" => check_mb_functions());
$recommended_checks = array("check_ariadne_phtml_write" => check_ariadne_phtml_write(), "check_exif" => check_exif(), "check_image_magick" => check_image_magick(), "check_svn" => check_svn(), "check_svn_write" => check_svn_write(), "check_html_tidy" => check_html_tidy(), "check_grep" => check_grep(), "check_demo_ax" => check_demo_ax(), "check_mcrypt" => check_mcrypt());
Esempio n. 3
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'])) {