Changeset 888 for trunk/Packages/Common/Config.php
- Timestamp:
- Nov 24, 2020, 10:58:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Config.php
r874 r888 3 3 class Config 4 4 { 5 var$Data;5 public array $Data; 6 6 7 7 function __construct() … … 10 10 } 11 11 12 function ReadValue( $Name)12 function ReadValue(string $Name) 13 13 { 14 14 if (!is_array($Name)) $Name = explode('/', $Name); … … 22 22 } 23 23 24 function WriteValue( $Name, $Value)24 function WriteValue(string $Name, $Value) 25 25 { 26 26 if (!is_array($Name)) $Name = explode('/', $Name); … … 34 34 } 35 35 36 function LoadFromFile( $FileName)36 function LoadFromFile(string $FileName): void 37 37 { 38 38 $ConfigData = array(); … … 40 40 foreach ($this->Data as $Index => $Item) 41 41 { 42 if (array_key_exi ts($Index, $ConfigData))42 if (array_key_exists($Index, $ConfigData)) 43 43 $this->Data[$Index] = $ConfigData[$Index]; 44 44 } 45 45 } 46 46 47 function SaveToFile( $FileName)47 function SaveToFile(string $FileName): void 48 48 { 49 49 file_put_contents($FileName, "<?php \n\n\$ConfigData = ".var_export($this->Data, true).";\n"); 50 50 } 51 51 52 function GetAsArray() 52 function GetAsArray(): array 53 53 { 54 54 return $this->Data;
Note:
See TracChangeset
for help on using the changeset viewer.