@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ['mimeType' => '', 'extensions' => ['xls'], 'signature' => ['starting' => ['offset' => 512, 'bytes' => ['/0908100000060500/']]]], |
| 46 | 46 | ['mimeType' => '', 'extensions' => ['doc'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/0d444f43/']]]], |
| 47 | 47 | ['mimeType' => '', 'extensions' => ['webm'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/1a45dfa3/']]]], |
| 48 | - ['mimeType' => '', 'extensions' => ['mkv','mka', 'mks', 'mk3d', 'webm'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/45dfa3934282886d6174726f736b61/', '/1a45dfa3/']]]], |
|
| 48 | + ['mimeType' => '', 'extensions' => ['mkv', 'mka', 'mks', 'mk3d', 'webm'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/45dfa3934282886d6174726f736b61/', '/1a45dfa3/']]]], |
|
| 49 | 49 | ['mimeType' => '', 'extensions' => ['gz', 'tgz', 'vlt'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/1f8b08/']]]], |
| 50 | 50 | ['mimeType' => '', 'extensions' => ['tar'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/1f9d/', '/1fA0/']]]], |
| 51 | 51 | ['mimeType' => '', 'extensions' => ['eps'], 'signature' => ['starting' => ['offset' => 0, 'bytes' => ['/252150532d41646f62652d332e3020455053462d332030/']]]], |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | foreach ($sequences as $sequenceId => $sequence) { |
| 126 | 126 | if (sizeof($sequence) >= $this->config->getAppValue(Application::APP_ID, 'minimum_sequence_length', 0)) { |
| 127 | - usort($sequence, function ($a, $b) { |
|
| 127 | + usort($sequence, function($a, $b) { |
|
| 128 | 128 | return $b->getId() - $a->getId(); |
| 129 | 129 | }); |
| 130 | 130 | $sequenceResult = $this->sequenceAnalyzer->analyze($sequenceId, $sequence); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - usort($result, function ($a, $b) { |
|
| 136 | + usort($result, function($a, $b) { |
|
| 137 | 137 | return $b['id'] - $a['id']; |
| 138 | 138 | }); |
| 139 | 139 | |
@@ -151,14 +151,14 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | if ($command === Monitor::WRITE) { |
| 153 | 153 | // Delete file |
| 154 | - if ($this->deleteFromStorage($path . '/' . $name)) { |
|
| 154 | + if ($this->deleteFromStorage($path.'/'.$name)) { |
|
| 155 | 155 | return new JSONResponse(['status' => 'success', 'id' => $id, 'sequence' => $sequence], Http::STATUS_OK); |
| 156 | 156 | } else { |
| 157 | 157 | return new JSONResponse(['status' => 'error', 'message' => 'File cannot be deleted.'], Http::STATUS_OK); |
| 158 | 158 | } |
| 159 | 159 | } else if ($command === Monitor::DELETE) { |
| 160 | 160 | // Restore file |
| 161 | - $trashPath = '/'.$name.'.d'.$timestamp;; |
|
| 161 | + $trashPath = '/'.$name.'.d'.$timestamp; ; |
|
| 162 | 162 | if ($this->restoreFromTrashbin($trashPath, $name, $timestamp) !== false) { |
| 163 | 163 | return new JSONResponse(['status' => 'success', 'id' => $id, 'sequence' => $sequence], Http::STATUS_OK); |
| 164 | 164 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // sort ASC for timestamp |
| 202 | - usort($allFiles, function ($a, $b) { |
|
| 202 | + usort($allFiles, function($a, $b) { |
|
| 203 | 203 | if ($a['timestamp'] === $b['timestamp']) { |
| 204 | 204 | return 0; |
| 205 | 205 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | $fileOperation = new FileOperation(); |
| 324 | 324 | $fileOperation->setUserId($this->userId); |
| 325 | 325 | if (strpos($file['path'], 'files_trashbin') !== false) { |
| 326 | - $node = $this->userFolder->getParent()->get($file['path'] . '.d' . $file['timestamp']); |
|
| 326 | + $node = $this->userFolder->getParent()->get($file['path'].'.d'.$file['timestamp']); |
|
| 327 | 327 | $fileOperation->setCommand(Monitor::DELETE); |
| 328 | 328 | $fileOperation->setTimestamp($file['timestamp']); |
| 329 | 329 | $pathInfo = pathinfo($node->getInternalPath()); |
@@ -41,13 +41,13 @@ |
||
| 41 | 41 | <h3> |
| 42 | 42 | <?php p($l->t('Suspicion threshold for notifications')); ?> |
| 43 | 43 | </h3> |
| 44 | - <select id="sequence-suspicion-level" name="sequence-suspicion-level" class="suspicion-level-<?php p($_['active_suspicion_level']['code']); ?>" data-placeholder="<?php p($l->t('Sequence suspicion level'));?>"> |
|
| 44 | + <select id="sequence-suspicion-level" name="sequence-suspicion-level" class="suspicion-level-<?php p($_['active_suspicion_level']['code']); ?>" data-placeholder="<?php p($l->t('Sequence suspicion level')); ?>"> |
|
| 45 | 45 | <option class="suspicion-level-<?php p($_['active_suspicion_level']['code']); ?>" value="<?php p($_['active_suspicion_level']['code']); ?>"> |
| 46 | 46 | <?php p($_['active_suspicion_level']['name']); ?> |
| 47 | 47 | </option> |
| 48 | 48 | <?php foreach ($_['suspicion_levels'] as $suspicionLevel): ?> |
| 49 | 49 | <option class="suspicion-level-<?php p($suspicionLevel['code']); ?>" value="<?php p($suspicionLevel['code']); ?>"> |
| 50 | - <?php p($suspicionLevel['name']);?> |
|
| 50 | + <?php p($suspicionLevel['name']); ?> |
|
| 51 | 51 | </option> |
| 52 | 52 | <?php endforeach; ?> |
| 53 | 53 | </select> |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | <h3> |
| 29 | 29 | <?php p($l->t('Current color mode')); ?> |
| 30 | 30 | </h3> |
| 31 | - <select id="color-scheme" name="color-scheme" data-placeholder="<?php p($l->t('Color mode'));?>"> |
|
| 31 | + <select id="color-scheme" name="color-scheme" data-placeholder="<?php p($l->t('Color mode')); ?>"> |
|
| 32 | 32 | <option value="<?php p($_['color_active']['code']); ?>"> |
| 33 | 33 | <?php p($_['color_active']['name']); ?> |
| 34 | 34 | </option> |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | $container = $this->getContainer(); |
| 65 | 65 | |
| 66 | 66 | // mapper |
| 67 | - $container->registerService('FileOperationMapper', function ($c) { |
|
| 67 | + $container->registerService('FileOperationMapper', function($c) { |
|
| 68 | 68 | return new FileOperationMapper( |
| 69 | 69 | $c->query('ServerContainer')->getDb() |
| 70 | 70 | ); |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | 73 | // services |
| 74 | - $container->registerService('FileOperationService', function ($c) { |
|
| 74 | + $container->registerService('FileOperationService', function($c) { |
|
| 75 | 75 | return new FileOperationService( |
| 76 | 76 | $c->query(FileOperationMapper::class), |
| 77 | 77 | $c->query('ServerContainer')->getUserSession()->getUser()->getUID() |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | 81 | // classifier |
| 82 | - $container->registerService('Classifier', function ($c) { |
|
| 82 | + $container->registerService('Classifier', function($c) { |
|
| 83 | 83 | return new Classifier( |
| 84 | 84 | $c->query(ILogger::class), |
| 85 | 85 | $c->query(FileOperationMapper::class), |
@@ -88,28 +88,28 @@ discard block |
||
| 88 | 88 | }); |
| 89 | 89 | |
| 90 | 90 | // entropy |
| 91 | - $container->registerService('Entropy', function ($c) { |
|
| 91 | + $container->registerService('Entropy', function($c) { |
|
| 92 | 92 | return new Entropy( |
| 93 | 93 | $c->query(ILogger::class) |
| 94 | 94 | ); |
| 95 | 95 | }); |
| 96 | 96 | |
| 97 | 97 | // analyzer |
| 98 | - $container->registerService('SequenceSizeAnalyzer', function ($c) { |
|
| 98 | + $container->registerService('SequenceSizeAnalyzer', function($c) { |
|
| 99 | 99 | return new SequenceSizeAnalyzer(); |
| 100 | 100 | }); |
| 101 | 101 | |
| 102 | - $container->registerService('FileTypeFunnellingAnalyzer', function ($c) { |
|
| 102 | + $container->registerService('FileTypeFunnellingAnalyzer', function($c) { |
|
| 103 | 103 | return new FileTypeFunnellingAnalyzer(); |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | - $container->registerService('EntropyFunnellingAnalyzer', function ($c) { |
|
| 106 | + $container->registerService('EntropyFunnellingAnalyzer', function($c) { |
|
| 107 | 107 | return new EntropyFunnellingAnalyzer( |
| 108 | 108 | $c->query(ILogger::class) |
| 109 | 109 | ); |
| 110 | 110 | }); |
| 111 | 111 | |
| 112 | - $container->registerService('FileExtensionAnalyzer', function ($c) { |
|
| 112 | + $container->registerService('FileExtensionAnalyzer', function($c) { |
|
| 113 | 113 | return new FileExtensionAnalyzer( |
| 114 | 114 | $c->query(ILogger::class), |
| 115 | 115 | $c->query(Entropy::class) |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ); |
| 118 | 118 | }); |
| 119 | 119 | |
| 120 | - $container->registerService('SequenceAnalyzer', function ($c) { |
|
| 120 | + $container->registerService('SequenceAnalyzer', function($c) { |
|
| 121 | 121 | return new SequenceAnalyzer( |
| 122 | 122 | $c->query(SequenceSizeAnalyzer::class), |
| 123 | 123 | $c->query(FileTypeFunnellingAnalyzer::class), |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | ); |
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | - $container->registerService('EntropyAnalyzer', function ($c) { |
|
| 128 | + $container->registerService('EntropyAnalyzer', function($c) { |
|
| 129 | 129 | return new EntropyAnalyzer( |
| 130 | 130 | $c->query(ILogger::class), |
| 131 | 131 | $c->query(IRootFolder::class), |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | ); |
| 135 | 135 | }); |
| 136 | 136 | |
| 137 | - $container->registerService('FileCorruptionAnalyzer', function ($c) { |
|
| 137 | + $container->registerService('FileCorruptionAnalyzer', function($c) { |
|
| 138 | 138 | return new FileCorruptionAnalyzer( |
| 139 | 139 | $c->query(ILogger::class), |
| 140 | 140 | $c->query(IRootFolder::class), |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | ); |
| 143 | 143 | }); |
| 144 | 144 | |
| 145 | - $container->registerService('Monitor', function ($c) { |
|
| 145 | + $container->registerService('Monitor', function($c) { |
|
| 146 | 146 | return new Monitor( |
| 147 | 147 | $c->query(IRequest::class), |
| 148 | 148 | $c->query(IConfig::class), |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | ); |
| 159 | 159 | }); |
| 160 | 160 | |
| 161 | - $container->registerService('FilesEvents', function ($c) { |
|
| 161 | + $container->registerService('FilesEvents', function($c) { |
|
| 162 | 162 | return new FilesEvents( |
| 163 | 163 | $c->query(ILogger::class), |
| 164 | 164 | $c->query(Monitor::class), |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | // register sabre plugin to catch the profind requests |
| 176 | 176 | $eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher(); |
| 177 | - $eventDispatcher->addListener('OCA\DAV\Connector\Sabre::addPlugin', function (SabrePluginEvent $event) { |
|
| 177 | + $eventDispatcher->addListener('OCA\DAV\Connector\Sabre::addPlugin', function(SabrePluginEvent $event) { |
|
| 178 | 178 | $logger = $this->getContainer()->query(ILogger::class); |
| 179 | 179 | $config = $this->getContainer()->query(IConfig::class); |
| 180 | 180 | $userSession = $this->getContainer()->query(IUserSession::class); |