Passed
Push — master ( 59cfc2...308d00 )
by Stefan
06:28
created
core/SanityTests.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $this->test_result = [];
121 121
         $this->test_result['global'] = 0;
122 122
         // parse the schema file to find out the number of expected rows...
123
-        $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql");
123
+        $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql");
124 124
         $this->profileOptionCount = 0;
125 125
         $passedTheWindmill = FALSE;
126 126
         foreach ($schema as $schemaLine) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     public function runTest($test) {
147 147
         $this->out[$test] = [];
148 148
         $this->name = $test;
149
-        $m_name = 'test' . $test;
149
+        $m_name = 'test'.$test;
150 150
         $this->test_result[$test] = 0;
151 151
         if (!method_exists($this, $m_name)) {
152 152
             $this->storeTestResult(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>.");
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                 $matchArray = [];
235 235
                 preg_match('/([^ ]+) ?/', $config['PATHS'][$pathToCheck], $matchArray);
236 236
                 $exe = $matchArray[1];
237
-                $the_path = exec("which " . $config['PATHS'][$pathToCheck]);
237
+                $the_path = exec("which ".$config['PATHS'][$pathToCheck]);
238 238
                 if ($the_path == $exe) {
239 239
                     $exec_is = "EXPLICIT";
240 240
                 } else {
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
      */
254 254
     private function testPhp() {
255 255
         if (version_compare(phpversion(), $this->needversionPHP, '>=')) {
256
-            $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . ".");
256
+            $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion().".");
257 257
         } else {
258
-            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have " . phpversion() . ".");
258
+            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have ".phpversion().".");
259 259
         }
260 260
     }
261 261
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
             $this->storeTestResult(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly");
272 272
         } else {
273 273
             $rootFromScript = $m[1] === '' ? '/' : $m[1];
274
-            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . \config\Master::CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>");
274
+            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".\config\Master::CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>");
275 275
         }
276 276
     }
277 277
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         if (count($probeReturns) == 0) {
292 292
             $this->storeTestResult(common\Entity::L_OK, "All configured RADIUS/UDP probes are reachable.");
293 293
         } else {
294
-            $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ',$probeReturns));
294
+            $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ', $probeReturns));
295 295
         }
296 296
     }
297 297
 
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
             $SSPconfig = \SimpleSAML\Configuration::getInstance();
309 309
             $sspVersion = explode('.', $SSPconfig->getVersion());
310 310
             if ((int) $sspVersion[0] >= $this->needversionSSP['major'] && (int) $sspVersion[1] >= $this->needversionSSP['minor']) {
311
-                $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion));
311
+                $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion));
312 312
             } else {
313
-                $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->needversionSSP));
313
+                $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->needversionSSP));
314 314
             }
315 315
         }
316 316
     }
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
      * @return void
365 365
      */
366 366
     private function testLogdir() {
367
-        if (fopen(\config\Master::CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) {
368
-            $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>" . \config\Master::CONFIG['PATHS']['logdir'] . "</strong> are not writable!");
367
+        if (fopen(\config\Master::CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) {
368
+            $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>".\config\Master::CONFIG['PATHS']['logdir']."</strong> are not writable!");
369 369
         } else {
370 370
             $this->storeTestResult(\core\common\Entity::L_OK, "Log directory is writable.");
371 371
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
     private function testOpenssl() {
490 490
         $A = $this->getExecPath('openssl');
491 491
         if ($A['exec'] != "") {
492
-            $t = exec($A['exec'] . ' version');
492
+            $t = exec($A['exec'].' version');
493 493
             if ($A['exec_is'] == "EXPLICIT") {
494 494
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config.");
495 495
             } else {
@@ -516,14 +516,14 @@  discard block
 block discarded – undo
516 516
         }
517 517
         $A = $this->getExecPath('makensis');
518 518
         if ($A['exec'] != "") {
519
-            $t = exec($A['exec'] . ' -VERSION');
519
+            $t = exec($A['exec'].' -VERSION');
520 520
             if ($A['exec_is'] == "EXPLICIT") {
521 521
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config.");
522 522
             } else {
523 523
                 $this->storeTestResult(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config.");
524 524
             }
525 525
             $outputArray = [];
526
-            exec($A['exec'] . ' -HELP', $outputArray);
526
+            exec($A['exec'].' -HELP', $outputArray);
527 527
             $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray));
528 528
             if ($t1 == 1 && \config\ConfAssistant::CONFIG['NSIS_VERSION'] == 2) {
529 529
                 $this->storeTestResult(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!");
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
         $NSIS_Module_status = [];
553 553
         foreach ($this->NSISModules as $module) {
554 554
             unset($out);
555
-            exec(\config\ConfAssistant::CONFIG['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
555
+            exec(\config\ConfAssistant::CONFIG['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
556 556
             if ($retval > 0) {
557 557
                 $NSIS_Module_status[$module] = 0;
558 558
             } else {
@@ -615,8 +615,8 @@  discard block
 block discarded – undo
615 615
         $locales = shell_exec("locale -a");
616 616
         $allthere = "";
617 617
         foreach (\config\Master::CONFIG['LANGUAGES'] as $onelanguage) {
618
-            if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) {
619
-                $allthere .= $onelanguage['locale'] . " ";
618
+            if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) {
619
+                $allthere .= $onelanguage['locale']." ";
620 620
             }
621 621
         }
622 622
         if ($allthere == "") {
@@ -630,47 +630,47 @@  discard block
 block discarded – undo
630 630
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['from-mail'],
631 631
             "DEFVALUE" => "[email protected]",
632 632
             "COMPLAINTSTRING" => "APPEARANCE/from-mail ",
633
-            "REQUIRED" => FALSE,],
633
+            "REQUIRED" => FALSE, ],
634 634
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['support-contact']['url'],
635 635
             "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!",
636 636
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ",
637
-            "REQUIRED" => FALSE,],
637
+            "REQUIRED" => FALSE, ],
638 638
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['support-contact']['display'],
639 639
             "DEFVALUE" => "[email protected]",
640 640
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ",
641
-            "REQUIRED" => FALSE,],
641
+            "REQUIRED" => FALSE, ],
642 642
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['support-contact']['developer-mail'],
643 643
             "DEFVALUE" => "[email protected]",
644 644
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ",
645
-            "REQUIRED" => FALSE,],
645
+            "REQUIRED" => FALSE, ],
646 646
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['abuse-mail'],
647 647
             "DEFVALUE" => "[email protected]",
648 648
             "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ",
649
-            "REQUIRED" => FALSE,],
649
+            "REQUIRED" => FALSE, ],
650 650
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['MOTD'],
651 651
             "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!",
652 652
             "COMPLAINTSTRING" => "APPEARANCE/MOTD ",
653
-            "REQUIRED" => FALSE,],
653
+            "REQUIRED" => FALSE, ],
654 654
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['webcert_CRLDP'],
655 655
             "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'],
656 656
             "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ",
657
-            "REQUIRED" => TRUE,],
657
+            "REQUIRED" => TRUE, ],
658 658
         ["SETTING" => \config\Master::CONFIG['APPEARANCE']['webcert_OCSP'],
659 659
             "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'],
660 660
             "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ",
661
-            "REQUIRED" => TRUE,],
661
+            "REQUIRED" => TRUE, ],
662 662
         ["SETTING" => \config\Master::CONFIG['DB']['INST']['host'],
663 663
             "DEFVALUE" => "db.host.example",
664 664
             "COMPLAINTSTRING" => "DB/INST ",
665
-            "REQUIRED" => TRUE,],
665
+            "REQUIRED" => TRUE, ],
666 666
         ["SETTING" => \config\Master::CONFIG['DB']['INST']['host'],
667 667
             "DEFVALUE" => "db.host.example",
668 668
             "COMPLAINTSTRING" => "DB/USER ",
669
-            "REQUIRED" => TRUE,],
669
+            "REQUIRED" => TRUE, ],
670 670
         ["SETTING" => \config\Master::CONFIG['DB']['EXTERNAL']['host'],
671 671
             "DEFVALUE" => "customerdb.otherhost.example",
672 672
             "COMPLAINTSTRING" => "DB/EXTERNAL ",
673
-            "REQUIRED" => FALSE,],
673
+            "REQUIRED" => FALSE, ],
674 674
     ];
675 675
 
676 676
     /**
@@ -696,11 +696,11 @@  discard block
 block discarded – undo
696 696
 
697 697
         foreach (\config\Diagnostics::CONFIG['RADIUSTESTS']['TLS-clientcerts'] as $cadata) {
698 698
             foreach ($cadata['certificates'] as $cert_files) {
699
-                if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) {
700
-                    $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " ";
699
+                if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) {
700
+                    $defaultvalues .= "CERTIFICATE/".$cert_files['public']." ";
701 701
                 }
702
-                if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) {
703
-                    $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " ";
702
+                if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) {
703
+                    $defaultvalues .= "CERTIFICATE/".$cert_files['private']." ";
704 704
                 }
705 705
             }
706 706
         }
@@ -790,14 +790,14 @@  discard block
 block discarded – undo
790 790
         if ($global_no_cache) {
791 791
             foreach ($Devs as $dev => $D) {
792 792
                 if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) {
793
-                    $no_cache_dev .= $dev . " ";
793
+                    $no_cache_dev .= $dev." ";
794 794
                     $no_cache_dev_count++;
795 795
                 }
796 796
             }
797 797
         } else {
798 798
             foreach ($Devs as $dev => $D) {
799 799
                 if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) {
800
-                    $no_cache_dev .= $dev . " ";
800
+                    $no_cache_dev .= $dev." ";
801 801
                     $no_cache_dev_count++;
802 802
                 }
803 803
             }
@@ -835,13 +835,13 @@  discard block
 block discarded – undo
835 835
         $mail->isHTML(FALSE);
836 836
         $mail->CharSet = 'UTF-8';
837 837
         $mail->From = \config\Master::CONFIG['APPEARANCE']['from-mail'];
838
-        $mail->FromName = \config\Master::CONFIG['APPEARANCE']['productname'] . " Invitation System";
838
+        $mail->FromName = \config\Master::CONFIG['APPEARANCE']['productname']." Invitation System";
839 839
         $mail->addAddress(\config\Master::CONFIG['APPEARANCE']['abuse-mail']);
840 840
         $mail->Subject = "testing CAT configuration mail";
841 841
         $mail->Body = "Testing CAT mailing\n";
842 842
         $sent = $mail->send();
843 843
         if ($sent) {
844
-            $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . \config\Master::CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced.");
844
+            $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".\config\Master::CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced.");
845 845
         } else {
846 846
             $this->storeTestResult(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS");
847 847
         }
Please login to merge, or discard this patch.