/**
  * @param $fileName string database config file
  * @return DatabaseConfig
  * @throws \SFramework\Exceptions\MissingConfigEntryException
  */
 public static function parseFromFile($fileName)
 {
     $configFile = new ConfigFileParser($fileName);
     return new self($configFile->getEntry("host"), $configFile->getEntry("user"), $configFile->getEntry("password"), $configFile->getEntry("database"), $configFile->getEntry("port"));
 }
Esempio n. 2
0
$installer->setTitleHTML("N/X 5.0 Instalation");
$page1 = new Page("Introduction");
$page1->addWidget(new Information("", "./_installer/introduction.txt"));
$page2 = new Page("License Agreement");
$page2->addWidget(new Label("The GNU General Publich License (GPL)", "bold"));
$page2->addWidget(new LicenseAgreement("./_installer/license.txt"));
$page3 = new Page("Create Database");
$page3->addWidget(new CreateMYSQL("./sql/demohomepage.sql"));
// set dropdowns...
$onOff[0]["name"] = "On";
$onOff[0]["value"] = "true";
$onOff[1]["name"] = "Off";
$onOff[1]["value"] = "false";
$languages = array(array("name" => "English", "value" => "EN"), array("name" => "German", "value" => "DE"));
$page4 = new Page("System Configuration");
$cfp = new ConfigFileParser();
$cfp->addFileToParse("./_installer/config.inc.php", "./cms/config.inc.php");
$cfp->addWidget(new Label("Path Configuration", "headline2"));
$cfp->addWidget(new Path("Path on drive, where N/X is installed, e.g. c:/Web/nx4", "PATH", ""));
$cfp->addWidget(new WebServer("Address of your Webserver, e.g. http://localhost", "SERVER"));
$cfp->addWidget(new Docroot("Docroot of the system, e.g. /nx4/", "DOCROOT", ""));
$cfp->addWidget(new Label("<br>", "standard"));
$cfp->addWidget(new Label("Caching", "headline2"));
$cfp->addWidget(new Label("Static caching creates HTML-Files on Demand, which are always present and only expire, when one expires them in backend. Dynamic cache is built on demand. When a user request a page, the cache checks if it is still buffered (15 minutes default). If so, the cached page is sent to the user. If not, the page is rendered, stored and sent afterwards.<br><br>"));
$cfp->addWidget(new SelectBox("Static Caching: <br>(Default = Off)", "SCACHE", "false", $onOff));
$cfp->addWidget(new SelectBox("Dynamic Caching: <br>(Default = On)", "DYNCACHE", "true", $onOff));
$cfp->addWidget(new Label("<br>", "standard"));
$cfp->addWidget(new Label("Tools & Security", "headline2"));
$cfp->addWidget(new Label("Traffic statics are used for recording page impressions and visits. Host authorization is used when authorizing a user. Once a session is created, it is locked to a host. Sometimes this gives you trouble, especially if you are behind a firewall using multiplie IP-Adresses. Disable this function then.<br>"));
$cfp->addWidget(new SelectBox("Traffic Statistics: <br>(Default = On)", "STATS", "true", $onOff));
$cfp->addWidget(new SelectBox("Host Authorization: <br>(Default = On)", "HOSTAUTH", "true", $onOff));