/** * Outputs the systeminfo in a human readable format. * This function outputs html styled information and should only be used for displaying information. * @return string The html styled system information */ public static final function getSystemInfo() { $output = ''; $output .= '<table style="margin: 10px; font-family: Verdana; font-size: 12px; width: 600px; border: 1px solid black; background-color: #9999cc;"> <tr><td colspan="2"> <p style="font-size: 14px; font-weight: bold;">SYSTEM INFORMATION</p> <p style="font-size: 10px;"> Notice: This file is copyrighted and unauthorized use is strictly prohibited.<br /> The file contains proprietary information and may not be distributed, modified<br /> or altered in any way, without written perimission.<br /> Copyright: SUPERHOLDER B.V. ' . date('Y') . ' </p> </td></tr> </table>'; $info = new \System\Collection\Vector(); $system = new \System\Collection\Map(); $system->name = 'SYSTEM Namespace'; $system->manifest = 'N/A'; $system->major = self::getMajor(); $system->minor = self::getMinor(); $system->revision = self::getSourceRevision(); $map = new \System\Collection\Map(); $map->PHP = self::getPHPVersion(); $map->hasSlowQueryListener = \System\Event\EventHandler::hasListeners('\\System\\Event\\Event\\OnSlowMySQLQueryEvent') ? 'true' : 'false'; if (self::$configDirectives == null) { self::$configDirectives = new \System\Collection\Vector(); } $map->requiredConfigDirectives = implode(', ', self::$configDirectives->getArrayCopy()); $map->PATH_PROJECT = PATH_PROJECT; $map->PATH_SYSTEM = PATH_SYSTEM; $map->PATH_CONFIG = PATH_CONFIG; $map->PATH_TEMP = PATH_TEMP; $map->PATH_LOGS = PATH_LOGS; $map->PATH_MODULES = PATH_MODULES; $map->installedCaches = 'LUTCache, Memcache, APCCache'; $system->additional = $map; $info[] = $system; $info->combine(\System\Module\Module::getAllModules()); foreach ($info as $module) { $output .= '<table style="margin: 10px; font-family: Verdana; font-size: 12px; width: 600px; border: 1px solid black; background-color: #9999cc;">'; $output .= '<tr><td colspan="2" style="text-align: center; font-weight: bold; font-size: 14px;">' . $module->name . '</td></tr>'; $output .= '<tr><td style="background-color: #ccccff; width: 200px;">Manifest</td><td style="background-color: #cccccc; width: 400px;">' . $module->manifest . '</td></tr>'; $output .= '<tr><td style="background-color: #ccccff; width: 200px;">Version</td><td style="background-color: #cccccc; width: 400px;">' . $module->major . "." . $module->minor . "." . $module->revision . '</td></tr>'; foreach ($module->additional as $index => $value) { $output .= '<tr><td style="background-color: #ccccff; width: 200px;">' . $index . '</td><td style="background-color: #cccccc; width: 400px;">' . $value . '</td></tr>'; } $output .= '</table>'; } return $output; }
/** * @brief Get the latest version which is available * * @param string $type the version type ('stable' or 'unstable') * * @retval SystemVersion the latest available version * * @throws Exception if there was an error * * @see SystemVersion::get_latest_version() */ public function get_latest_version($type) { return SystemVersion::get_latest_version($type); }
/** * @brief Get the latest system version which is available (in the internet or in the directory "/updates/") * * @param string $type 'stable' or 'unstable' * * @retval Version the latest available system version * * @throws Exception if there was an error * * @todo Search also in the local direcotry "/updates/" for updates. * This is needed for manual updates (maybe the server has no internet access, or no "curl"). */ public static function get_latest_version($type) { if ($type == 'stable' && !is_object(SystemVersion::$latest_stable_version) || $type == 'unstable' && !is_object(SystemVersion::$latest_unstable_version)) { $ini = curl_get_data('http://kami89.myparts.info/updates/latest.ini'); $ini_array = parse_ini_string($ini, true); SystemVersion::$latest_stable_version = new SystemVersion($ini_array['stable']['version']); SystemVersion::$latest_unstable_version = new SystemVersion($ini_array['unstable']['version']); } switch ($type) { case 'stable': return SystemVersion::$latest_stable_version; case 'unstable': return SystemVersion::$latest_unstable_version; default: debug('error', '$type=' . print_r($type, true), __FILE__, __LINE__, __METHOD__); throw new Exception('$type hat einen ungültigen Inhalt!'); } }
$action = 'save_admin_password'; } if (isset($_REQUEST['save_db_settings'])) { $action = 'save_db_settings'; } if (isset($_REQUEST['save_db_backup_path'])) { $action = 'save_db_backup_path'; } /******************************************************************************** * * Initialize Objects * *********************************************************************************/ $html = new HTML($config['html']['theme'], $config['html']['custom_css'], 'Part-DB Installation/Update'); try { $system_version = SystemVersion::get_installed_version(); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } /******************************************************************************** * * Execute actions * *********************************************************************************/ if (!$fatal_error) { switch ($action) { case 'save_locales': try { $config['timezone'] = $timezone; $config['language'] = $language;