Changeset 578 for trunk/Common/Global.php
- Timestamp:
- Oct 10, 2013, 8:50:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r576 r578 21 21 include_once(dirname(__FILE__).'/../FormClasses.php'); 22 22 23 function GlobalInit()24 {25 global $Config, $Database, $System, $ScriptTimeStart, $ConfigFileName, $Mail, $Type,26 $DatabaseRevision;27 28 date_default_timezone_set('Europe/Prague');29 mb_internal_encoding("UTF-8");30 $ScriptTimeStart = GetMicrotime();31 32 if(!isset($Config)) die('Systém není nainstalován. Pokračujte v instalaci <a href="admin/">zde</a>.');33 34 // SQL injection hack protection35 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);36 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);37 38 if(isset($_SERVER['REMOTE_ADDR'])) session_start();39 40 $System = new System();41 // TODO: unset general global variable $Config after setting is loaded to objects42 $System->Config = &$Config;43 $System->Database->Connect($Config['Database']['Host'], $Config['Database']['User'],44 $Config['Database']['Password'], $Config['Database']['Database']);45 $System->Database->Prefix = $Config['Database']['Prefix'];46 $System->Database->charset($Config['Database']['Charset']);47 $System->Database->ShowSQLError = $Config['Web']['ShowSQLError'];48 $System->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];49 $System->RootURLFolder = $Config['Web']['RootFolder'];50 $System->FormManager->Root = $Config['Web']['RootFolder'];51 52 // Check database persistence structure53 $UpdateManager = new UpdateManager();54 $UpdateManager->Database = &$System->Database;55 $UpdateManager->Revision = $DatabaseRevision;56 if(!$UpdateManager->IsInstalled()) die('Systém vyžaduje instalaci databáze.');57 if(!$UpdateManager->IsUpToDate()) die('Systém vyžaduje aktualizaci databáze.');58 59 $Database = $System->Database;60 RegisterFormClasses($System->FormManager);61 62 // Register and start existing modules63 include_once(dirname(__FILE__).'/../Modules/System/System.php');64 $System->ModuleManager->RegisterModule(new ModuleSystem($System));65 $System->ModuleManager->Modules['System']->Start();66 $System->ModuleManager->LoadModules();67 $System->ModuleManager->StartAll();68 }69 70 23 $MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 71 24 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'); … … 389 342 return($PathItems); 390 343 } 391 392 GlobalInit();
Note:
See TracChangeset
for help on using the changeset viewer.