Passed
Push — master ( b09af4...4abb06 )
by Patrick
02:35
created
application/controllers/SettingsController.php 1 patch
Braces   +16 added lines, -15 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
               $this->Config()->saveIni();
53 53
               $this->view->configErrorDetected='Configuration is empty : you can run install script with parameters (see Automatic installation below)';
54 54
               //$emptyConfig=1;
55
-          }
56
-          catch (Exception $e)
55
+          } catch (Exception $e)
57 56
           {
58 57
               $this->view->configErrorDetected=$e->getMessage();
59 58
           }
@@ -141,8 +140,7 @@  discard block
 block discarded – undo
141 140
               $this->view->apimessage='API config : ' . $e->getMessage();
142 141
               $this->view->apimessageError=true;
143 142
           }
144
-      }
145
-      else
143
+      } else
146 144
       {
147 145
           $this->view->apimessage='API parameters not configured';
148 146
           $this->view->apimessageError=true;
@@ -208,7 +206,9 @@  discard block
 block discarded – undo
208 206
           $input="154865134987aaaa";
209 207
           exec("$phpBin -r \"echo '$input';\"",$output,$retCode);
210 208
           
211
-          if (! isset($output[0])) $output[0]="NO OUT";
209
+          if (! isset($output[0])) {
210
+          	$output[0]="NO OUT";
211
+          }
212 212
           
213 213
           if ($retCode == 0 && preg_match("/$input/",$output[0]) == 1)
214 214
           {
@@ -310,8 +310,7 @@  discard block
 block discarded – undo
310 310
 	    $this->getUIDatabase()->testGetDb(); // Get DB in test mode
311 311
 	    printf('Schema already exists');
312 312
 	    
313
-	} 
314
-	catch (DBException $e) 
313
+	} catch (DBException $e) 
315 314
 	{
316 315
 
317 316
 		printf('Creating schema : <br>');
@@ -367,8 +366,7 @@  discard block
 block discarded – undo
367 366
           $this->getUIDatabase()->testGetDb(); // Get DB in test mode
368 367
           echo 'Schema already exists and is up to date<br>';
369 368
           return;
370
-      }
371
-      catch (DBException $e)
369
+      } catch (DBException $e)
372 370
       {
373 371
           $dberror=$e->getArray(); 
374 372
       }
@@ -435,12 +433,15 @@  discard block
 block discarded – undo
435 433
       }
436 434
       // Assume there is only one line... TODO : see if there is a better way to do this
437 435
       $line = preg_replace('/^.*snmptrapd /','',$psOutput[0]);
438
-      if (!preg_match('/-n/',$line))
439
-          return array(1,'snmptrapd has no -n option : '.$line);
440
-      if (!preg_match('/-O[^ ]*n/',$line))
441
-          return array(1,'snmptrapd has no -On option : '.$line);
442
-      if (!preg_match('/-O[^ ]*e/',$line))
443
-          return array(1,'snmptrapd has no -Oe option : '.$line);
436
+      if (!preg_match('/-n/',$line)) {
437
+                return array(1,'snmptrapd has no -n option : '.$line);
438
+      }
439
+      if (!preg_match('/-O[^ ]*n/',$line)) {
440
+                return array(1,'snmptrapd has no -On option : '.$line);
441
+      }
442
+      if (!preg_match('/-O[^ ]*e/',$line)) {
443
+                return array(1,'snmptrapd has no -Oe option : '.$line);
444
+      }
444 445
       
445 446
       return array(0,'snmptrapd listening to UDP/162, options : '.$line);
446 447
   }
Please login to merge, or discard this patch.