Changeset 589 for trunk/Modules/Setup/Setup.php
- Timestamp:
- Nov 1, 2013, 4:22:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Setup/Setup.php
r588 r589 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Update.php'); 4 include_once(dirname(__FILE__).'/DefaultConfig.php'); 5 include_once(dirname(__FILE__).'/FullInstall.php'); 6 include_once(dirname(__FILE__).'/Updates.php'); 2 7 3 8 class PageSetup extends Page … … 13 18 function Show() 14 19 { 15 return(''); 20 global $ConfigDefinition, $DatabaseRevision, $Config, $Updates; 21 22 $UpdateInterface = new UpdateInterface(); 23 $DefaultConfig = new DefaultConfig(); 24 $UpdateInterface->Database = $this->Database; 25 $UpdateInterface->ConfigDefinition = $DefaultConfig->Get(); 26 $UpdateInterface->DatabaseRevision = $DatabaseRevision; 27 $UpdateInterface->Config = &$Config; 28 $UpdateInterface->Updates = &$Updates; 29 return($UpdateInterface->Show()); 16 30 } 17 31 } … … 21 35 function Show() 22 36 { 23 return('Systém není nainstalován. Pokračujte <a href="'.$this->System->Link('/setup/').'">zde</a>'); 37 echo('s'); 38 $Output = ''; 39 if(!$this->Database->Connected()) $Output .= 'Nelze se připojit k databázi.<br>'; 40 else { 41 if(!$this->System->ModuleManager->Modules['Setup']->UpdateManager->IsInstalled()) $Output .= 'Systém vyžaduje instalaci databáze.<br>'; 42 if(!$this->System->ModuleManager->Modules['Setup']->UpdateManager->IsUpToDate()) $Output .= 'Systém vyžaduje aktualizaci databáze.<br>'; 43 } 44 $Output .= 'Pokračujte <a href="'.$this->System->Link('/setup/').'">zde</a>'; 45 return($Output); 24 46 } 25 47 } … … 27 49 class ModuleSetup extends AppModule 28 50 { 51 var $UpdateManager; 52 29 53 function __construct($System) 30 54 { … … 40 64 function DoStart() 41 65 { 66 global $DatabaseRevision; 67 42 68 $this->System->RegisterPage('', 'PageSetupRedirect'); 43 $this->System->RegisterPage('setup', 'PageSetup'); 69 $this->System->RegisterPage('setup', 'PageSetup'); 70 71 // Check database persistence structure 72 $this->UpdateManager = new UpdateManager(); 73 $this->UpdateManager->Database = &$this->Database; 74 $this->UpdateManager->Revision = $DatabaseRevision; 44 75 } 76 77 function CheckState() 78 { 79 return($this->Database->Connected() and $this->UpdateManager->IsInstalled() and 80 $this->UpdateManager->IsUpToDate()); 81 } 45 82 }
Note:
See TracChangeset
for help on using the changeset viewer.