|
1
|
|
|
<?php |
|
2
|
|
|
declare(strict_types=1); |
|
3
|
|
|
/** |
|
4
|
|
|
* @copyright Copyright (c) 2019 Joas Schilling <[email protected]> |
|
5
|
|
|
* |
|
6
|
|
|
* @license GNU AGPL version 3 or any later version |
|
7
|
|
|
* |
|
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
|
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
11
|
|
|
* License, or (at your option) any later version. |
|
12
|
|
|
* |
|
13
|
|
|
* This program is distributed in the hope that it will be useful, |
|
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16
|
|
|
* GNU Affero General Public License for more details. |
|
17
|
|
|
* |
|
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
|
19
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
20
|
|
|
* |
|
21
|
|
|
*/ |
|
22
|
|
|
|
|
23
|
|
|
namespace OC\Repair\NC16; |
|
24
|
|
|
|
|
25
|
|
|
use OC\Collaboration\Resources\Manager; |
|
26
|
|
|
use OCP\Collaboration\Resources\IManager; |
|
27
|
|
|
use OCP\IConfig; |
|
28
|
|
|
use OCP\Migration\IOutput; |
|
29
|
|
|
use OCP\Migration\IRepairStep; |
|
30
|
|
|
|
|
31
|
|
|
class ClearCollectionsAccessCache implements IRepairStep { |
|
32
|
|
|
|
|
33
|
|
|
/** @var IConfig */ |
|
34
|
|
|
private $config; |
|
35
|
|
|
|
|
36
|
|
|
/** @var IManager|Manager */ |
|
37
|
|
|
private $manager; |
|
38
|
|
|
|
|
39
|
|
|
public function __construct(IConfig $config, IManager $manager) { |
|
40
|
|
|
$this->config = $config; |
|
41
|
|
|
$this->manager = $manager; |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
public function getName(): string { |
|
45
|
|
|
return 'Clear access cache of projects'; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
private function shouldRun(): bool { |
|
49
|
|
|
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0'); |
|
50
|
|
|
return version_compare($versionFromBeforeUpdate, '17.0.0.3', '<='); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function run(IOutput $output): void { |
|
54
|
|
|
if ($this->shouldRun()) { |
|
55
|
|
|
$this->manager->invalidateAccessCacheForAllCollections(); |
|
|
|
|
|
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.