Changeset 582 for trunk/Common/System.php
- Timestamp:
- Oct 18, 2013, 11:35:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/System.php
r581 r582 26 26 $this->FormManager = new FormManager($this->Database); 27 27 $this->ShowPage = true; 28 $this->ConfigManager = new Config(); 28 29 } 29 30 … … 96 97 function Run() 97 98 { 98 global $ Config, $Database, $ScriptTimeStart, $ConfigFileName, $Mail, $Type,99 $DatabaseRevision ;99 global $Database, $ScriptTimeStart, $ConfigFileName, $Mail, $Type, 100 $DatabaseRevision, $Config; 100 101 101 102 date_default_timezone_set('Europe/Prague'); … … 103 104 $ScriptTimeStart = GetMicrotime(); 104 105 105 if(!isset($Config)) die('Systém není nainstalován. Pokračujte v instalaci <a href="admin/">zde</a>.');106 107 106 // SQL injection hack protection 108 107 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); … … 111 110 if(isset($_SERVER['REMOTE_ADDR'])) session_start(); 112 111 113 // TODO: unset general global variable $Config after setting is loaded to objects 112 $ConfigFileName = dirname(__FILE__).'/../config.php'; 113 if(file_exists($ConfigFileName)) 114 $this->ConfigManager->LoadFromFile($ConfigFileName); 115 //$this->Config = $this->ConfigManager->GetAsArray(); 114 116 $this->Config = &$Config; 115 $this->Database->Connect($Config['Database']['Host'], $Config['Database']['User'], 116 $Config['Database']['Password'], $Config['Database']['Database']); 117 $this->Database->Prefix = $Config['Database']['Prefix']; 118 $this->Database->charset($Config['Database']['Charset']); 119 $this->Database->ShowSQLError = $Config['Web']['ShowSQLError']; 120 $this->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery']; 121 $this->RootURLFolder = $Config['Web']['RootFolder']; 122 $this->FormManager->Root = $Config['Web']['RootFolder']; 117 118 $this->Database->Connect($this->Config['Database']['Host'], $this->Config['Database']['User'], 119 $this->Config['Database']['Password'], $this->Config['Database']['Database']); 120 $this->Database->Prefix = $this->Config['Database']['Prefix']; 121 $this->Database->charset($this->Config['Database']['Charset']); 122 $this->Database->ShowSQLError = $this->Config['Web']['ShowSQLError']; 123 $this->Database->ShowSQLQuery = $this->Config['Web']['ShowSQLQuery']; 124 $this->RootURLFolder = $this->Config['Web']['RootFolder']; 125 $this->FormManager->Root = $this->Config['Web']['RootFolder']; 123 126 124 127 // Check database persistence structure … … 133 136 134 137 // Register and start existing modules 135 //include_once(dirname(__FILE__).'/../Modules/Setup/Setup.php');136 //$this->ModuleManager->RegisterModule(new ModuleSetup($this));137 //$this->ModuleManager->Modules['Setup']->Start();138 include_once(dirname(__FILE__).'/../Modules/Setup/Setup.php'); 139 $this->ModuleManager->RegisterModule(new ModuleSetup($this)); 140 $this->ModuleManager->Modules['Setup']->Start(); 138 141 $this->ModuleManager->LoadModules(); 139 142 $this->ModuleManager->Modules['Setup']->Start();
Note:
See TracChangeset
for help on using the changeset viewer.