Skip to content
Snippets Groups Projects
Commit 62bd990d authored by Aastha Mehta's avatar Aastha Mehta
Browse files

sensible spacing and indentations in code

parent 6623b041
No related branches found
No related tags found
No related merge requests found
...@@ -82,9 +82,9 @@ class MediaWiki { ...@@ -82,9 +82,9 @@ class MediaWiki {
if ( isset($wgSMEEnabled) && isset($wgSMEEnforcement) if ( isset($wgSMEEnabled) && isset($wgSMEEnforcement)
&& $wgSMEEnabled == 1 && $wgSMEEnforcement == 1 ) { && $wgSMEEnabled == 1 && $wgSMEEnforcement == 1 ) {
$pub_input = array(); $pub_input = array();
if ( $action != ''){ if ( $action != '' ) {
$pub_input = array($action.',unlogged'); $pub_input = array($action.',unlogged');
} else{ } else {
$pub_input = array('view,unlogged'); $pub_input = array('view,unlogged');
} }
$priv_input = array($title); $priv_input = array($title);
......
...@@ -145,10 +145,9 @@ class DatabaseMysqli extends DatabaseMysqlBase { ...@@ -145,10 +145,9 @@ class DatabaseMysqli extends DatabaseMysqlBase {
global $wgSMEEnabled, $wgSMEEnforcement; global $wgSMEEnabled, $wgSMEEnforcement;
global $public_input_hash; global $public_input_hash;
global $private_input_hash; global $private_input_hash;
if ( isset($wgSMEEnabled) && isset($wgSMEEnforcement) && isset($wgSMEMultiTier) if (isset($wgSMEEnabled) && isset($wgSMEEnforcement) && isset($wgSMEMultiTier)
&& $wgSMEEnabled == 1 && $wgSMEEnforcement == 1 && $wgSMEMultiTier == 1) { && $wgSMEEnabled == 1 && $wgSMEEnforcement == 1 && $wgSMEMultiTier == 1) {
sendBackendProfileToKernel($public_input_hash, $private_input_hash, sendBackendProfileToKernel($public_input_hash, $private_input_hash, $mysqli);
$mysqli);
} }
return $mysqli; return $mysqli;
} }
......
...@@ -929,11 +929,11 @@ function sendProfileToKernel($pubhash, $privhash) ...@@ -929,11 +929,11 @@ function sendProfileToKernel($pubhash, $privhash)
$server_ip, $server_port, $server_ip, $server_port, $server_ip, $server_port, $server_ip, $server_port,
$client_ip, $client_port, $num_pub, $num_priv, $pubhash, $privhash); $client_ip, $client_port, $num_pub, $num_priv, $pubhash, $privhash);
if (isset($wgSMEIOCTL) && $wgSMEIOCTL){ if (isset($wgSMEIOCTL) && $wgSMEIOCTL) {
#echo "Opening IOCTL $wgSMEioctlDEV: "; #echo "Opening IOCTL $wgSMEioctlDEV: ";
$SME_MARKER_SOCK_OR_CTL = dev_open($wgSMEioctlDEV); $SME_MARKER_SOCK_OR_CTL = dev_open($wgSMEioctlDEV);
#echo $SME_MARKER_SOCK_OR_CTL; #echo $SME_MARKER_SOCK_OR_CTL;
}else{ } else {
$SME_MARKER_SOCK_OR_CTL = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); $SME_MARKER_SOCK_OR_CTL = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
} }
/* /*
...@@ -945,29 +945,28 @@ function sendProfileToKernel($pubhash, $privhash) ...@@ -945,29 +945,28 @@ function sendProfileToKernel($pubhash, $privhash)
#apache_note('SME_START_TIME', $_SERVER['REQUEST_TIME_FLOAT']); #apache_note('SME_START_TIME', $_SERVER['REQUEST_TIME_FLOAT']);
*/ */
if (isset($wgSMEIOCTL) && $wgSMEIOCTL){ if (isset($wgSMEIOCTL) && $wgSMEIOCTL) {
#echo "\nUsing IOCTL: "; #echo "\nUsing IOCTL: ";
$ret = dev_ioctl($SME_MARKER_SOCK_OR_CTL, 0, $pbuf, $plen); $ret = dev_ioctl($SME_MARKER_SOCK_OR_CTL, 0, $pbuf, $plen);
#echo $ret; #echo $ret;
}else{ } else {
#echo "Not Using IOCTL"; #echo "Not Using IOCTL";
$ret = socket_sendto($SME_MARKER_SOCK_OR_CTL, $pbuf, $plen, 0, $ret = socket_sendto($SME_MARKER_SOCK_OR_CTL, $pbuf, $plen, 0,
$dummy_server_ip, $dummy_server_port); $dummy_server_ip, $dummy_server_port);
} }
} }
catch (Exception $e) { catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n"; echo 'Caught exception: ', $e->getMessage(), "\n";
} }
finally { finally {
if(isset($wgSMEMultiTier) && $wgSMEMultiTier == 0){ if (isset($wgSMEMultiTier) && $wgSMEMultiTier == 0) {
if (isset($wgSMEIOCTL) && $wgSMEIOCTL){ if (isset($wgSMEIOCTL) && $wgSMEIOCTL) {
dev_close($SME_MARKER_SOCK_OR_CTL); dev_close($SME_MARKER_SOCK_OR_CTL);
#echo "closing ioctl dev"; #echo "closing ioctl dev";
}else{ } else {
#echo "closing socket"; #echo "closing socket";
socket_close($SME_MARKER_SOCK_OR_CTL); socket_close($SME_MARKER_SOCK_OR_CTL);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment