Changeset 47 for trunk/Base/System.php
- Timestamp:
- Jul 27, 2014, 9:14:56 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 2 1 config.php 2 .project
-
- Property svn:ignore
-
trunk/Base/System.php
r45 r47 84 84 { 85 85 } 86 86 87 87 class System 88 88 { 89 var $Model = array(); 90 var $View = array(); 91 var $Controller = array(); 89 var $Model = array(); 90 var $View = array(); 91 var $Controller = array(); 92 92 var $Config; 93 93 var $Database; … … 106 106 107 107 $TimeStart = $this->GetMicrotime(); 108 108 109 109 // Change base dir to index. Helpfull if script is executed from command line with related path. 110 110 chdir(dirname(__FILE__)); … … 119 119 } 120 120 121 $Config = array(); 122 121 123 $FileName = dirname(__FILE__).'/../Application/Config/Config.php'; 122 124 if(file_exists($FileName)) include($FileName); 123 125 124 126 $this->Config = $Config; 125 127 126 128 $ShowPHPError = $this->Config['System']['ShowPHPError']; 127 129 130 $Translation = array(); 128 131 $FileName = dirname(__FILE__).'/../Application/Locale/'.$this->Config['System']['Locale'].'.php'; 129 132 if(file_exists($FileName)) include($FileName); … … 142 145 $this->Database->Prefix = $this->Config['Database']['Prefix']; 143 146 $this->Database->charset($this->Config['Database']['Charset']); 144 147 145 148 $this->HTTP = new HTTP(); 146 149 $this->HTML = new HTML($this); … … 152 155 { 153 156 $this->TimeStart = $this->GetMicrotime(); 154 157 155 158 // SQL injection hack protection 156 159 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); … … 183 186 $this->Modules[$Name] = new $Name($this); 184 187 } 185 188 186 189 function HumanDate($Time) 187 190 { … … 214 217 $I = $PrefixMultipliers[$PrefixType]['BaseIndex']; 215 218 if($Value == 0) return($Value.' '.$PrefixMultipliers[$PrefixType]['Definition'][$I][0].$Unit); 216 217 if($Value > 1) 219 220 if($Value > 1) 218 221 { 219 222 while((($I + 1) <= count($PrefixMultipliers[$PrefixType]['Definition'])) and (($Value / $PrefixMultipliers[$PrefixType]['Definition'][$I + 1][2]) > 1)) 220 223 $I = $I + 1; 221 } else 224 } else 222 225 if($Value < 1) 223 226 { … … 226 229 } 227 230 $Value = $Value / $PrefixMultipliers[$PrefixType]['Definition'][$I][2]; 228 231 229 232 // Truncate digits count 230 233 $Value = $this->TruncateDigits($Value, $Digits); … … 232 235 return($Value.' '.$PrefixMultipliers[$PrefixType]['Definition'][$I][0].$Unit); 233 236 } 234 237 235 238 function NetworkPortState($Address, $Port, $Timeout = 1) 236 239 { … … 281 284 } 282 285 } 283 284 ?>
Note:
See TracChangeset
for help on using the changeset viewer.