Changeset 55 for trunk/Packages/Common/Config.php
- Timestamp:
- Apr 7, 2020, 12:55:39 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Config.php
r37 r55 12 12 function ReadValue($Name) 13 13 { 14 if (!is_array($Name)) $Name = explode('/', $Name);14 if (!is_array($Name)) $Name = explode('/', $Name); 15 15 $Last = array_pop($Name); 16 16 $Data = &$this->Data; 17 foreach ($Name as $Item)17 foreach ($Name as $Item) 18 18 { 19 19 $Data = &$Data[$Item]; 20 20 } 21 return ($Data[$Last]);21 return $Data[$Last]; 22 22 } 23 23 24 24 function WriteValue($Name, $Value) 25 25 { 26 if (!is_array($Name)) $Name = explode('/', $Name);26 if (!is_array($Name)) $Name = explode('/', $Name); 27 27 $Last = array_pop($Name); 28 28 $Data = &$this->Data; 29 foreach ($Name as $Item)29 foreach ($Name as $Item) 30 30 { 31 31 $Data = &$Data[$Item]; … … 38 38 $ConfigData = array(); 39 39 include $FileName; 40 foreach ($this->Data as $Index => $Item)40 foreach ($this->Data as $Index => $Item) 41 41 { 42 if (array_key_exits($Index, $ConfigData))42 if (array_key_exits($Index, $ConfigData)) 43 43 $this->Data[$Index] = $ConfigData[$Index]; 44 44 } … … 52 52 function GetAsArray() 53 53 { 54 return ($this->Data);54 return $this->Data; 55 55 } 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.