Changeset 117 for trunk/web/addons/toga/libtoga.php
- Timestamp:
- 05/31/05 16:13:43 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/toga/libtoga.php
r115 r117 1 1 <?php 2 // If php is compiled without globals 3 // 4 if ( !empty( $_GET ) ) { 5 extract( $_GET ); 6 } 7 2 8 class HTTPVariables { 3 9 … … 5 11 var $restvars, $httpvars; 6 12 7 function HTTPVariables( $ vars ) {13 function HTTPVariables( $httpvars, $getvars ) { 8 14 9 15 $this->restvars = array(); 10 16 11 $this->clustername = $ vars["c"] ? $vars["c"] : null;12 $this->metricname = $ vars["m"] ? $vars["m"] : null;13 14 foreach( $ vars as $httpvar => $httpval ) {17 $this->clustername = $httpvars["c"] ? $httpvars["c"] : null; 18 $this->metricname = $httpvars["m"] ? $httpvars["m"] : null; 19 20 foreach( $httpvars as $httpvar => $httpval ) { 15 21 16 22 if( $httpval ) { 17 23 $this->restvars[$httpvar] = $httpval; 24 } 25 } 26 27 foreach( $getvars as $getvar => $getval ) { 28 29 if( $getval ) { 30 $this->restvars[$getvar] = $getval; 18 31 } 19 32 } … … 40 53 include_once "./conf.php"; 41 54 42 global $GANGLIA_PATH, $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH, $DATA_SOURCE; 43 44 include_once "$GANGLIA_PATH/conf.php"; 45 include_once "$GANGLIA_PATH/functions.php"; 46 include_once "$GANGLIA_PATH/ganglia.php"; 47 48 global $HTTP_GET_VARS; 49 $httpvars = new HTTPVariables( $HTTP_GET_VARS ); 55 global $GANGLIA_PATH; 56 57 $my_dir = getcwd(); 58 59 // Load Ganglia's PHP 60 chdir( $GANGLIA_PATH ); 61 62 include_once "./conf.php"; 63 include_once "./functions.php"; 64 include_once "./ganglia.php"; 65 include_once "./get_context.php"; 66 include_once "./get_ganglia.php"; 67 68 // Back to our PHP 69 chdir( $my_dir ); 70 71 global $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH, $DATA_SOURCE, $HTTP_GET_VARS, $_GET; 72 $httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET ); 50 73 51 74 // Set cluster context so that Ganglia will … … 53 76 // 54 77 global $context, $clustername; 55 $clustername = $httpvars->getClusterName(); 56 $context = 'cluster'; 57 58 include_once "$GANGLIA_PATH/get_ganglia.php"; 78 //$clustername = $httpvars->getClusterName(); 79 //$context = 'cluster'; 59 80 60 81 // Ganglia's array of host metrics … … 62 83 global $metrics; 63 84 64 // If php is compiled without globals65 //66 if ( !empty( $_GET ) ) {67 extract( $_GET );68 }69 85 70 86 class DataSource {
Note: See TracChangeset
for help on using the changeset viewer.