Only in secondlife/: clean.txt Only in secondlife/: code-style.pl diff -rup secondlife/secondlife.module temp-clean/secondlife/secondlife.module --- secondlife/secondlife.module 2008-12-16 17:05:54.000000000 +0100 +++ temp-clean/secondlife/secondlife.module 2008-12-24 13:59:42.000000000 +0100 @@ -61,7 +61,7 @@ function secondlife_settings() { '#type' => 'radios', '#title' => t('Enable timing of requests ?'), '#default_value' => variable_get('secondlife_timer', 0), - '#options' => array( 0 => t('Disabled'), 1 => t('Enabled') ), + '#options' => array(0 => t('Disabled'), 1 => t('Enabled')), '#description' => t('Select whether you want to record timing information for how much it takes to process requests from the clients. A "timer=" is send with the response to the client, and if also writting to the debugging output (if enabled).'), ); @@ -108,14 +108,14 @@ function secondlife_settings() { function secondlife_request() { // check for server ips $is_ll = FALSE; - $ll_subnets = explode(",", variable_get('secondlife_allowed_ips', SECONDLIFE_LINDEN_SERVERS) ); - foreach( $ll_subnets as $network) { - if(secondlife_netmatch($network,$_SERVER['REMOTE_ADDR'] )) { + $ll_subnets = explode(",", variable_get('secondlife_allowed_ips', SECONDLIFE_LINDEN_SERVERS)); + foreach ($ll_subnets as $network) { + if(secondlife_netmatch($network, $_SERVER['REMOTE_ADDR'])) { $is_ll = TRUE; break; } } - if ( !$is_ll ) { + if (!$is_ll) { secondlife_debug("*********************************************************"); secondlife_debug(" WRONG IP "); secondlife_debug($_SERVER['REMOTE_ADDR']); @@ -154,11 +154,11 @@ function secondlife_get_session() { secondlife_debug("============================="); secondlife_debug(format_date(time(), 'custom', 'Y-m-d G:i:s')); secondlife_debug("============================="); - foreach($_SERVER as $key => $value) { + foreach ($_SERVER as $key => $value) { secondlife_debug("SERVER: $key: $value"); } - foreach($_POST as $key => $value) { + foreach ($_POST as $key => $value) { secondlife_debug("POST: $key: $value"); } @@ -185,7 +185,7 @@ function secondlife_get_session() { $sl->position_y = $temp[2][0]; $sl->position_z = $temp[3][0]; - secondlife_debug("SL: " . print_r($sl, TRUE) . "\n", FILE_APPEND); + secondlife_debug("SL: ". print_r($sl, TRUE). "\n", FILE_APPEND); return $sl; } @@ -194,7 +194,7 @@ function secondlife_get_session() { */ function secondlife_parse_args($arg) { $args = array(); - foreach(explode(variable_get('secondlife_args_separator', ':'), $arg) as $pair) { + foreach (explode(variable_get('secondlife_args_separator', ':'), $arg) as $pair) { list($key, $value) = explode('=', $pair); $args[$key] = $value; secondlife_debug("ARGS: $key=$value"); @@ -209,14 +209,14 @@ function secondlife_send_response(&$sl) $sl->response['app'] = $sl->app; $sl->response['cmd'] = $sl->cmd; - foreach($sl->response as $key => $value) { + foreach ($sl->response as $key => $value) { secondlife_debug("RESPONSE: $key = $value"); } - switch($sl->output_type) { + switch ($sl->output_type) { default: case 'full': - foreach($sl->response as $key => $value) { + foreach ($sl->response as $key => $value) { print "$key=$value:"; } print "\n"; @@ -251,7 +251,7 @@ function secondlife_timer() { * Compute milliseconds. */ function _secondlife_getmillisecs() { - list($usec, $sec) = explode (' ', microtime()); + list($usec, $sec) = explode(' ', microtime()); return (double) $sec + $usec; } @@ -277,14 +277,14 @@ function secondlife_netmatch($network, $ */ function secondlife_get_data_between($src, $left, $right) { // function to return the data between two tokens (VERY USEFUL) - $ids = stripos($src,$left) + strlen($left); - if($ids === false) return false; - $ide = stripos($src,$right,$ids); - if($ide === false) return false; - return(substr($src,$ids,$ide - $ids)); + $ids = stripos($src, $left) + strlen($left); + if ($ids === false) return false; + $ide = stripos($src, $right, $ids); + if ($ide === false) return false; + return(substr($src, $ids, $ide - $ids)); } -function secondlife_rpc ($channel, $intVal, $stringVal) { +function secondlife_rpc($channel, $intVal, $stringVal) { // function to emulate xml-rpc for SL remote data connections // encapsulate request data in xml $xml = " @@ -306,15 +306,15 @@ function secondlife_rpc ($channel, $intV fputs($socket, $xml); // read response from rpc server - while(!feof($socket)) $response .= fgets($socket); + while (!feof($socket)) $response .= fgets($socket); // close the connection fclose($socket); // parse out the returned data - $sVal = secondlife_get_data_between($response, 'StringValue',''); - $iVal = secondlife_get_data_between($response, '',''); + $s_val = secondlife_get_data_between($response, 'StringValue',''); + $i_val = secondlife_get_data_between($response, '',''); // return the response data in an array - return array('channel' => $channel, 'string' => $sVal, 'integer' => $iVal); + return array('channel' => $channel, 'string' => $s_val, 'integer' => $i_val); }