Changeset 44
- Timestamp:
- Nov 24, 2009, 5:19:21 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Model/Measurement/MeasureClient.php
r43 r44 1 1 <?php 2 3 include_once(dirname(__FILE__).'/../../../Base/Model.php'); 2 4 3 5 class MeasureClient extends Model … … 8 10 while($MeasureClient = $DbResult->fetch_assoc()) 9 11 { 10 if(class_exists($MeasureClient['MeasureClass'])) 12 $DbResult2 = $this->Database->select('MeasureMethod', '*', 'Id='.$MeasureClient['Method']); 13 $MeasureMethod = $DbResult2->fetch_assoc(); 14 echo($MeasureClient['MeasureId'].','); 15 include_once(dirname(__FILE__).'/'.$MeasureMethod['MeasureClass'].'.php'); 16 $MeasureMethod['MeasureClass'] .= 'Measurement'; 17 if(class_exists($MeasureMethod['MeasureClass'])) 11 18 { 12 $MeasureClass = new $Measure Client['MeasureClass']();13 if(method_exists($MeasureClass, $Measure Class['Method']))19 $MeasureClass = new $MeasureMethod['MeasureClass']($this->System); 20 if(method_exists($MeasureClass, $MeasureMethod['Method'])) 14 21 { 15 if($MeasureClient['Parameter'] != '') $Value = $Measure->$MeasureClient['Method']($MeasureClient['Parameter']); 16 else $Value = $Measure->$MeasureClient['Method'](); 17 file_get_contents($MeasureClient['Host'].$MeasureClient['Path'].'/?MeasureId='.$MeasureClient['MeasureId'].'&Value='.addslashes($Value)); 18 } else echo('Metoda '.$MeasureClient['Method'].' neexistuje.'); 19 } else echo('Třída '.$MeasureClient['MeasureClass'].' neexistuje.'); 20 22 if($MeasureClient['Parameter'] != '') $Value = $Measure->$MeasureMethod['Method']($MeasureClient['Parameter']); 23 else $Value = $MeasureClass->$MeasureMethod['Method'](); 24 echo(file_get_contents('http://'.$MeasureClient['Host'].$MeasureClient['Path'].'/?M=Add&MeasureId='.$MeasureClient['MeasureId'].'&Value='.addslashes($Value))); 25 } else echo('Metoda '.$MeasureMethod['Method'].' neexistuje.'); 26 } else echo('Třída '.$MeasureMethod['MeasureClass'].' neexistuje.'); 21 27 } 22 28 } -
trunk/Application/Model/Measurement/System.php
r43 r44 2 2 3 3 // Funkce pro získání stavových informací o systému 4 5 function ErrorHandler($errno,$errmsg,$filename,$linenum,$vars)6 {7 }8 4 9 5 include_once(dirname(__FILE__).'/Measurement.php'); … … 54 50 } 55 51 56 function C puUsage()52 function CPUUsage() 57 53 { 58 54 $CpuStateFileName = '/tmp/LastCpuUsage'; 59 $LastCpuUsage = unserializ a(file_get_contents($CpuStateFileName));55 $LastCpuUsage = unserialize(file_get_contents($CpuStateFileName)); 60 56 //$cpuIDLEprev, $cpuSYSTprev, $cpuUSERprev; 61 57 -
trunk/Application/View/Main.php
r43 r44 206 206 if($Measure['Info'] == '') $Measure['Info'] = ' '; 207 207 $GenerationTime = floor(($this->System->GetMicrotime() - $StopWatchStart) * 1000 ) / 1000; 208 $Output .= '<tr><td><a href="?Measure='.$Measure['Id'].'&Differential=0">'.$Measure[' Description'].'</a></td><td align="center">'.$LastMeasureValue.'</td><td align="center">'.$LastMeasureTime.'</td><td align="center">'.$Interpolate.'</td><td>'.$Measure['Info'].'</td>';208 $Output .= '<tr><td><a href="?Measure='.$Measure['Id'].'&Differential=0">'.$Measure['Name'].'</a></td><td align="center">'.$LastMeasureValue.'</td><td align="center">'.$LastMeasureTime.'</td><td align="center">'.$Interpolate.'</td><td>'.$Measure['Description'].'</td>'; 209 209 if(array_key_exists('Debug', $_GET)) $Output .= '<td>'.$RowCount.'</td><td>'.$GenerationTime.'</td>'; 210 210 $Output .= '</tr>'; -
trunk/Base/HTTP.php
r42 r44 3 3 class HTTP 4 4 { 5 function GetQueryStringArray( )5 function GetQueryStringArray($QueryString) 6 6 { 7 7 $Result = array(); 8 $Parts = explode('&', $ _SERVER['QUERY_STRING']);8 $Parts = explode('&', $QueryString); 9 9 foreach($Parts as $Part) 10 10 { -
trunk/index.php
r42 r44 4 4 $BaseDir = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/')); 5 5 if($BaseDir != '') chdir($BaseDir); 6 7 include_once(dirname(__FILE__).'/Base/HTTP.php'); 8 9 // Is executed from command line? 10 if(!isset($_SERVER['REMOTE_ADDR'])) 11 { 12 $HTTP = new HTTP(); 13 $_GET = $HTTP->GetQueryStringArray($_SERVER['argv'][1]); 14 } 15 print_r($_SERVER); 16 print_r($_GET); 6 17 7 18 include_once(dirname(__FILE__).'/Application/Application.php');
Note:
See TracChangeset
for help on using the changeset viewer.