Changeset 578
- Timestamp:
- Oct 10, 2013, 8:50:31 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 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(); -
trunk/Common/Page.php
r571 r578 20 20 $this->FormatHTML = $this->System->Config['Web']['FormatHTML']; 21 21 $this->ShowRuntimeInfo = $this->System->Config['Web']['ShowRuntimeInfo']; 22 } 23 24 function Show() 25 { 26 return(''); 22 27 } 23 28 -
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 } -
trunk/Common/Version.php
r577 r578 1 1 <?php 2 2 3 $Revision = 57 7; // Subversion revision3 $Revision = 578; // Subversion revision 4 4 $DatabaseRevision = 574; // SQL structure revision 5 $ReleaseTime = '2013-10- 03';5 $ReleaseTime = '2013-10-10'; -
trunk/block/index.php
r548 r578 1 1 <?php 2 2 3 include_once('../Common/ Global.php');3 include_once('../Common/System.php'); 4 4 5 5 class BlockPage extends Page … … 42 42 } 43 43 44 $System = new System(); 45 $System->ShowPage = false; 46 $System->Run(); 44 47 $System->AddModule(new BlockPage($System)); 45 48 $System->Modules['BlockPage']->GetOutput(); 49 -
trunk/index.php
r548 r578 1 1 <?php 2 2 3 include_once('Common/Global.php'); 4 $System->PathItems = ProcessURL(); 5 $System->ShowPage(); 3 include_once('Common/System.php'); 4 5 $System = new System(); 6 $System->Run(); -
trunk/missing.php
r548 r578 1 1 <?php 2 include_once('Common/ Global.php');2 include_once('Common/System.php'); 3 3 4 4 class MissingPage extends Page … … 13 13 } 14 14 15 $System = new System(); 16 $System->ShowPage = false; 17 $System->Run(); 15 18 $System->AddModule(new MissingPage($System)); 16 19 $System->Modules['MissingPage']->GetOutput(); 20
Note:
See TracChangeset
for help on using the changeset viewer.