Changeset 887 for trunk/Packages/Common/Setup.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Setup.php
r874 r887 3 3 class PageSetup extends Page 4 4 { 5 var $UpdateManager;6 var$ConfigDefinition;7 var$Config;8 var$DatabaseRevision;9 var$Revision;10 var $Updates;11 var $ConfigDir;12 13 function __construct( $System)5 public UpdateManager $UpdateManager; 6 public array $ConfigDefinition; 7 public array $Config; 8 public int $DatabaseRevision; 9 public int $Revision; 10 public string $ConfigDir; 11 public array $YesNo; 12 13 function __construct(System $System) 14 14 { 15 15 parent::__construct($System); 16 $this->Title = T('Application setup'); 16 $this->FullTitle = T('Application setup'); 17 $this->ShortTitle = T('Application setup'); 17 18 //$this->ParentClass = 'PagePortal'; 18 19 $this->ConfigDir = dirname(dirname(dirname(__FILE__))).'/Config'; … … 20 21 } 21 22 22 function LoginPanel() 23 function LoginPanel(): string 23 24 { 24 25 $Output = '<h3>Přihlášení k instalaci</h3>'. … … 32 33 } 33 34 34 function ControlPanel() 35 function ControlPanel(): string 35 36 { 36 37 $Output = '<h3>'.T('Instance management').'</h3>'; … … 62 63 } 63 64 64 function Show() 65 function Show(): string 65 66 { 66 67 global $ConfigDefinition, $DatabaseRevision, $Config, $Updates; … … 163 164 } 164 165 165 function ShowModules() 166 function ShowModules(): string 166 167 { 167 168 $Output = ''; … … 170 171 if ($Operation == 'install') 171 172 { 172 $this->System->ModuleManager-> Modules[$_GET['name']]->Install();173 $this->System->ModuleManager->GetModule($_GET['name'])->Install(); 173 174 $this->System->ModuleManager->SaveState(); 174 175 $Output .= 'Modul '.$_GET['name'].' instalován<br/>'; … … 176 177 if ($Operation == 'uninstall') 177 178 { 178 $this->System->ModuleManager-> Modules[$_GET['name']]->Uninstall();179 $this->System->ModuleManager->GetModule($_GET['name'])->Uninstall(); 179 180 $this->System->ModuleManager->SaveState(); 180 181 $Output .= 'Modul '.$_GET['name'].' odinstalován<br/>'; … … 182 183 if ($Operation == 'enable') 183 184 { 184 $this->System->ModuleManager-> Modules[$_GET['name']]->Enable();185 $this->System->ModuleManager->GetModule($_GET['name'])->Enable(); 185 186 $this->System->ModuleManager->SaveState(); 186 187 $Output .= 'Modul '.$_GET['name'].' povolen<br/>'; … … 188 189 if ($Operation == 'disable') 189 190 { 190 $this->System->ModuleManager-> Modules[$_GET['name']]->Disable();191 $this->System->ModuleManager->GetModule($_GET['name'])->Disable(); 191 192 $this->System->ModuleManager->SaveState(); 192 193 $Output .= 'Modul '.$_GET['name'].' zakázán<br/>'; … … 194 195 if ($Operation == 'upgrade') 195 196 { 196 $this->System->ModuleManager-> Modules[$_GET['name']]->Upgrade();197 $this->System->ModuleManager->GetModule($_GET['name'])->Upgrade(); 197 198 $this->System->ModuleManager->SaveState(); 198 199 $Output .= 'Modul '.$_GET['name'].' povýšen<br/>'; … … 203 204 } 204 205 205 function ShowList() 206 function ShowList(): string 206 207 { 207 208 $Output = ''; … … 247 248 } 248 249 249 function PrepareConfig($Config) 250 function PrepareConfig($Config): string 250 251 { 251 252 $Output = ''; … … 322 323 } 323 324 324 function CreateConfig($Config) 325 function CreateConfig($Config): string 325 326 { 326 327 $Output = "<?php\n\n". … … 359 360 class PageSetupRedirect extends Page 360 361 { 361 function Show() 362 function Show(): string 362 363 { 363 364 $Output = ''; … … 377 378 class Setup extends Model 378 379 { 379 var $UpdateManager;380 public UpdateManager $UpdateManager; 380 381 381 382 function Start() … … 383 384 global $DatabaseRevision; 384 385 385 $this->System->RegisterPage( '', 'PageSetupRedirect');386 $this->System->RegisterPage( 'setup', 'PageSetup');386 $this->System->RegisterPage([''], 'PageSetupRedirect'); 387 $this->System->RegisterPage(['setup'], 'PageSetup'); 387 388 388 389 // Check database persistence structure … … 396 397 { 397 398 unset($this->UpdateManager); 398 $this->System->UnregisterPage( '');399 $this->System->UnregisterPage( 'setup');400 } 401 402 function CheckState() 399 $this->System->UnregisterPage(['']); 400 $this->System->UnregisterPage(['setup']); 401 } 402 403 function CheckState(): bool 403 404 { 404 405 return $this->Database->Connected() and $this->UpdateManager->IsInstalled() and … … 432 433 } 433 434 434 function IsInstalled() 435 function IsInstalled(): bool 435 436 { 436 437 $DbResult = $this->Database->query('SHOW TABLES LIKE "'.$this->UpdateManager->VersionTable.'"'); … … 438 439 } 439 440 440 function Upgrade() 441 function Upgrade(): string 441 442 { 442 443 $Updates = new Updates();
Note:
See TracChangeset
for help on using the changeset viewer.