|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
/** |
|
5
|
|
|
* Circles - Bring cloud-users closer together. |
|
6
|
|
|
* |
|
7
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
|
8
|
|
|
* later. See the COPYING file. |
|
9
|
|
|
* |
|
10
|
|
|
* @author Maxence Lange <[email protected]> |
|
11
|
|
|
* @copyright 2017 |
|
12
|
|
|
* @license GNU AGPL version 3 or any later version |
|
13
|
|
|
* |
|
14
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
15
|
|
|
* it under the terms of the GNU Affero General Public License as |
|
16
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
17
|
|
|
* License, or (at your option) any later version. |
|
18
|
|
|
* |
|
19
|
|
|
* This program is distributed in the hope that it will be useful, |
|
20
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
21
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
22
|
|
|
* GNU Affero General Public License for more details. |
|
23
|
|
|
* |
|
24
|
|
|
* You should have received a copy of the GNU Affero General Public License |
|
25
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
26
|
|
|
* |
|
27
|
|
|
*/ |
|
28
|
|
|
|
|
29
|
|
|
|
|
30
|
|
|
namespace OCA\Circles\Cron; |
|
31
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
use OC\BackgroundJob\TimedJob; |
|
34
|
|
|
use OCA\Circles\AppInfo\Application; |
|
35
|
|
|
use OCA\Circles\Exceptions\GSStatusException; |
|
36
|
|
|
use OCA\Circles\Service\CirclesService; |
|
37
|
|
|
use OCA\Circles\Service\CleanService; |
|
38
|
|
|
use OCA\Circles\Service\GSUpstreamService; |
|
39
|
|
|
use OCA\Circles\Service\MembersService; |
|
40
|
|
|
use OCP\AppFramework\QueryException; |
|
41
|
|
|
|
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Class Maintenance |
|
45
|
|
|
* |
|
46
|
|
|
* @package OCA\Cicles\Cron |
|
47
|
|
|
*/ |
|
48
|
|
|
class Maintenance extends TimedJob { |
|
49
|
|
|
|
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Cache constructor. |
|
53
|
|
|
*/ |
|
54
|
|
|
public function __construct() { |
|
55
|
|
|
$this->setInterval(10); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @param $argument |
|
61
|
|
|
* |
|
62
|
|
|
* @throws QueryException |
|
63
|
|
|
*/ |
|
64
|
|
|
protected function run($argument) { |
|
65
|
|
|
$app = \OC::$server->query(Application::class); |
|
66
|
|
|
$c = $app->getContainer(); |
|
|
|
|
|
|
67
|
|
|
|
|
68
|
|
|
/** @var CleanService $cleanService */ |
|
69
|
|
|
$cleanService = \OC::$server->query(CleanService::class); |
|
70
|
|
|
$cleanService->clean(); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
|
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.