Changeset 578 for trunk/Common/System.php
- Timestamp:
- Oct 10, 2013, 8:50:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/System.php
r577 r578 1 1 <?php 2 2 3 class System 3 include_once(dirname(__FILE__).'/Application.php'); 4 include_once(dirname(__FILE__).'/Global.php'); 5 6 class System extends Application 4 7 { 5 8 /** @var Database */ … … 13 16 var $PathItems; 14 17 var $RootURLFolder; 18 var $ShowPage; 15 19 16 20 function __construct() … … 21 25 $this->Database = new Database(); 22 26 $this->FormManager = new FormManager($this->Database); 27 $this->ShowPage = true; 23 28 } 24 29 … … 87 92 { 88 93 return($this->RootURLFolder.$Target); 89 } 94 } 95 96 function Run() 97 { 98 global $Config, $Database, $ScriptTimeStart, $ConfigFileName, $Mail, $Type, 99 $DatabaseRevision; 100 101 date_default_timezone_set('Europe/Prague'); 102 mb_internal_encoding("UTF-8"); 103 $ScriptTimeStart = GetMicrotime(); 104 105 if(!isset($Config)) die('Systém není nainstalován. Pokračujte v instalaci <a href="admin/">zde</a>.'); 106 107 // SQL injection hack protection 108 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 109 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 110 111 if(isset($_SERVER['REMOTE_ADDR'])) session_start(); 112 113 // TODO: unset general global variable $Config after setting is loaded to objects 114 $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']; 123 124 // Check database persistence structure 125 $UpdateManager = new UpdateManager(); 126 $UpdateManager->Database = &$this->Database; 127 $UpdateManager->Revision = $DatabaseRevision; 128 if(!$UpdateManager->IsInstalled()) die('Systém vyžaduje instalaci databáze.'); 129 if(!$UpdateManager->IsUpToDate()) die('Systém vyžaduje aktualizaci databáze.'); 130 131 $Database = $this->Database; 132 RegisterFormClasses($this->FormManager); 133 134 // 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 $this->ModuleManager->LoadModules(); 139 $this->ModuleManager->StartAll(); 140 if($this->ShowPage) 141 { 142 $this->PathItems = ProcessURL(); 143 $this->ShowPage(); 144 } 145 } 90 146 }
Note:
See TracChangeset
for help on using the changeset viewer.