Habari\AdminHandler::get_sysinfo PHP Method

get_sysinfo() public method

Handles get requests for the system information page.
public get_sysinfo ( )
    public function get_sysinfo()
    {
        $sysinfo = array();
        $siteinfo = array();
        // Assemble Site Info
        $siteinfo[_t('Habari Version')] = Version::get_habariversion();
        if (Version::is_devel()) {
            $siteinfo[_t('Habari Version')] .= " " . Version::get_git_short_hash();
        }
        $theme_info = Themes::get_active_data(true);
        $siteinfo[_t('Habari API Version')] = Version::get_apiversion();
        $siteinfo[_t('Habari DB Version')] = Version::get_dbversion();
        $siteinfo[_t('Active Theme')] = $theme_info['name'] . ' ' . $theme_info['version'];
        $siteinfo[_t('System Locale')] = Locale::get();
        $siteinfo[_t('Cache Class')] = Cache::get_class();
        $this->theme->siteinfo = $siteinfo;
        // Assemble System Info
        $sysinfo[_t('PHP Version')] = phpversion();
        $sysinfo[_t('Server Software')] = $_SERVER['SERVER_SOFTWARE'];
        $sysinfo[_t('Database')] = DB::get_driver_name() . ' - ' . DB::get_driver_version();
        $sysinfo[_t('PHP Extensions')] = implode(', ', get_loaded_extensions());
        $sysinfo[_t('PHP Configuration Settings')] = implode("<br>", Utils::get_ini_settings());
        $sysinfo[_t('Browser')] = $_SERVER['HTTP_USER_AGENT'];
        $this->theme->sysinfo = $sysinfo;
        // Assemble Class Info
        $classinfo = Utils::glob(HABARI_PATH . "/user/classes/*.php");
        if (count($classinfo)) {
            $classinfo = array_map('realpath', $classinfo);
        }
        $this->theme->classinfo = $classinfo;
        // Assemble Plugin Info
        $raw_plugins = Plugins::get_active();
        $plugins = array('system' => array(), 'user' => array(), '3rdparty' => array(), 'other' => array());
        $all_plugins = Plugins::list_all();
        foreach ($raw_plugins as $plugin) {
            $file = $plugin->get_file();
            // Catch plugins that are symlinked from other locations as ReflectionClass->getFileName() only returns the ultimate file path, not the symlink path, and we really want the symlink path
            $filename = basename($file);
            if (array_key_exists($filename, $all_plugins) && $all_plugins[$filename] != $file) {
                $file = $all_plugins[$filename];
            }
            if (preg_match('%[\\\\/](system|3rdparty|user)[\\\\/]plugins[\\\\/]%i', $file, $matches)) {
                // A plugin's info is XML, cast the element to a string. See #1026.
                $plugins[strtolower($matches[1])][(string) $plugin->info->name] = array('file' => $file, 'version' => (string) $plugin->info->version);
            } else {
                // A plugin's info is XML, cast the element to a string.
                $plugins['other'][(string) $plugin->info->name] = array('file' => $file, 'version' => (string) $plugin->info->version);
            }
        }
        $this->theme->plugins = $plugins;
        $this->theme->admin_page = _t('System Information');
        $this->display('sysinfo');
    }