/** * Init server info form. * * @param int $a_mode Edit Mode */ public function initServerInfoForm() { global $lng, $ilClientIniFile, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // installation name $ne = new ilNonEditableValueGUI($lng->txt("inst_name"), ""); $ne->setValue($ilClientIniFile->readVariable("client", "name")); $ne->setInfo($ilClientIniFile->readVariable("client", "description")); $this->form->addItem($ne); // client id $ne = new ilNonEditableValueGUI($lng->txt("client_id"), ""); $ne->setValue(CLIENT_ID); $this->form->addItem($ne); // installation id $ne = new ilNonEditableValueGUI($lng->txt("inst_id"), ""); $ne->setValue($ilSetting->get("inst_id")); $this->form->addItem($ne); // database version $ne = new ilNonEditableValueGUI($lng->txt("db_version"), ""); $ne->setValue($ilSetting->get("db_version")); include_once "./Services/Database/classes/class.ilDBUpdate.php"; $this->form->addItem($ne); // ilias version $ne = new ilNonEditableValueGUI($lng->txt("ilias_version"), ""); $ne->setValue($ilSetting->get("ilias_version")); $this->form->addItem($ne); // version controll information, object can be created by factory in later revisions (if we support git etc.) require_once 'Services/Administration/classes/class.ilSubversionInformation.php'; $vc = new ilSubversionInformation(); $revision_info = $vc->getInformationAsHtml(); if ($revision_info) { $ne = new ilCustomInputGUI($lng->txt('vc_information'), ''); $ne->setHtml($revision_info); $this->form->addItem($ne); } // host $ne = new ilNonEditableValueGUI($lng->txt("host"), ""); $ne->setValue($_SERVER["SERVER_NAME"]); $this->form->addItem($ne); // ip & port $ne = new ilNonEditableValueGUI($lng->txt("ip_address") . " & " . $this->lng->txt("port"), ""); $ne->setValue($_SERVER["SERVER_ADDR"] . ":" . $_SERVER["SERVER_PORT"]); $this->form->addItem($ne); // server $ne = new ilNonEditableValueGUI($lng->txt("server_software"), ""); $ne->setValue($_SERVER["SERVER_SOFTWARE"]); $this->form->addItem($ne); // http path $ne = new ilNonEditableValueGUI($lng->txt("http_path"), ""); $ne->setValue(ILIAS_HTTP_PATH); $this->form->addItem($ne); // absolute path $ne = new ilNonEditableValueGUI($lng->txt("absolute_path"), ""); $ne->setValue(ILIAS_ABSOLUTE_PATH); $this->form->addItem($ne); $not_set = $lng->txt("path_not_set"); // convert $ne = new ilNonEditableValueGUI($lng->txt("path_to_convert"), ""); $ne->setValue(PATH_TO_CONVERT ? PATH_TO_CONVERT : $not_set); $this->form->addItem($ne); // zip $ne = new ilNonEditableValueGUI($lng->txt("path_to_zip"), ""); $ne->setValue(PATH_TO_ZIP ? PATH_TO_ZIP : $not_set); $this->form->addItem($ne); // unzip $ne = new ilNonEditableValueGUI($lng->txt("path_to_unzip"), ""); $ne->setValue(PATH_TO_UNZIP ? PATH_TO_UNZIP : $not_set); $this->form->addItem($ne); // java $ne = new ilNonEditableValueGUI($lng->txt("path_to_java"), ""); $ne->setValue(PATH_TO_JAVA ? PATH_TO_JAVA : $not_set); $this->form->addItem($ne); // htmldoc $ne = new ilNonEditableValueGUI($lng->txt("path_to_htmldoc"), ""); $ne->setValue(PATH_TO_HTMLDOC ? PATH_TO_HTMLDOC : $not_set); $this->form->addItem($ne); // mkisofs $ne = new ilNonEditableValueGUI($lng->txt("path_to_mkisofs"), ""); $ne->setValue(PATH_TO_MKISOFS ? PATH_TO_MKISOFS : $not_set); $this->form->addItem($ne); // latex $ne = new ilNonEditableValueGUI($lng->txt("url_to_latex"), ""); $ne->setValue(URL_TO_LATEX ? URL_TO_LATEX : $not_set); $this->form->addItem($ne); $this->form->setTitle($lng->txt("server_data")); $this->form->setFormAction($this->ctrl->getFormAction($this)); }
/** * */ protected function showVcsInformationObject() { // version controll information, object can be created by factory in later revisions (if we support git etc.) require_once 'Services/Administration/classes/class.ilSubversionInformation.php'; $vc = new ilSubversionInformation(); $revision_info = $vc->getInformationAsHtml(); if ($revision_info) { ilUtil::sendInfo($revision_info); } $this->showServerInfoObject(); }
/** * */ private static function detect() { /** * @var $lng ilLanguage */ global $lng; if (null !== self::$revision_information) { return self::$revision_information; } $info = array(); if (self::isProbablySubversion17()) { if (extension_loaded('PDO') && extension_loaded('pdo_sqlite')) { try { $wcdb = new PDO('sqlite:' . self::SVN_GET_17_FILE); $result = $wcdb->query('SELECT MAX("revision") current_rev FROM "NODES"'); if ($result) { foreach ($result as $row) { $revision = $row['current_rev']; if (self::isSvnRevision($revision)) { $info[] = sprintf($lng->txt('svn_revision_current'), $revision); } break; } } $result = $wcdb->query('SELECT "changed_revision" last_changed_revision FROM "NODES" ORDER BY changed_revision DESC LIMIT 1'); if ($result) { foreach ($result as $row) { $revision = $row['last_changed_revision']; if (self::isSvnRevision($revision)) { $info[] = sprintf($lng->txt('svn_revision_last_change'), $revision); } break; } } $result = $wcdb->query('SELECT * FROM REPOSITORY '); if ($result) { foreach ($result as $row) { $info[] = sprintf($lng->txt('svn_root'), $row['root']); } } $result = $wcdb->query('SELECT * FROM "NODES" WHERE local_relpath LIKE "%inc.ilias_version.php"'); if ($result) { foreach ($result as $row) { $path = dirname(dirname($row['repos_path'])); if ($path) { $info[] = sprintf($lng->txt('svn_path'), $path); } } } } catch (Exception $e) { } } } else { if (function_exists('shell_exec') && is_callable('shell_exec')) { $revision = trim(shell_exec('svnversion ' . realpath(getcwd()))); if (self::isSvnRevision($revision)) { $info[] = sprintf($lng->txt('svn_revision_current'), $revision); } } if (self::isProbablySubversionLower17()) { $svnfile = file(self::SVN_LT_17_FILE); $revision = $svnfile[3]; if (self::isSvnRevision($revision)) { $info[] = sprintf($lng->txt('svn_revision_last_change'), $revision); } } } self::$revision_information = $info; }