Changeset 14 for Common/Update.php
- Timestamp:
- Aug 3, 2021, 11:36:12 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/Update.php
r10 r14 3 3 class UpdateManager 4 4 { 5 var $Revision; 6 var $Trace; 7 var $VersionTable; 8 /* @var Database */ 9 var $Database; 10 var $InstallMethod; 5 public int $Revision; 6 public array $Trace; 7 public string $VersionTable; 8 public Database $Database; 9 public string $InstallMethod; 11 10 12 11 function __construct() … … 19 18 } 20 19 21 function GetDbVersion() 20 function GetDbVersion(): ?int 22 21 { 23 22 $DbResult = $this->Database->select($this->VersionTable, '*', 'Id=1'); … … 26 25 } 27 26 28 function IsInstalled() 27 function IsInstalled(): bool 29 28 { 30 29 $DbResult = $this->Database->query('SHOW TABLES LIKE "'.$this->VersionTable.'"'); … … 32 31 } 33 32 34 function IsUpToDate() 33 function IsUpToDate(): bool 35 34 { 36 35 return $this->Revision <= $this->GetDbVersion(); 37 36 } 38 37 39 function Upgrade() 38 function Upgrade(): string 40 39 { 41 40 $DbRevision = $this->GetDbVersion(); … … 59 58 } 60 59 61 function Install() 60 function Install(): void 62 61 { 63 62 $InstallMethod = $this->InstallMethod; 64 63 $InstallMethod($this); 65 $this->Update();66 64 } 67 65 68 function Uninstall() 66 function Uninstall(): void 69 67 { 70 71 68 } 72 69 73 function InsertSampleData() 70 function InsertSampleData(): void 74 71 { 75 72 $InstallMethod = $this->InsertSampleDataMethod; … … 77 74 } 78 75 79 function Execute( $Query)76 function Execute(string $Query): DatabaseResult 80 77 { 81 78 echo($Query.';<br/>');
Note:
See TracChangeset
for help on using the changeset viewer.