Passed
Push — master ( a2c24b...6427d5 )
by Nikolay
12:54 queued 08:08
created
src/Core/System/Storage.php 2 patches
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
     public static function isStorageDisk($device): bool
74 74
     {
75 75
         $result = false;
76
-        if ( ! file_exists("{$device}")) {
76
+        if (!file_exists("{$device}")) {
77 77
             return $result;
78 78
         }
79 79
 
80
-        $tmp_dir = '/tmp/mnt_' . time();
80
+        $tmp_dir = '/tmp/mnt_'.time();
81 81
         Util::mwMkdir($tmp_dir);
82 82
         $out = [];
83 83
 
84 84
         $storage  = new Storage();
85
-        $uid_part = 'UUID=' . $storage->getUuid($device) . '';
85
+        $uid_part = 'UUID='.$storage->getUuid($device).'';
86 86
         $format   = $storage->getFsType($device);
87 87
         if ($format === '') {
88 88
             return false;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             Util::mwExec("{$umountPath} {$device}");
102 102
         }
103 103
 
104
-        if ( ! self::isStorageDiskMounted($device)) {
104
+        if (!self::isStorageDiskMounted($device)) {
105 105
             Util::mwExec("{$rmPath} -rf '{$tmp_dir}'");
106 106
         }
107 107
 
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
         $timeoutPath = Util::which('timeout');
232 232
         $sshfsPath   = Util::which('sshfs');
233 233
 
234
-        $command = "{$timeoutPath} -t 3 {$sshfsPath} -p {$port} -o nonempty -o password_stdin -o 'StrictHostKeyChecking=no' " .
235
-            "{$user}@{$host}:{$remout_dir} {$local_dir} << EOF\n" .
236
-            "{$pass}\n" .
234
+        $command = "{$timeoutPath} -t 3 {$sshfsPath} -p {$port} -o nonempty -o password_stdin -o 'StrictHostKeyChecking=no' ".
235
+            "{$user}@{$host}:{$remout_dir} {$local_dir} << EOF\n".
236
+            "{$pass}\n".
237 237
             "EOF\n";
238 238
         // file_put_contents('/tmp/sshfs_'.$host, $command);
239 239
         Util::mwExec($command, $out);
@@ -265,19 +265,19 @@  discard block
 block discarded – undo
265 265
 
266 266
         // Собираем строку подключения к ftp.
267 267
         $auth_line = '';
268
-        if ( ! empty($user)) {
269
-            $auth_line .= 'user="' . $user;
270
-            if ( ! empty($pass)) {
268
+        if (!empty($user)) {
269
+            $auth_line .= 'user="'.$user;
270
+            if (!empty($pass)) {
271 271
                 $auth_line .= ":{$pass}";
272 272
             }
273 273
             $auth_line .= '",';
274 274
         }
275 275
 
276
-        $connect_line = 'ftp://' . $host;
277
-        if ( ! empty($port)) {
276
+        $connect_line = 'ftp://'.$host;
277
+        if (!empty($port)) {
278 278
             $connect_line .= ":{$port}";
279 279
         }
280
-        if ( ! empty($remout_dir)) {
280
+        if (!empty($remout_dir)) {
281 281
             $connect_line .= "$remout_dir";
282 282
         }
283 283
 
@@ -303,10 +303,10 @@  discard block
 block discarded – undo
303 303
      */
304 304
     public static function mkfs_disk($dev)
305 305
     {
306
-        if ( ! file_exists($dev)) {
306
+        if (!file_exists($dev)) {
307 307
             $dev = "/dev/{$dev}";
308 308
         }
309
-        if ( ! file_exists($dev)) {
309
+        if (!file_exists($dev)) {
310 310
             return false;
311 311
         }
312 312
         $dir = '';
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
             Util::mwExec("/sbin/shell_functions.sh 'killprocesses' '$dir' -TERM 0");
342 342
             Util::mwExec("{$umountPath} {$dir}");
343 343
         }
344
-        $result = ! self::isStorageDiskMounted($dir);
344
+        $result = !self::isStorageDiskMounted($dir);
345 345
         if ($result && file_exists($dir)) {
346 346
             // Если диск не смонтирован, то удаляем каталог.
347 347
             Util::mwExec("{$rmPath} -rf '{$dir}'");
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      */
412 412
     public static function statusMkfs($dev): string
413 413
     {
414
-        if ( ! file_exists($dev)) {
414
+        if (!file_exists($dev)) {
415 415
             $dev = "/dev/{$dev}";
416 416
         }
417 417
         $out      = [];
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         }
435 435
         $config        = $di->getShared('config');
436 436
         $phpSessionDir = $config->path('www.phpSessionDir');
437
-        if ( ! empty($phpSessionDir)) {
437
+        if (!empty($phpSessionDir)) {
438 438
             $rmPath = Util::which('rm');
439 439
             Util::mwExec("{$rmPath} -rf {$phpSessionDir}/*");
440 440
         }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         // Создание больщого файла для тестов.
451 451
         // head -c 1500MB /dev/urandom > /storage/usbdisk1/big_file.mp3
452 452
         foreach ($hdd as $disk) {
453
-            if ($disk['sys_disk'] === true && ! self::isStorageDiskMounted("{$disk['id']}4")) {
453
+            if ($disk['sys_disk'] === true && !self::isStorageDiskMounted("{$disk['id']}4")) {
454 454
                 // Это системный диск (4ый раздел). Он не смонтирован.
455 455
                 continue;
456 456
             }
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 Util::processPHPWorker(WorkerRemoveOldRecords::class);
475 475
             }
476 476
 
477
-            if ( ! $need_alert) {
477
+            if (!$need_alert) {
478 478
                 continue;
479 479
             }
480 480
 
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
                 $m_size      = round(($disk_data[1] + $disk_data[2]) / 1024, 1);
515 515
                 $res_disks[] = [
516 516
                     'id'         => $disk_data[0],
517
-                    'size'       => "" . $m_size,
518
-                    'size_text'  => "" . $m_size . " Mb",
517
+                    'size'       => "".$m_size,
518
+                    'size_text'  => "".$m_size." Mb",
519 519
                     'vendor'     => 'Debian',
520 520
                     'mounted'    => '/storage/usbdisk1',
521 521
                     'free_space' => round($disk_data[2] / 1024, 1),
@@ -537,8 +537,8 @@  discard block
 block discarded – undo
537 537
 
538 538
         $cf_disk   = '';
539 539
         $varEtcDir = $this->config->path('core.varEtcDir');
540
-        if (file_exists($varEtcDir . '/cfdevice')) {
541
-            $cf_disk = trim(file_get_contents($varEtcDir . '/cfdevice'));
540
+        if (file_exists($varEtcDir.'/cfdevice')) {
541
+            $cf_disk = trim(file_get_contents($varEtcDir.'/cfdevice'));
542 542
         }
543 543
 
544 544
         foreach ($disks as $disk) {
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
             $sys_disk = ($cf_disk == $disk);
555 555
 
556 556
             $mb_size = 0;
557
-            if (is_file("/sys/block/" . $disk . "/size")) {
558
-                $original_size = trim(file_get_contents("/sys/block/" . $disk . "/size"));
557
+            if (is_file("/sys/block/".$disk."/size")) {
558
+                $original_size = trim(file_get_contents("/sys/block/".$disk."/size"));
559 559
                 $original_size = ($original_size * 512 / 1024 / 1024);
560 560
                 $mb_size       = $original_size;
561 561
             }
@@ -662,14 +662,14 @@  discard block
 block discarded – undo
662 662
     private function getVendorDisk($disk): string
663 663
     {
664 664
         $temp_vendor = [];
665
-        if (is_file("/sys/block/" . $disk . "/device/vendor")) {
666
-            $data = trim(file_get_contents("/sys/block/" . $disk . "/device/vendor"));
665
+        if (is_file("/sys/block/".$disk."/device/vendor")) {
666
+            $data = trim(file_get_contents("/sys/block/".$disk."/device/vendor"));
667 667
             if ($data != '') {
668 668
                 $temp_vendor[] = trim(str_replace(',', ' ', $data));
669 669
             }
670 670
         }
671
-        if (is_file("/sys/block/" . $disk . "/device/model")) {
672
-            $data = trim(file_get_contents("/sys/block/" . $disk . "/device/model"));
671
+        if (is_file("/sys/block/".$disk."/device/model")) {
672
+            $data = trim(file_get_contents("/sys/block/".$disk."/device/model"));
673 673
             if ($data != '') {
674 674
                 $temp_vendor[] = trim(str_replace(',', ' ', $data));
675 675
             }
@@ -677,8 +677,8 @@  discard block
 block discarded – undo
677 677
         if (count($temp_vendor) == 0) {
678 678
             $temp_vendor[] = $disk;
679 679
         }
680
-        if (is_file("/sys/block/" . $disk . "/device/type")) {
681
-            $data = trim(file_get_contents("/sys/block/" . $disk . "/device/type"));
680
+        if (is_file("/sys/block/".$disk."/device/type")) {
681
+            $data = trim(file_get_contents("/sys/block/".$disk."/device/type"));
682 682
             if ($data != '') {
683 683
                 $temp_vendor[] = trim(str_replace(',', ' ', $data));
684 684
             }
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
         Util::mwExec("{$dfPath} -m | {$grepPath} {$hdd} | {$awkPath} '{print $4}'", $out);
705 705
         $result = 0;
706 706
         foreach ($out as $res) {
707
-            if ( ! is_numeric($res)) {
707
+            if (!is_numeric($res)) {
708 708
                 continue;
709 709
             }
710 710
             $result += (1 * $res);
@@ -741,19 +741,19 @@  discard block
 block discarded – undo
741 741
                 $path_size_info = $tmp_path;
742 742
             }
743 743
             if (empty($path_size_info)) {
744
-                $tmp_path = "/sys/block/" . substr($dev, 0, 3) . "/{$dev}/size";
744
+                $tmp_path = "/sys/block/".substr($dev, 0, 3)."/{$dev}/size";
745 745
                 if (file_exists($tmp_path)) {
746 746
                     $path_size_info = $tmp_path;
747 747
                 }
748 748
             }
749 749
 
750
-            if ( ! empty($path_size_info)) {
750
+            if (!empty($path_size_info)) {
751 751
                 $original_size = trim(file_get_contents($path_size_info));
752 752
                 $original_size = ($original_size * 512 / 1024 / 1024);
753 753
                 $mb_size       = $original_size;
754 754
             }
755 755
 
756
-            $tmp_dir = "/tmp/{$dev}_" . time();
756
+            $tmp_dir = "/tmp/{$dev}_".time();
757 757
             $out     = [];
758 758
 
759 759
             $fs           = null;
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
         }
811 811
         Util::mwMkdir($dir);
812 812
 
813
-        if ( ! file_exists($dir)) {
813
+        if (!file_exists($dir)) {
814 814
             Util::sysLogMsg('Storage', "Unable mount $dev $format to $dir. Unable create dir.");
815 815
 
816 816
             return false;
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
             Util::mwExec("{$mountNtfs3gPath} /dev/{$dev} {$dir}", $out);
822 822
         } else {
823 823
             $storage   = new Storage();
824
-            $uid_part  = 'UUID=' . $storage->getUuid("/dev/{$dev}") . '';
824
+            $uid_part  = 'UUID='.$storage->getUuid("/dev/{$dev}").'';
825 825
             $mountPath = Util::which('mount');
826 826
             Util::mwExec("{$mountPath} -t {$format} {$uid_part} {$dir}", $out);
827 827
         }
@@ -841,8 +841,8 @@  discard block
 block discarded – undo
841 841
             unlink($storage_dev_file);
842 842
         }
843 843
 
844
-        if (file_exists($varEtcDir . '/cfdevice')) {
845
-            $cf_disk = trim(file_get_contents($varEtcDir . '/cfdevice'));
844
+        if (file_exists($varEtcDir.'/cfdevice')) {
845
+            $cf_disk = trim(file_get_contents($varEtcDir.'/cfdevice'));
846 846
         }
847 847
 
848 848
         $disks = $this->getDiskSettings();
@@ -856,18 +856,18 @@  discard block
 block discarded – undo
856 856
                 // Если это системный диск, то пытаемся подключить раздел 4.
857 857
                 $dev = "{$disk['device']}4";
858 858
             }
859
-            if ( ! $this->hddExists($dev)) {
859
+            if (!$this->hddExists($dev)) {
860 860
                 // Диск не существует.
861 861
                 continue;
862 862
             }
863
-            if ($disk['media'] === '1' || ! file_exists($storage_dev_file)) {
863
+            if ($disk['media'] === '1' || !file_exists($storage_dev_file)) {
864 864
                 file_put_contents($storage_dev_file, "/storage/usbdisk{$disk['id']}");
865 865
                 $this->updateConfigWithNewMountPoint("/storage/usbdisk{$disk['id']}");
866 866
             }
867 867
 
868
-            $str_uid     = 'UUID=' . $this->getUuid($dev) . '';
868
+            $str_uid     = 'UUID='.$this->getUuid($dev).'';
869 869
             $format_p4   = $this->getFsType($dev);
870
-            $conf        .= "{$str_uid} /storage/usbdisk{$disk['id']} {$format_p4} async,rw 0 0\n";
870
+            $conf .= "{$str_uid} /storage/usbdisk{$disk['id']} {$format_p4} async,rw 0 0\n";
871 871
             $mount_point = "/storage/usbdisk{$disk['id']}";
872 872
             Util::mwMkdir($mount_point);
873 873
         }
@@ -979,11 +979,11 @@  discard block
 block discarded – undo
979 979
         Util::mwMkdir('/storage');
980 980
         $chmodPath = Util::which('chmod');
981 981
         Util::mwExec("{$chmodPath} 755 /storage");
982
-        if ( ! file_exists($varEtcDir . '/cfdevice')) {
982
+        if (!file_exists($varEtcDir.'/cfdevice')) {
983 983
             return;
984 984
         }
985 985
         $fstab     = '';
986
-        $file_data = file_get_contents($varEtcDir . '/cfdevice');
986
+        $file_data = file_get_contents($varEtcDir.'/cfdevice');
987 987
         $cf_disk   = trim($file_data);
988 988
         if ('' == $cf_disk) {
989 989
             return;
@@ -993,9 +993,9 @@  discard block
 block discarded – undo
993 993
         $part3 = (strpos($cf_disk, 'mmcblk') !== false) ? "{$cf_disk}p3" : "{$cf_disk}3"; // Conf
994 994
 
995 995
 
996
-        $uid_part2 = 'UUID=' . $this->getUuid("/dev/{$part2}") . '';
996
+        $uid_part2 = 'UUID='.$this->getUuid("/dev/{$part2}").'';
997 997
         $format_p2 = $this->getFsType($part2);
998
-        $uid_part3 = 'UUID=' . $this->getUuid("/dev/{$part3}") . '';
998
+        $uid_part3 = 'UUID='.$this->getUuid("/dev/{$part3}").'';
999 999
         $format_p3 = $this->getFsType($part3);
1000 1000
 
1001 1001
         // $fstab .= "/dev/{$part1} /cf msdos ro 1 1\n"; // НЕ МОНТИРУЕМ!
@@ -1040,12 +1040,12 @@  discard block
 block discarded – undo
1040 1040
             }
1041 1041
         }
1042 1042
 
1043
-        if ( ! empty($path)) {
1043
+        if (!empty($path)) {
1044 1044
             Util::mwMkdir($path);
1045 1045
         }
1046 1046
 
1047 1047
         $downloadCacheDir = appPath('sites/pbxcore/files/cache');
1048
-        if ( ! $isLiveCd) {
1048
+        if (!$isLiveCd) {
1049 1049
             Util::mwMkdir($downloadCacheDir);
1050 1050
             Util::createUpdateSymlink($this->config->path('www.downloadCacheDir'), $downloadCacheDir);
1051 1051
         }
@@ -1083,13 +1083,13 @@  discard block
 block discarded – undo
1083 1083
     public function createAssetsSymlinks(): void
1084 1084
     {
1085 1085
         $jsCacheDir = appPath('sites/admin-cabinet/assets/js/cache');
1086
-        Util::createUpdateSymlink($this->config->path('adminApplication.assetsCacheDir') . '/js', $jsCacheDir);
1086
+        Util::createUpdateSymlink($this->config->path('adminApplication.assetsCacheDir').'/js', $jsCacheDir);
1087 1087
 
1088 1088
         $cssCacheDir = appPath('sites/admin-cabinet/assets/css/cache');
1089
-        Util::createUpdateSymlink($this->config->path('adminApplication.assetsCacheDir') . '/css', $cssCacheDir);
1089
+        Util::createUpdateSymlink($this->config->path('adminApplication.assetsCacheDir').'/css', $cssCacheDir);
1090 1090
 
1091 1091
         $imgCacheDir = appPath('sites/admin-cabinet/assets/img/cache');
1092
-        Util::createUpdateSymlink($this->config->path('adminApplication.assetsCacheDir') . '/img', $imgCacheDir);
1092
+        Util::createUpdateSymlink($this->config->path('adminApplication.assetsCacheDir').'/img', $imgCacheDir);
1093 1093
     }
1094 1094
 
1095 1095
     /**
@@ -1102,13 +1102,13 @@  discard block
 block discarded – undo
1102 1102
         $cacheDirs[] = $this->config->path('www.downloadCacheDir');
1103 1103
         $cacheDirs[] = $this->config->path('www.managedCacheDir');
1104 1104
         $cacheDirs[] = $this->config->path('www.modelsCacheDir');
1105
-        $cacheDirs[] = $this->config->path('adminApplication.assetsCacheDir') . '/js';
1106
-        $cacheDirs[] = $this->config->path('adminApplication.assetsCacheDir') . '/css';
1107
-        $cacheDirs[] = $this->config->path('adminApplication.assetsCacheDir') . '/img';
1105
+        $cacheDirs[] = $this->config->path('adminApplication.assetsCacheDir').'/js';
1106
+        $cacheDirs[] = $this->config->path('adminApplication.assetsCacheDir').'/css';
1107
+        $cacheDirs[] = $this->config->path('adminApplication.assetsCacheDir').'/img';
1108 1108
         $cacheDirs[] = $this->config->path('adminApplication.voltCacheDir');
1109 1109
         $rmPath      = Util::which('rm');
1110 1110
         foreach ($cacheDirs as $cacheDir) {
1111
-            if ( ! empty($cacheDir)) {
1111
+            if (!empty($cacheDir)) {
1112 1112
                 Util::mwExec("{$rmPath} -rf {$cacheDir}/*");
1113 1113
             }
1114 1114
         }
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
         $countBlock = $swapSize * $bs;
1219 1219
         $ddCmd      = Util::which('dd');
1220 1220
 
1221
-        Util::sysLogMsg('Swap', 'make swap ' . $swapFile, LOG_INFO, LOG_INFO);
1221
+        Util::sysLogMsg('Swap', 'make swap '.$swapFile, LOG_INFO, LOG_INFO);
1222 1222
         Util::mwExec("{$ddCmd} if=/dev/zero of={$swapFile} bs={$bs} count={$countBlock}");
1223 1223
 
1224 1224
         $mkSwapCmd = Util::which('mkswap');
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 
1227 1227
         $swapOnCmd = Util::which('swapon');
1228 1228
         $result    = Util::mwExec("{$swapOnCmd} {$swapFile}");
1229
-        Util::sysLogMsg('Swap', 'connect swap result: ' . $result, LOG_INFO, LOG_INFO);
1229
+        Util::sysLogMsg('Swap', 'connect swap result: '.$result, LOG_INFO, LOG_INFO);
1230 1230
     }
1231 1231
 
1232 1232
     /**
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
         $size    = 0;
1240 1240
         $mntDir  = '';
1241 1241
         $mounted = self::isStorageDiskMounted('', $mntDir);
1242
-        if ( ! $mounted) {
1242
+        if (!$mounted) {
1243 1243
             return 0;
1244 1244
         }
1245 1245
         $hd = $this->getAllHdd(true);
@@ -1260,12 +1260,12 @@  discard block
 block discarded – undo
1260 1260
      */
1261 1261
     public function saveDiskSettings($data, $id = '1'): void
1262 1262
     {
1263
-        if ( ! is_array($data)) {
1263
+        if (!is_array($data)) {
1264 1264
             return;
1265 1265
         }
1266 1266
         $disk_data = $this->getDiskSettings($id);
1267 1267
         if (count($disk_data) === 0) {
1268
-            $uniqid           = strtoupper('STORAGE-DISK-' . md5(time()));
1268
+            $uniqid           = strtoupper('STORAGE-DISK-'.md5(time()));
1269 1269
             $storage_settings = new StorageModel();
1270 1270
             foreach ($data as $key => $val) {
1271 1271
                 $storage_settings->writeAttribute($key, $val);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -460,17 +460,17 @@
 block discarded – undo
460 460
             $test_alert = '';
461 461
             if ($free < 5) {
462 462
                 $need_alert = true;
463
-                $test_alert = "The {$disk['id']} has less than 5% of free space available.";
463
+                $test_alert = "the {$disk['id']} has less than 5% of free space available.";
464 464
             }
465 465
 
466 466
             if ($disk['free_space'] < 500) {
467 467
                 $need_alert = true;
468
-                $test_alert = "The {$disk['id']} has less than 500MB of free space available.";
468
+                $test_alert = "the {$disk['id']} has less than 500MB of free space available.";
469 469
             }
470 470
 
471 471
             if ($disk['free_space'] < 100) {
472 472
                 $need_alert = true;
473
-                $test_alert = "The {$disk['id']} has less than 100MB of free space available. Old call records will be deleted.";
473
+                $test_alert = "the {$disk['id']} has less than 100MB of free space available. Old call records will be deleted.";
474 474
                 Util::processPHPWorker(WorkerRemoveOldRecords::class);
475 475
             }
476 476
 
Please login to merge, or discard this patch.
src/AdminCabinet/Controllers/NetworkController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $internetInterface = LanInterfaces::findFirstByInternet('1');
38 38
         if ($internetInterface === null) {
39 39
             $internetInterface = new LanInterfaces();
40
-            $internetInterface->id     = 1;
40
+            $internetInterface->id = 1;
41 41
         }
42 42
 
43 43
         // We will find additional interfaces which we can delete
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function saveAction(): void
62 62
     {
63
-        if ( ! $this->request->isPost()) {
63
+        if (!$this->request->isPost()) {
64 64
             return;
65 65
         }
66 66
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
                 case 'extipaddr':
126 126
                     if ($itIsInternetInterfce) {
127 127
                         if (array_key_exists($name, $data)) {
128
-                            $eth->$name = ($data['usenat'] === 'on') ? $data[$name] : $data['ipaddr_' . $eth->id];
128
+                            $eth->$name = ($data['usenat'] === 'on') ? $data[$name] : $data['ipaddr_'.$eth->id];
129 129
                         } else {
130
-                            $eth->$name = $data['ipaddr_' . $eth->id];
130
+                            $eth->$name = $data['ipaddr_'.$eth->id];
131 131
                         }
132 132
                     } else {
133 133
                         $eth->$name = '';
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
                     }
147 147
                     break;
148 148
                 case 'dhcp':
149
-                    if (array_key_exists($name . '_' . $eth->id, $data)) {
150
-                        $eth->$name = ($data['dhcp_' . $eth->id]) === 'on' ? '1' : '0';
149
+                    if (array_key_exists($name.'_'.$eth->id, $data)) {
150
+                        $eth->$name = ($data['dhcp_'.$eth->id]) === 'on' ? '1' : '0';
151 151
                     }
152 152
                     break;
153 153
                 case 'internet':
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
                 case 'ipaddr':
157 157
                 case 'subnet':
158 158
                     $eth->$name = '';
159
-                    if (array_key_exists($name . '_' . $eth->id, $data)) {
160
-                        $eth->$name = ($data['dhcp_' . $eth->id]) === 'on' ? '' : $data[$name . '_' . $eth->id];
159
+                    if (array_key_exists($name.'_'.$eth->id, $data)) {
160
+                        $eth->$name = ($data['dhcp_'.$eth->id]) === 'on' ? '' : $data[$name.'_'.$eth->id];
161 161
                     }
162 162
                     break;
163 163
                 case 'interface':
164 164
                     if ($eth->id === 0) {
165
-                        $eth->$name = LanInterfaces::findFirstById($data[$name . '_' . $eth->id])->interface;
165
+                        $eth->$name = LanInterfaces::findFirstById($data[$name.'_'.$eth->id])->interface;
166 166
                     }
167 167
                     break;
168 168
                 case 'domain':
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
                     }
178 178
                     break;
179 179
                 default:
180
-                    if (array_key_exists($name . '_' . $eth->id, $data)) {
181
-                        $eth->$name = $data[$name . '_' . $eth->id];
180
+                    if (array_key_exists($name.'_'.$eth->id, $data)) {
181
+                        $eth->$name = $data[$name.'_'.$eth->id];
182 182
                     }
183 183
             }
184 184
         }
Please login to merge, or discard this patch.
src/Common/Providers/LicenseProvider.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@
 block discarded – undo
49 49
     {
50 50
         $di->setShared(
51 51
             self::SERVICE_NAME,
52
-            function () {
52
+            function() {
53 53
                 $provider = null;
54 54
                 try {
55
-                    $provider =  new License('http://127.0.0.1:8223');
56
-                } catch (Error $exception){
55
+                    $provider = new License('http://127.0.0.1:8223');
56
+                } catch (Error $exception) {
57 57
                     Util::sysLogMsg(__CLASS__, $exception);
58 58
                 }
59 59
                 return $provider;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,8 @@
 block discarded – undo
49 49
     {
50 50
         $di->setShared(
51 51
             self::SERVICE_NAME,
52
-            function () {
52
+            function ()
53
+            {
53 54
                 $provider = null;
54 55
                 try {
55 56
                     $provider =  new License('http://127.0.0.1:8223');
Please login to merge, or discard this patch.
src/PBXCoreREST/Workers/WorkerDownloader.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
         ini_set('memory_limit', '300M');
42 42
 
43 43
         $temp_dir            = dirname($this->settings['res_file']);
44
-        $this->progress_file = $temp_dir . '/progress';
45
-        $this->error_file    = $temp_dir . '/error';
44
+        $this->progress_file = $temp_dir.'/progress';
45
+        $this->error_file    = $temp_dir.'/error';
46 46
 
47 47
         $result = $this->getFile();
48 48
         $result = $result && $this->checkFile();
49
-        if ( ! $result) {
49
+        if (!$result) {
50 50
             Util::sysLogMsg(__CLASS__, 'Download error...');
51 51
         }
52 52
     }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         if (file_exists($this->settings['res_file'])) {
63 63
             unlink($this->settings['res_file']);
64 64
         }
65
-        if (isset($this->settings['size'])){
65
+        if (isset($this->settings['size'])) {
66 66
             $this->file_size = $this->settings['size'];
67 67
         } else {
68 68
             $this->file_size = $this->remoteFileSize($this->settings['url']);
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         $fp = fopen($this->settings['res_file'], 'w');
74 74
         $ch = curl_init();
75
-        if ( ! is_resource($ch)) {
75
+        if (!is_resource($ch)) {
76 76
             return false;
77 77
         }
78 78
         curl_setopt($ch, CURLOPT_FILE, $fp);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function checkFile(): bool
124 124
     {
125
-        if ( ! file_exists($this->settings['res_file'])) {
125
+        if (!file_exists($this->settings['res_file'])) {
126 126
             file_put_contents($this->error_file, 'File did not upload', FILE_APPEND);
127 127
 
128 128
             return false;
Please login to merge, or discard this patch.
src/PBXCoreREST/Workers/WorkerMergeUploadedFile.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
     public function start($argv): void
20 20
     {
21 21
         $settings_file = trim($argv[1]);
22
-        if ( ! file_exists($settings_file)) {
22
+        if (!file_exists($settings_file)) {
23 23
             Util::sysLogMsg(__CLASS__, 'File with settings not found');
24 24
 
25 25
             return;
26 26
         }
27 27
         $settings = json_decode(file_get_contents($settings_file), true);
28
-        $progress_file = $settings['tempDir'] . '/merging_progress';
28
+        $progress_file = $settings['tempDir'].'/merging_progress';
29 29
         $this->mergeFilesInDirectory(
30 30
             $settings['tempDir'],
31 31
             $settings['resumableFilename'],
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         // Check filesize is equal uploaded size
38 38
         $resultFileSize = filesize($settings['fullUploadedFileName']);
39
-        if ((int)$settings['resumableTotalSize'] === $resultFileSize) {
39
+        if ((int) $settings['resumableTotalSize'] === $resultFileSize) {
40 40
             file_put_contents($progress_file, '100');
41 41
         } else {
42 42
             Util::sysLogMsg(
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         // Delete uploaded file after 10 minutes
49 49
         Util::mwExecBg(
50
-            '/sbin/shell_functions.sh killprocesses ' . $settings['tempDir'] . ' -TERM 0;rm -rf ' . $settings['tempDir'],
50
+            '/sbin/shell_functions.sh killprocesses '.$settings['tempDir'].' -TERM 0;rm -rf '.$settings['tempDir'],
51 51
             '/dev/null',
52 52
             600
53 53
         );
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         // Restore original file from chunks
74 74
         if (($fp = fopen($result_file, 'w')) !== false) {
75 75
             for ($i = 1; $i <= $total_files; $i++) {
76
-                $tmp_file = $tempDir . '/' . $fileName . '.part' . $i;
76
+                $tmp_file = $tempDir.'/'.$fileName.'.part'.$i;
77 77
                 fwrite($fp, file_get_contents($tmp_file));
78 78
                 unlink($tmp_file);
79 79
                 $currentProgress = round($i / $total_files * 100);
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
             }
83 83
             fclose($fp);
84 84
         } else {
85
-            Util::sysLogMsg('UploadFile', 'cannot create the destination file - ' . $result_file);
85
+            Util::sysLogMsg('UploadFile', 'cannot create the destination file - '.$result_file);
86 86
 
87 87
             return;
88 88
         }
89
-        Util::sysLogMsg('UploadFile', 'destination file - ' . $result_file);
89
+        Util::sysLogMsg('UploadFile', 'destination file - '.$result_file);
90 90
     }
91 91
 }
92 92
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         } else {
42 42
             Util::sysLogMsg(
43 43
                 'UploadFile',
44
-                "File {$settings['fullUploadedFileName']} size {$resultFileSize} does not equal {$settings['resumableTotalSize']}"
44
+                "file {$settings['fullUploadedFileName']} size {$resultFileSize} does not equal {$settings['resumableTotalSize']}"
45 45
             );
46 46
         }
47 47
 
Please login to merge, or discard this patch.
src/Core/System/System.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         if (file_exists('/etc/TZ')) {
175 175
             $origin_tz = file_get_contents("/etc/TZ");
176 176
         }
177
-        if ($origin_tz !== $db_tz){
177
+        if ($origin_tz !== $db_tz) {
178 178
             self::timezoneConfigure();
179 179
         }
180 180
         $origin_tz = $db_tz;
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         }
245 245
         if ($timezone) {
246 246
             $zone_file = "/usr/share/zoneinfo/{$timezone}";
247
-            if ( ! file_exists($zone_file)) {
247
+            if (!file_exists($zone_file)) {
248 248
                 return;
249 249
             }
250 250
             $cpPath = Util::which('cp');
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
             try {
283 283
                 /** @var \MikoPBX\Modules\Config\ConfigClass $appClass */
284 284
                 $appClass->onAfterPbxStarted();
285
-            }catch (\Error $e){
285
+            } catch (\Error $e) {
286 286
                 Util::sysLogMsg('onAfterPbxStarted', $e->getMessage());
287 287
             }
288 288
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@
 block discarded – undo
282 282
             try {
283 283
                 /** @var \MikoPBX\Modules\Config\ConfigClass $appClass */
284 284
                 $appClass->onAfterPbxStarted();
285
-            }catch (\Error $e){
285
+            } catch (\Error $e){
286 286
                 Util::sysLogMsg('onAfterPbxStarted', $e->getMessage());
287 287
             }
288 288
         }
Please login to merge, or discard this patch.
src/Core/System/Network.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         }
30 30
 
31 31
         Util::killByName('pcapsipdump');
32
-        $log_dir = System::getLogDir() . '/pcapsipdump';
32
+        $log_dir = System::getLogDir().'/pcapsipdump';
33 33
         Util::mwMkdir($log_dir);
34 34
 
35 35
         $network         = new Network();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         foreach ($arr_eth as $eth) {
39 39
             $pid_file = "/var/run/pcapsipdump_{$eth}.pid";
40 40
             Util::mwExecBg(
41
-                $pcapsipdumpPath . ' -T 120 -P ' . $pid_file . ' -i ' . $eth . ' -m \'^(INVITE|REGISTER)$\' -L ' . $log_dir . '/dump.db'
41
+                $pcapsipdumpPath.' -T 120 -P '.$pid_file.' -i '.$eth.' -m \'^(INVITE|REGISTER)$\' -L '.$log_dir.'/dump.db'
42 42
             );
43 43
         }
44 44
     }
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
         /** @var \MikoPBX\Common\Models\LanInterfaces $res */
147 147
         $res = LanInterfaces::findFirst("internet = '1'");
148 148
         if (null !== $res) {
149
-            if ( ! empty($res->primarydns) && '127.0.0.1' != $res->primarydns) {
149
+            if (!empty($res->primarydns) && '127.0.0.1' != $res->primarydns) {
150 150
                 $dns[] = $res->primarydns;
151 151
             }
152
-            if ( ! empty($res->secondarydns) && '127.0.0.1' != $res->secondarydns) {
152
+            if (!empty($res->secondarydns) && '127.0.0.1' != $res->secondarydns) {
153 153
                 $dns[] = $res->secondarydns;
154 154
             }
155 155
         }
@@ -165,39 +165,39 @@  discard block
 block discarded – undo
165 165
     public function generatePdnsdConfig($named_dns): void
166 166
     {
167 167
         $tempDir   = $this->di->getShared('config')->path('core.tempDir');
168
-        $cache_dir = $tempDir . '/pdnsd/cache';
168
+        $cache_dir = $tempDir.'/pdnsd/cache';
169 169
         Util::mwMkdir($cache_dir);
170 170
 
171
-        $conf = 'global {' . "\n" .
172
-            '	perm_cache=10240;' . "\n" .
173
-            '	cache_dir="' . $cache_dir . '";' . "\n" .
174
-            '	pid_file = /var/run/pdnsd.pid;' . "\n" .
175
-            '	run_as="nobody";' . "\n" .
176
-            '	server_ip = 127.0.0.1;' . "\n" .
177
-            '	status_ctl = on;' . "\n" .
178
-            '	query_method=udp_tcp;' . "\n" .
179
-            '	min_ttl=15m;' . "\n" .
180
-            '	max_ttl=1w;' . "\n" .
181
-            '	timeout=10;' . "\n" .
182
-            '	neg_domain_pol=on;' . "\n" .
183
-            '	run_as=root;' . "\n" .
184
-            '	daemon=on;' . "\n" .
185
-            '}' . "\n" .
186
-            'server {' . "\n" .
187
-            '	label = "main";' . "\n" .
188
-            '	ip = ' . implode(', ', $named_dns) . ';' . "\n" .
189
-            '	interface=lo;' . "\n" .
190
-            '	uptest=if;' . "\n" .
191
-            '	interval=10m;' . "\n" .
192
-            '	purge_cache=off;' . "\n" .
171
+        $conf = 'global {'."\n".
172
+            '	perm_cache=10240;'."\n".
173
+            '	cache_dir="'.$cache_dir.'";'."\n".
174
+            '	pid_file = /var/run/pdnsd.pid;'."\n".
175
+            '	run_as="nobody";'."\n".
176
+            '	server_ip = 127.0.0.1;'."\n".
177
+            '	status_ctl = on;'."\n".
178
+            '	query_method=udp_tcp;'."\n".
179
+            '	min_ttl=15m;'."\n".
180
+            '	max_ttl=1w;'."\n".
181
+            '	timeout=10;'."\n".
182
+            '	neg_domain_pol=on;'."\n".
183
+            '	run_as=root;'."\n".
184
+            '	daemon=on;'."\n".
185
+            '}'."\n".
186
+            'server {'."\n".
187
+            '	label = "main";'."\n".
188
+            '	ip = '.implode(', ', $named_dns).';'."\n".
189
+            '	interface=lo;'."\n".
190
+            '	uptest=if;'."\n".
191
+            '	interval=10m;'."\n".
192
+            '	purge_cache=off;'."\n".
193 193
             '}';
194 194
 
195
-        $pdnsdConfFile  = '/etc/pdnsd.conf';
195
+        $pdnsdConfFile = '/etc/pdnsd.conf';
196 196
         $savedConf = '';
197
-        if(file_exists($pdnsdConfFile)){
197
+        if (file_exists($pdnsdConfFile)) {
198 198
             $savedConf = file_get_contents($pdnsdConfFile);
199 199
         }
200
-        if($savedConf != $conf){
200
+        if ($savedConf != $conf) {
201 201
             file_put_contents($pdnsdConfFile, $conf);
202 202
         }
203 203
         $pdnsdPath = Util::which('pdnsd');
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         if (!empty($pid) && $savedConf === $conf) {
206 206
             // Выполним дополнительную проверку, работает ли сервер.
207 207
             $resultResolve = gethostbynamel('lic.miko.ru');
208
-            if($resultResolve !== false){
208
+            if ($resultResolve !== false) {
209 209
                 // Ничего делать не нужно. Конфиг не изменился. Рестарт не требуется.
210 210
                 return;
211 211
             }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                  */
283 283
                 $pid_file = "/var/run/udhcpc_{$if_name}";
284 284
                 $pid_pcc  = Util::getPidOfProcess($pid_file);
285
-                if ( ! empty($pid_pcc) && file_exists($pid_file)) {
285
+                if (!empty($pid_pcc) && file_exists($pid_file)) {
286 286
                     // Завершаем старый процесс.
287 287
                     $killPath = Util::which('kill');
288 288
                     $catPath  = Util::which('cat');
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
 
412 412
             $result = [''];
413 413
             if (file_exists('/etc/static-routes')) {
414
-                $command = "{$catPath} /etc/static-routes " .
415
-                    "| {$grepPath} '^rout' " .
416
-                    "| {$busyboxPath} awk -F ';' '{print $1}' " .
417
-                    "| {$grepPath} '{$if_name}\$' " .
414
+                $command = "{$catPath} /etc/static-routes ".
415
+                    "| {$grepPath} '^rout' ".
416
+                    "| {$busyboxPath} awk -F ';' '{print $1}' ".
417
+                    "| {$grepPath} '{$if_name}\$' ".
418 418
                     "| {$awkPath} -F 'dev {$if_name}' '{ print $1 }'";
419 419
                 Util::mwExec($command, $result);
420 420
             }
@@ -424,19 +424,19 @@  discard block
 block discarded – undo
424 424
 
425 425
             if ($if_data['vlanid'] > 0) {
426 426
                 // Пока только статика.
427
-                $lan_config = "auto {$if_data['interface_orign']}.{$if_data['vlanid']}\n" .
428
-                    "iface {$if_data['interface_orign']}.{$if_data['vlanid']} inet static \n" .
429
-                    "address {$ipaddr}\n" .
430
-                    "netmask {$subnet}\n" .
431
-                    "gateway {$gateway}\n" .
432
-                    "dns-nameservers 127.0.0.1\n" .
433
-                    "vlan_raw_device {$if_data['interface_orign']}\n" .
434
-                    "{$routs_add}\n" .
427
+                $lan_config = "auto {$if_data['interface_orign']}.{$if_data['vlanid']}\n".
428
+                    "iface {$if_data['interface_orign']}.{$if_data['vlanid']} inet static \n".
429
+                    "address {$ipaddr}\n".
430
+                    "netmask {$subnet}\n".
431
+                    "gateway {$gateway}\n".
432
+                    "dns-nameservers 127.0.0.1\n".
433
+                    "vlan_raw_device {$if_data['interface_orign']}\n".
434
+                    "{$routs_add}\n".
435 435
                     "{$routs_rem}\n";
436 436
             } elseif (trim($if_data['dhcp']) === '1') {
437
-                $lan_config = "auto {$if_name}\n" .
438
-                    "iface {$if_name} inet dhcp\n" .
439
-                    "{$routs_add}\n" .
437
+                $lan_config = "auto {$if_name}\n".
438
+                    "iface {$if_name} inet dhcp\n".
439
+                    "{$routs_add}\n".
440 440
                     "{$routs_rem}\n";
441 441
             } else {
442 442
                 if (empty($ipaddr)) {
@@ -449,13 +449,13 @@  discard block
 block discarded – undo
449 449
                     echo "Caught exception: $ipaddr $subnet", $e->getMessage(), "\n";
450 450
                     continue;
451 451
                 }
452
-                $lan_config = "auto {$if_name}\n" .
453
-                    "iface {$if_name} inet static\n" .
454
-                    "address {$ipaddr}\n" .
455
-                    "netmask {$subnet}\n" .
456
-                    "gateway {$gateway}\n" .
457
-                    "dns-nameservers 127.0.0.1\n" .
458
-                    "{$routs_add}\n" .
452
+                $lan_config = "auto {$if_name}\n".
453
+                    "iface {$if_name} inet static\n".
454
+                    "address {$ipaddr}\n".
455
+                    "netmask {$subnet}\n".
456
+                    "gateway {$gateway}\n".
457
+                    "dns-nameservers 127.0.0.1\n".
458
+                    "{$routs_add}\n".
459 459
                     "{$routs_rem}\n";
460 460
             }
461 461
             file_put_contents("/etc/network/interfaces.d/{$if_name}", $lan_config);
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
         $net_mask = explode(".", $net_mask);
547 547
 
548 548
         foreach ($net_mask as $oct_ect) {
549
-            $bits += strlen(str_replace("0", "", decbin((int)$oct_ect)));
549
+            $bits += strlen(str_replace("0", "", decbin((int) $oct_ect)));
550 550
         }
551 551
 
552 552
         return $bits;
@@ -603,13 +603,13 @@  discard block
 block discarded – undo
603 603
         $data->name      = $name;
604 604
         $data->interface = $name;
605 605
         $data->dhcp      = '1';
606
-        $data->internet  = ($general === true) ? '1' : '0';;
606
+        $data->internet  = ($general === true) ? '1' : '0'; ;
607 607
         $data->disabled  = '0';
608 608
         $data->vlanid    = '0';
609 609
         $data->hostname  = 'mikopbx';
610 610
         $data->domain    = '';
611 611
         $data->topology  = 'private';
612
-        $data->primarydns= '';
612
+        $data->primarydns = '';
613 613
         $data->save();
614 614
 
615 615
         return $data->toArray();
@@ -630,15 +630,15 @@  discard block
 block discarded – undo
630 630
     public function hostnameConfigure(): void
631 631
     {
632 632
         $data       = Network::getHostName();
633
-        $hosts_conf = "127.0.0.1 localhost\n" .
633
+        $hosts_conf = "127.0.0.1 localhost\n".
634 634
             "127.0.0.1 {$data['hostname']}\n";
635
-        if ( ! empty($data['domain'])) {
635
+        if (!empty($data['domain'])) {
636 636
             $hosts_conf .= "127.0.0.1 {$data['hostname']}.{$data['domain']}\n";
637 637
         }
638 638
         Util::fileWriteContent('/etc/hosts', $hosts_conf);
639 639
 
640 640
         $hostnamePath = Util::which('hostname');
641
-        Util::mwExec($hostnamePath . ' ' . escapeshellarg("{$data['hostname']}"));
641
+        Util::mwExec($hostnamePath.' '.escapeshellarg("{$data['hostname']}"));
642 642
     }
643 643
 
644 644
     /**
@@ -652,12 +652,12 @@  discard block
 block discarded – undo
652 652
 
653 653
         $pidFile = '/var/run/openvpn.pid';
654 654
         $pid     = Util::getPidOfProcess('openvpn');
655
-        if ( ! empty($pid)) {
655
+        if (!empty($pid)) {
656 656
             // Завершаем процесс.
657 657
             $busyboxPath = Util::which('busybox');
658 658
             Util::mwExec("{$busyboxPath} kill '$pid'");
659 659
         }
660
-        if ( ! empty($data)) {
660
+        if (!empty($data)) {
661 661
             $openvpnPath = Util::which('openvpn');
662 662
             Util::mwExecBg("{$openvpnPath} --config /etc/openvpn.ovpn --writepid {$pidFile}", '/dev/null', 5);
663 663
         }
@@ -867,12 +867,12 @@  discard block
 block discarded – undo
867 867
         if ($res === null) {
868 868
             return;
869 869
         }
870
-        if (empty($res->primarydns) && ! empty($data['primarydns'])) {
870
+        if (empty($res->primarydns) && !empty($data['primarydns'])) {
871 871
             $res->writeAttribute('primarydns', $data['primarydns']);
872 872
         } elseif (empty($res->secondarydns) && $res->primarydns !== $data['primarydns']) {
873 873
             $res->writeAttribute('secondarydns', $data['primarydns']);
874 874
         }
875
-        if (empty($res->secondarydns) && ! empty($data['secondarydns'])) {
875
+        if (empty($res->secondarydns) && !empty($data['secondarydns'])) {
876 876
             $res->writeAttribute('secondarydns', $data['secondarydns']);
877 877
         }
878 878
         $res->save();
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
     {
916 916
         // Настройка по умолчанию.
917 917
         $interface = trim(getenv('interface'));
918
-        if ( ! Util::isSystemctl()) {
918
+        if (!Util::isSystemctl()) {
919 919
             // Для MIKO LFS Edition.
920 920
             $busyboxPath = Util::which('busybox');
921 921
             Util::mwExec("{$busyboxPath} ifconfig $interface 192.168.2.1 netmask 255.255.255.0");
Please login to merge, or discard this patch.
src/PBXCoreREST/Lib/FilesManagementProcessor.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -90,18 +90,18 @@  discard block
 block discarded – undo
90 90
         }
91 91
         $parameters['uploadDir'] = $di->getShared('config')->path('www.uploadDir');
92 92
         $parameters['tempDir']   = "{$parameters['uploadDir']}/{$parameters['resumableIdentifier']}";
93
-        if ( ! Util::mwMkdir($parameters['tempDir'])) {
94
-            $res->messages[] = 'Temp dir does not exist ' . $parameters['tempDir'];
93
+        if (!Util::mwMkdir($parameters['tempDir'])) {
94
+            $res->messages[] = 'Temp dir does not exist '.$parameters['tempDir'];
95 95
 
96 96
             return $res;
97 97
         }
98 98
 
99 99
         $fileName                           = pathinfo($parameters['resumableFilename'], PATHINFO_FILENAME);
100
-        $fileName                           = preg_replace( '/[\W]/', '', $fileName);
101
-        if (strlen($fileName)<10){
100
+        $fileName                           = preg_replace('/[\W]/', '', $fileName);
101
+        if (strlen($fileName) < 10) {
102 102
             $fileName = ''.md5(time()).'-'.$fileName;
103 103
         }
104
-        $fileName                           .= '.'.pathinfo($parameters['resumableFilename'], PATHINFO_EXTENSION);
104
+        $fileName .= '.'.pathinfo($parameters['resumableFilename'], PATHINFO_EXTENSION);
105 105
         $parameters['resumableFilename']    = $fileName;
106 106
         $parameters['fullUploadedFileName'] = "{$parameters['tempDir']}/{$fileName}";
107 107
 
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
         }
116 116
 
117 117
         foreach ($parameters['files'] as $file_data) {
118
-            if ( ! self::moveUploadedPartToSeparateDir($parameters, $file_data)) {
119
-                $res->messages[] = 'Does not found any uploaded chunks on with path ' . $file_data['file_path'];
118
+            if (!self::moveUploadedPartToSeparateDir($parameters, $file_data)) {
119
+                $res->messages[] = 'Does not found any uploaded chunks on with path '.$file_data['file_path'];
120 120
 
121 121
                 return $res;
122 122
             }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     private static function moveUploadedPartToSeparateDir(array $parameters, array $file_data): bool
146 146
     {
147
-        if ( ! file_exists($file_data['file_path'])) {
147
+        if (!file_exists($file_data['file_path'])) {
148 148
             return false;
149 149
         }
150 150
         $factory          = new StreamFactory();
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     {
178 178
         $totalFilesOnServerSize = 0;
179 179
         foreach (scandir($parameters['tempDir']) as $file) {
180
-            $totalFilesOnServerSize += filesize($parameters['tempDir'] . '/' . $file);
180
+            $totalFilesOnServerSize += filesize($parameters['tempDir'].'/'.$file);
181 181
         }
182 182
 
183 183
         if ($totalFilesOnServerSize >= $parameters['resumableTotalSize']) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                 'resumableTotalSize'   => $parameters['resumableTotalSize'],
190 190
                 'resumableTotalChunks' => $parameters['resumableTotalChunks'],
191 191
             ];
192
-            $settings_file  = "{$parameters['tempDir']}/merge_settings";
192
+            $settings_file = "{$parameters['tempDir']}/merge_settings";
193 193
             file_put_contents(
194 194
                 $settings_file,
195 195
                 json_encode($merge_settings, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)
@@ -226,22 +226,22 @@  discard block
 block discarded – undo
226 226
         $uploadDir = $di->getShared('config')->path('www.uploadDir');
227 227
 
228 228
         $upload_id     = $postData['id'] ?? null;
229
-        $progress_dir  = $uploadDir . '/' . $upload_id;
230
-        $progress_file = $progress_dir . '/merging_progress';
229
+        $progress_dir  = $uploadDir.'/'.$upload_id;
230
+        $progress_file = $progress_dir.'/merging_progress';
231 231
         if (empty($upload_id)) {
232 232
             $res->success                   = false;
233 233
             $res->data['d_status_progress'] = '0';
234 234
             $res->data['d_status']          = 'ID_NOT_SET';
235 235
             $res->messages[]                = 'Upload ID does not set';
236
-        } elseif ( ! file_exists($progress_file) && file_exists($progress_dir)) {
236
+        } elseif (!file_exists($progress_file) && file_exists($progress_dir)) {
237 237
             $res->success                   = true;
238 238
             $res->data['d_status_progress'] = '0';
239 239
             $res->data['d_status']          = 'INPROGRESS';
240
-        } elseif ( ! file_exists($progress_dir)) {
240
+        } elseif (!file_exists($progress_dir)) {
241 241
             $res->success                   = false;
242 242
             $res->data['d_status_progress'] = '0';
243 243
             $res->data['d_status']          = 'NOT_FOUND';
244
-            $res->messages[]                = 'Does not found anything with path: ' . $progress_dir;
244
+            $res->messages[]                = 'Does not found anything with path: '.$progress_dir;
245 245
         } elseif ('100' === file_get_contents($progress_file)) {
246 246
             $res->success                   = true;
247 247
             $res->data['d_status_progress'] = '100';
@@ -267,14 +267,14 @@  discard block
 block discarded – undo
267 267
         $res            = new PBXApiResult();
268 268
         $res->processor = __METHOD__;
269 269
         $extension      = Util::getExtensionOfFile($filePath);
270
-        if ( ! in_array($extension, ['mp3', 'wav', 'alaw'])) {
270
+        if (!in_array($extension, ['mp3', 'wav', 'alaw'])) {
271 271
             $res->success    = false;
272 272
             $res->messages[] = "It is forbidden to remove the file type $extension.";
273 273
 
274 274
             return $res;
275 275
         }
276 276
 
277
-        if ( ! file_exists($filePath)) {
277
+        if (!file_exists($filePath)) {
278 278
             $res->success         = true;
279 279
             $res->data['message'] = "File '{$filePath}' already deleted";
280 280
 
@@ -284,13 +284,13 @@  discard block
 block discarded – undo
284 284
         $out = [];
285 285
 
286 286
         $arrDeletedFiles = [
287
-            escapeshellarg(Util::trimExtensionForFile($filePath) . ".wav"),
288
-            escapeshellarg(Util::trimExtensionForFile($filePath) . ".mp3"),
289
-            escapeshellarg(Util::trimExtensionForFile($filePath) . ".alaw"),
287
+            escapeshellarg(Util::trimExtensionForFile($filePath).".wav"),
288
+            escapeshellarg(Util::trimExtensionForFile($filePath).".mp3"),
289
+            escapeshellarg(Util::trimExtensionForFile($filePath).".alaw"),
290 290
         ];
291 291
 
292 292
         $rmPath = Util::which('rm');
293
-        Util::mwExec("{$rmPath} -rf " . implode(' ', $arrDeletedFiles), $out);
293
+        Util::mwExec("{$rmPath} -rf ".implode(' ', $arrDeletedFiles), $out);
294 294
         if (file_exists($filePath)) {
295 295
             $res->success  = false;
296 296
             $res->messages = $out;
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
             $cat          = Util::which('cat');
324 324
             $di           = Di::getDefault();
325 325
             $dirsConfig   = $di->getShared('config');
326
-            $filenameTmp  = $dirsConfig->path('www.downloadCacheDir') . '/' . __FUNCTION__ . '_' . time() . '.conf';
326
+            $filenameTmp  = $dirsConfig->path('www.downloadCacheDir').'/'.__FUNCTION__.'_'.time().'.conf';
327 327
             $cmd          = "{$cat} {$filename} > {$filenameTmp}";
328 328
             Util::mwExec("{$cmd}; chown www:www {$filenameTmp}");
329 329
             $res->data['filename'] = $filenameTmp;
330 330
         } else {
331 331
             $res->success    = false;
332
-            $res->messages[] = 'No access to the file ' . $filename;
332
+            $res->messages[] = 'No access to the file '.$filename;
333 333
         }
334 334
 
335 335
         return $res;
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
         $res->success   = true;
399 399
 
400 400
         $firmwareDirTmp = dirname($imgFileName);
401
-        $progress_file  = $firmwareDirTmp . '/progress';
401
+        $progress_file  = $firmwareDirTmp.'/progress';
402 402
 
403 403
         // Wait until download process started
404 404
         $d_pid = Util::getPidOfProcess("{$firmwareDirTmp}/download_settings.json");
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             $error = trim(file_get_contents("{$firmwareDirTmp}/error"));
411 411
         }
412 412
 
413
-        if ( ! file_exists($progress_file)) {
413
+        if (!file_exists($progress_file)) {
414 414
             $res->data['d_status_progress'] = '0';
415 415
             $res->messages[]                = 'NOT_FOUND';
416 416
             $res->success                   = false;
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
         } else {
515 515
             $tempDir = '/tmp';
516 516
         }
517
-        $moduleDirTmp  = $tempDir . '/' . $moduleUniqueID;
518
-        $progress_file = $moduleDirTmp . '/progress';
517
+        $moduleDirTmp  = $tempDir.'/'.$moduleUniqueID;
518
+        $progress_file = $moduleDirTmp.'/progress';
519 519
         $error         = '';
520
-        if (file_exists($moduleDirTmp . '/error')) {
521
-            $error = trim(file_get_contents($moduleDirTmp . '/error'));
520
+        if (file_exists($moduleDirTmp.'/error')) {
521
+            $error = trim(file_get_contents($moduleDirTmp.'/error'));
522 522
         }
523 523
 
524 524
         // Wait until download process started
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
             usleep(500000);
528 528
         }
529 529
 
530
-        if ( ! file_exists($progress_file)) {
530
+        if (!file_exists($progress_file)) {
531 531
             $res->data['d_status_progress'] = '0';
532 532
             $res->data['d_status']          = 'NOT_FOUND';
533 533
             $res->success                   = false;
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
             $res->data['d_status']          = 'DOWNLOAD_ERROR';
536 536
             $res->data['d_status_progress'] = file_get_contents($progress_file);
537 537
             $res->data['d_error']           = $error;
538
-            $res->messages[]                = file_get_contents($moduleDirTmp . '/error');
538
+            $res->messages[]                = file_get_contents($moduleDirTmp.'/error');
539 539
             $res->success                   = false;
540 540
         } elseif ('100' === file_get_contents($progress_file)) {
541 541
             $res->data['d_status_progress'] = '100';
@@ -544,11 +544,11 @@  discard block
 block discarded – undo
544 544
             $res->success                   = true;
545 545
         } else {
546 546
             $res->data['d_status_progress'] = file_get_contents($progress_file);
547
-            $d_pid                          = Util::getPidOfProcess($moduleDirTmp . '/download_settings.json');
547
+            $d_pid                          = Util::getPidOfProcess($moduleDirTmp.'/download_settings.json');
548 548
             if (empty($d_pid)) {
549 549
                 $res->data['d_status'] = 'DOWNLOAD_ERROR';
550
-                if (file_exists($moduleDirTmp . '/error')) {
551
-                    $res->messages[] = file_get_contents($moduleDirTmp . '/error');
550
+                if (file_exists($moduleDirTmp.'/error')) {
551
+                    $res->messages[] = file_get_contents($moduleDirTmp.'/error');
552 552
                 } else {
553 553
                     $res->messages[] = "Download process interrupted at {$res->data['d_status_progress']}%";
554 554
                 }
@@ -579,13 +579,13 @@  discard block
 block discarded – undo
579 579
             $grepPath    = Util::which('grep');
580 580
             $echoPath    = Util::which('echo');
581 581
             $awkPath     = Util::which('awk');
582
-            $cmd         = 'f="' . $filePath . '"; p=`' . $sevenZaPath . ' l $f | ' . $grepPath . ' module.json`;if [ "$?" == "0" ]; then ' . $sevenZaPath . ' -so e -y -r $f `' . $echoPath . ' $p |  ' . $awkPath . ' -F" " \'{print $6}\'`; fi';
582
+            $cmd         = 'f="'.$filePath.'"; p=`'.$sevenZaPath.' l $f | '.$grepPath.' module.json`;if [ "$?" == "0" ]; then '.$sevenZaPath.' -so e -y -r $f `'.$echoPath.' $p |  '.$awkPath.' -F" " \'{print $6}\'`; fi';
583 583
 
584 584
             Util::mwExec($cmd, $out);
585 585
             $settings = json_decode(implode("\n", $out), true);
586 586
 
587 587
             $moduleUniqueID = $settings['moduleUniqueID'] ?? null;
588
-            if ( ! $moduleUniqueID) {
588
+            if (!$moduleUniqueID) {
589 589
                 $res->messages[] = 'The" moduleUniqueID " in the module file is not described.the json or file does not exist.';
590 590
 
591 591
                 return $res;
Please login to merge, or discard this patch.
src/Modules/Setup/PbxExtensionSetupBase.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
         $this->messages = [];
115 115
         $this->db      = $this->di->getShared('db');
116 116
         $this->config  = $this->di->getShared('config');
117
-        $this->license =  $this->di->getShared('license');
118
-        $this->moduleDir = $this->config->path('core.modulesDir') . '/' . $this->moduleUniqueID;
117
+        $this->license = $this->di->getShared('license');
118
+        $this->moduleDir = $this->config->path('core.modulesDir').'/'.$this->moduleUniqueID;
119 119
         $settings_file = "{$this->moduleDir}/module.json";
120 120
         if (file_exists($settings_file)) {
121 121
             $module_settings = json_decode(file_get_contents($settings_file), true);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             }
140 140
         }
141 141
 
142
-        $this->messages  = [];
142
+        $this->messages = [];
143 143
 
144 144
 
145 145
     }
@@ -154,21 +154,21 @@  discard block
 block discarded – undo
154 154
     {
155 155
         $result = true;
156 156
         try {
157
-            if ( ! $this->activateLicense()) {
157
+            if (!$this->activateLicense()) {
158 158
                 $this->messages[] = 'License activate error';
159 159
                 $result           = false;
160 160
             }
161
-            if ( ! $this->installFiles()) {
161
+            if (!$this->installFiles()) {
162 162
                 $this->messages[] = ' installFiles error';
163 163
                 $result           = false;
164 164
             }
165
-            if ( ! $this->installDB()) {
165
+            if (!$this->installDB()) {
166 166
                 $this->messages[] = ' installDB error';
167 167
                 $result           = false;
168 168
             }
169 169
             $this->fixFilesRights();
170 170
         } catch (\Exception $exception) {
171
-            $result         = false;
171
+            $result = false;
172 172
             $this->messages[] = $exception->getMessage();
173 173
         }
174 174
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         PbxExtensionUtils::createAgiBinSymlinks($this->moduleUniqueID);
200 200
 
201 201
         // Restore database settings
202
-        $modulesDir          = $this->config->path('core.modulesDir');
202
+        $modulesDir = $this->config->path('core.modulesDir');
203 203
         $backupPath = "{$modulesDir}/Backup/{$this->moduleUniqueID}";
204 204
         if (is_dir($backupPath)) {
205 205
             $cpPath = Util::which('cp');
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             "{$this->moduleDir}/bin"
223 223
         ];
224 224
         foreach ($dirs as $dir) {
225
-            if(file_exists($dir) && is_dir($dir)){
225
+            if (file_exists($dir) && is_dir($dir)) {
226 226
                 // Add executable right to module's binary
227 227
                 Util::addExecutableRights($dir);
228 228
             }
@@ -257,16 +257,16 @@  discard block
 block discarded – undo
257 257
     {
258 258
         $result = true;
259 259
         try {
260
-            if ( ! $this->unInstallDB($keepSettings)) {
260
+            if (!$this->unInstallDB($keepSettings)) {
261 261
                 $this->messages[] = ' unInstallDB error';
262 262
                 $result           = false;
263 263
             }
264
-            if ($result && ! $this->unInstallFiles($keepSettings)) {
264
+            if ($result && !$this->unInstallFiles($keepSettings)) {
265 265
                 $this->messages[] = ' unInstallFiles error';
266 266
                 $result           = false;
267 267
             }
268 268
         } catch (\Exception $exception) {
269
-            $result         = false;
269
+            $result = false;
270 270
             $this->messages[] = $exception->getMessage();
271 271
         }
272 272
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     {
315 315
         $cpPath = Util::which('cp');
316 316
         $rmPath = Util::which('rm');
317
-        $modulesDir          = $this->config->path('core.modulesDir');
317
+        $modulesDir = $this->config->path('core.modulesDir');
318 318
         $backupPath = "{$modulesDir}/Backup/{$this->moduleUniqueID}";
319 319
         Util::mwExec("{$rmPath} -rf {$backupPath}");
320 320
         if ($keepSettings) {
@@ -327,21 +327,21 @@  discard block
 block discarded – undo
327 327
         // IMG
328 328
         $imgCacheDir = appPath('sites/admin-cabinet/assets/img/cache');
329 329
         $moduleImageCacheDir = "{$imgCacheDir}/{$this->moduleUniqueID}";
330
-        if (file_exists($moduleImageCacheDir)){
330
+        if (file_exists($moduleImageCacheDir)) {
331 331
             unlink($moduleImageCacheDir);
332 332
         }
333 333
 
334 334
         // CSS
335 335
         $cssCacheDir = appPath('sites/admin-cabinet/assets/css/cache');
336 336
         $moduleCSSCacheDir = "{$cssCacheDir}/{$this->moduleUniqueID}";
337
-        if (file_exists($moduleCSSCacheDir)){
337
+        if (file_exists($moduleCSSCacheDir)) {
338 338
             unlink($moduleCSSCacheDir);
339 339
         }
340 340
 
341 341
         // JS
342 342
         $jsCacheDir = appPath('sites/admin-cabinet/assets/js/cache');
343 343
         $moduleJSCacheDir = "{$jsCacheDir}/{$this->moduleUniqueID}";
344
-        if (file_exists($moduleJSCacheDir)){
344
+        if (file_exists($moduleJSCacheDir)) {
345 345
             unlink($moduleJSCacheDir);
346 346
         }
347 347
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
         }
376 376
 
377 377
         $module = PbxExtensionModules::findFirstByUniqid($this->moduleUniqueID);
378
-        if ( ! $module) {
378
+        if (!$module) {
379 379
             $module           = new PbxExtensionModules();
380 380
             $module->name     = $this->locString("Breadcrumb{$this->moduleUniqueID}");
381 381
             $module->disabled = '1';
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         $language             = substr(PbxSettings::getValueByKey('WebAdminLanguage'), 0, 2);
402 402
         $translates           = [];
403 403
         $extensionsTranslates = [[]];
404
-        $results              = glob($this->moduleDir . '/{Messages}/en.php', GLOB_BRACE);
404
+        $results              = glob($this->moduleDir.'/{Messages}/en.php', GLOB_BRACE);
405 405
         foreach ($results as $path) {
406 406
             $langArr = require $path;
407 407
             if (is_array($langArr)) {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         }
414 414
         if ($language !== 'en') {
415 415
             $additionalTranslates = [[]];
416
-            $results              = glob($this->moduleDir . "/{Messages}/{$language}.php", GLOB_BRACE);
416
+            $results              = glob($this->moduleDir."/{Messages}/{$language}.php", GLOB_BRACE);
417 417
             foreach ($results as $path) {
418 418
                 $langArr = require $path;
419 419
                 if (is_array($langArr)) {
@@ -444,13 +444,13 @@  discard block
 block discarded – undo
444 444
         // Add new connection for this module after add new Models folder
445 445
         RegisterDIServices::recreateModulesDBConnections();
446 446
 
447
-        $results = glob($this->moduleDir . '/Models/*.php', GLOB_NOSORT);
447
+        $results = glob($this->moduleDir.'/Models/*.php', GLOB_NOSORT);
448 448
         $dbUpgrade = new UpdateDatabase();
449 449
         foreach ($results as $file) {
450 450
             $className        = pathinfo($file)['filename'];
451 451
             $moduleModelClass = "\\Modules\\{$this->moduleUniqueID}\\Models\\{$className}";
452 452
             $upgradeResult = $dbUpgrade->createUpdateDbTableByAnnotations($moduleModelClass);
453
-            if (!$upgradeResult){
453
+            if (!$upgradeResult) {
454 454
                 return false;
455 455
             }
456 456
 
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             $menuSettings      = new PbxSettings();
477 477
             $menuSettings->key = $menuSettingsKey;
478 478
         }
479
-        $value               = [
479
+        $value = [
480 480
             'uniqid'        => $this->moduleUniqueID,
481 481
             'href'          => "/admin-cabinet/{$unCamelizedControllerName}",
482 482
             'group'         => 'modules',
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
         $module = PbxExtensionModules::findFirstByUniqid($this->moduleUniqueID);
378 378
         if ( ! $module) {
379 379
             $module           = new PbxExtensionModules();
380
-            $module->name     = $this->locString("Breadcrumb{$this->moduleUniqueID}");
380
+            $module->name     = $this->locString("breadcrumb{$this->moduleUniqueID}");
381 381
             $module->disabled = '1';
382 382
         }
383 383
         $module->uniqid        = $this->moduleUniqueID;
384 384
         $module->developer     = $this->developer;
385 385
         $module->version       = $this->version;
386
-        $module->description   = $this->locString("SubHeader{$this->moduleUniqueID}");
386
+        $module->description   = $this->locString("subheader{$this->moduleUniqueID}");
387 387
         $module->support_email = $this->support_email;
388 388
 
389 389
         return $module->save();
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
      */
470 470
     public function addToSidebar(): bool
471 471
     {
472
-        $menuSettingsKey           = "AdditionalMenuItem{$this->moduleUniqueID}";
472
+        $menuSettingsKey           = "additionalmenuitem{$this->moduleUniqueID}";
473 473
         $unCamelizedControllerName = Text::uncamelize($this->moduleUniqueID, '-');
474 474
         $menuSettings              = PbxSettings::findFirstByKey($menuSettingsKey);
475 475
         if ($menuSettings === null) {
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             'href'          => "/admin-cabinet/{$unCamelizedControllerName}",
482 482
             'group'         => 'modules',
483 483
             'iconClass'     => 'puzzle',
484
-            'caption'       => "Breadcrumb{$this->moduleUniqueID}",
484
+            'caption'       => "breadcrumb{$this->moduleUniqueID}",
485 485
             'showAtSidebar' => true,
486 486
         ];
487 487
         $menuSettings->value = json_encode($value);
Please login to merge, or discard this patch.