@@ -29,140 +29,140 @@ |
||
29 | 29 | use OCP\Profiler\IProfile; |
30 | 30 | |
31 | 31 | class Profile implements \JsonSerializable, IProfile { |
32 | - private string $token; |
|
32 | + private string $token; |
|
33 | 33 | |
34 | - private ?int $time = null; |
|
34 | + private ?int $time = null; |
|
35 | 35 | |
36 | - private ?string $url = null; |
|
36 | + private ?string $url = null; |
|
37 | 37 | |
38 | - private ?string $method = null; |
|
38 | + private ?string $method = null; |
|
39 | 39 | |
40 | - private ?int $statusCode = null; |
|
40 | + private ?int $statusCode = null; |
|
41 | 41 | |
42 | - /** @var array<string, IDataCollector> */ |
|
43 | - private array $collectors = []; |
|
42 | + /** @var array<string, IDataCollector> */ |
|
43 | + private array $collectors = []; |
|
44 | 44 | |
45 | - private ?IProfile $parent = null; |
|
45 | + private ?IProfile $parent = null; |
|
46 | 46 | |
47 | - /** @var IProfile[] */ |
|
48 | - private array $children = []; |
|
47 | + /** @var IProfile[] */ |
|
48 | + private array $children = []; |
|
49 | 49 | |
50 | - public function __construct(string $token) { |
|
51 | - $this->token = $token; |
|
52 | - } |
|
53 | - |
|
54 | - public function getToken(): string { |
|
55 | - return $this->token; |
|
56 | - } |
|
57 | - |
|
58 | - public function setToken(string $token): void { |
|
59 | - $this->token = $token; |
|
60 | - } |
|
61 | - |
|
62 | - public function getTime(): ?int { |
|
63 | - return $this->time; |
|
64 | - } |
|
65 | - |
|
66 | - public function setTime(int $time): void { |
|
67 | - $this->time = $time; |
|
68 | - } |
|
69 | - |
|
70 | - public function getUrl(): ?string { |
|
71 | - return $this->url; |
|
72 | - } |
|
73 | - |
|
74 | - public function setUrl(string $url): void { |
|
75 | - $this->url = $url; |
|
76 | - } |
|
77 | - |
|
78 | - public function getMethod(): ?string { |
|
79 | - return $this->method; |
|
80 | - } |
|
81 | - |
|
82 | - public function setMethod(string $method): void { |
|
83 | - $this->method = $method; |
|
84 | - } |
|
85 | - |
|
86 | - public function getStatusCode(): ?int { |
|
87 | - return $this->statusCode; |
|
88 | - } |
|
89 | - |
|
90 | - public function setStatusCode(int $statusCode): void { |
|
91 | - $this->statusCode = $statusCode; |
|
92 | - } |
|
93 | - |
|
94 | - public function addCollector(IDataCollector $collector) { |
|
95 | - $this->collectors[$collector->getName()] = $collector; |
|
96 | - } |
|
97 | - |
|
98 | - public function getParent(): ?IProfile { |
|
99 | - return $this->parent; |
|
100 | - } |
|
101 | - |
|
102 | - public function setParent(?IProfile $parent): void { |
|
103 | - $this->parent = $parent; |
|
104 | - } |
|
105 | - |
|
106 | - public function getParentToken(): ?string { |
|
107 | - return $this->parent ? $this->parent->getToken() : null; |
|
108 | - } |
|
109 | - |
|
110 | - /** @return IProfile[] */ |
|
111 | - public function getChildren(): array { |
|
112 | - return $this->children; |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * @param IProfile[] $children |
|
117 | - */ |
|
118 | - public function setChildren(array $children): void { |
|
119 | - $this->children = []; |
|
120 | - foreach ($children as $child) { |
|
121 | - $this->addChild($child); |
|
122 | - } |
|
123 | - } |
|
124 | - |
|
125 | - public function addChild(IProfile $profile): void { |
|
126 | - $this->children[] = $profile; |
|
127 | - $profile->setParent($this); |
|
128 | - } |
|
129 | - |
|
130 | - /** |
|
131 | - * @return IDataCollector[] |
|
132 | - */ |
|
133 | - public function getCollectors(): array { |
|
134 | - return $this->collectors; |
|
135 | - } |
|
136 | - |
|
137 | - /** |
|
138 | - * @param IDataCollector[] $collectors |
|
139 | - */ |
|
140 | - public function setCollectors(array $collectors): void { |
|
141 | - $this->collectors = $collectors; |
|
142 | - } |
|
143 | - |
|
144 | - public function __sleep(): array { |
|
145 | - return ['token', 'parent', 'children', 'collectors', 'method', 'url', 'time', 'statusCode']; |
|
146 | - } |
|
147 | - |
|
148 | - #[\ReturnTypeWillChange] |
|
149 | - public function jsonSerialize() { |
|
150 | - // Everything but parent |
|
151 | - return [ |
|
152 | - 'token' => $this->token, |
|
153 | - 'method' => $this->method, |
|
154 | - 'children' => $this->children, |
|
155 | - 'url' => $this->url, |
|
156 | - 'statusCode' => $this->statusCode, |
|
157 | - 'time' => $this->time, |
|
158 | - 'collectors' => $this->collectors, |
|
159 | - ]; |
|
160 | - } |
|
161 | - |
|
162 | - public function getCollector(string $collectorName): ?IDataCollector { |
|
163 | - if (!array_key_exists($collectorName, $this->collectors)) { |
|
164 | - return null; |
|
165 | - } |
|
166 | - return $this->collectors[$collectorName]; |
|
167 | - } |
|
50 | + public function __construct(string $token) { |
|
51 | + $this->token = $token; |
|
52 | + } |
|
53 | + |
|
54 | + public function getToken(): string { |
|
55 | + return $this->token; |
|
56 | + } |
|
57 | + |
|
58 | + public function setToken(string $token): void { |
|
59 | + $this->token = $token; |
|
60 | + } |
|
61 | + |
|
62 | + public function getTime(): ?int { |
|
63 | + return $this->time; |
|
64 | + } |
|
65 | + |
|
66 | + public function setTime(int $time): void { |
|
67 | + $this->time = $time; |
|
68 | + } |
|
69 | + |
|
70 | + public function getUrl(): ?string { |
|
71 | + return $this->url; |
|
72 | + } |
|
73 | + |
|
74 | + public function setUrl(string $url): void { |
|
75 | + $this->url = $url; |
|
76 | + } |
|
77 | + |
|
78 | + public function getMethod(): ?string { |
|
79 | + return $this->method; |
|
80 | + } |
|
81 | + |
|
82 | + public function setMethod(string $method): void { |
|
83 | + $this->method = $method; |
|
84 | + } |
|
85 | + |
|
86 | + public function getStatusCode(): ?int { |
|
87 | + return $this->statusCode; |
|
88 | + } |
|
89 | + |
|
90 | + public function setStatusCode(int $statusCode): void { |
|
91 | + $this->statusCode = $statusCode; |
|
92 | + } |
|
93 | + |
|
94 | + public function addCollector(IDataCollector $collector) { |
|
95 | + $this->collectors[$collector->getName()] = $collector; |
|
96 | + } |
|
97 | + |
|
98 | + public function getParent(): ?IProfile { |
|
99 | + return $this->parent; |
|
100 | + } |
|
101 | + |
|
102 | + public function setParent(?IProfile $parent): void { |
|
103 | + $this->parent = $parent; |
|
104 | + } |
|
105 | + |
|
106 | + public function getParentToken(): ?string { |
|
107 | + return $this->parent ? $this->parent->getToken() : null; |
|
108 | + } |
|
109 | + |
|
110 | + /** @return IProfile[] */ |
|
111 | + public function getChildren(): array { |
|
112 | + return $this->children; |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * @param IProfile[] $children |
|
117 | + */ |
|
118 | + public function setChildren(array $children): void { |
|
119 | + $this->children = []; |
|
120 | + foreach ($children as $child) { |
|
121 | + $this->addChild($child); |
|
122 | + } |
|
123 | + } |
|
124 | + |
|
125 | + public function addChild(IProfile $profile): void { |
|
126 | + $this->children[] = $profile; |
|
127 | + $profile->setParent($this); |
|
128 | + } |
|
129 | + |
|
130 | + /** |
|
131 | + * @return IDataCollector[] |
|
132 | + */ |
|
133 | + public function getCollectors(): array { |
|
134 | + return $this->collectors; |
|
135 | + } |
|
136 | + |
|
137 | + /** |
|
138 | + * @param IDataCollector[] $collectors |
|
139 | + */ |
|
140 | + public function setCollectors(array $collectors): void { |
|
141 | + $this->collectors = $collectors; |
|
142 | + } |
|
143 | + |
|
144 | + public function __sleep(): array { |
|
145 | + return ['token', 'parent', 'children', 'collectors', 'method', 'url', 'time', 'statusCode']; |
|
146 | + } |
|
147 | + |
|
148 | + #[\ReturnTypeWillChange] |
|
149 | + public function jsonSerialize() { |
|
150 | + // Everything but parent |
|
151 | + return [ |
|
152 | + 'token' => $this->token, |
|
153 | + 'method' => $this->method, |
|
154 | + 'children' => $this->children, |
|
155 | + 'url' => $this->url, |
|
156 | + 'statusCode' => $this->statusCode, |
|
157 | + 'time' => $this->time, |
|
158 | + 'collectors' => $this->collectors, |
|
159 | + ]; |
|
160 | + } |
|
161 | + |
|
162 | + public function getCollector(string $collectorName): ?IDataCollector { |
|
163 | + if (!array_key_exists($collectorName, $this->collectors)) { |
|
164 | + return null; |
|
165 | + } |
|
166 | + return $this->collectors[$collectorName]; |
|
167 | + } |
|
168 | 168 | } |
@@ -35,22 +35,22 @@ |
||
35 | 35 | * Auto-generated migration step: Please modify to your needs! |
36 | 36 | */ |
37 | 37 | class Version24000Date20220404142216 extends SimpleMigrationStep { |
38 | - /** |
|
39 | - * @param IOutput $output |
|
40 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | - * @param array $options |
|
42 | - * @return null|ISchemaWrapper |
|
43 | - */ |
|
44 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
45 | - /** @var ISchemaWrapper $schema */ |
|
46 | - $schema = $schemaClosure(); |
|
38 | + /** |
|
39 | + * @param IOutput $output |
|
40 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | + * @param array $options |
|
42 | + * @return null|ISchemaWrapper |
|
43 | + */ |
|
44 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
45 | + /** @var ISchemaWrapper $schema */ |
|
46 | + $schema = $schemaClosure(); |
|
47 | 47 | |
48 | - $table = $schema->getTable('share_external'); |
|
49 | - $column = $table->getColumn('name'); |
|
50 | - if ($column->getLength() < 4000) { |
|
51 | - $column->setLength(4000); |
|
52 | - return $schema; |
|
53 | - } |
|
54 | - return null; |
|
55 | - } |
|
48 | + $table = $schema->getTable('share_external'); |
|
49 | + $column = $table->getColumn('name'); |
|
50 | + if ($column->getLength() < 4000) { |
|
51 | + $column->setLength(4000); |
|
52 | + return $schema; |
|
53 | + } |
|
54 | + return null; |
|
55 | + } |
|
56 | 56 | } |
@@ -29,71 +29,71 @@ |
||
29 | 29 | * @since 8.0.0 |
30 | 30 | */ |
31 | 31 | interface IMountProviderCollection { |
32 | - /** |
|
33 | - * Get all configured mount points for the user |
|
34 | - * |
|
35 | - * @param \OCP\IUser $user |
|
36 | - * @return \OCP\Files\Mount\IMountPoint[] |
|
37 | - * @since 8.0.0 |
|
38 | - */ |
|
39 | - public function getMountsForUser(IUser $user); |
|
32 | + /** |
|
33 | + * Get all configured mount points for the user |
|
34 | + * |
|
35 | + * @param \OCP\IUser $user |
|
36 | + * @return \OCP\Files\Mount\IMountPoint[] |
|
37 | + * @since 8.0.0 |
|
38 | + */ |
|
39 | + public function getMountsForUser(IUser $user); |
|
40 | 40 | |
41 | - /** |
|
42 | - * Get the configured mount points for the user from a specific mount provider |
|
43 | - * |
|
44 | - * @param \OCP\IUser $user |
|
45 | - * @param class-string<IMountProvider>[] $mountProviderClasses |
|
46 | - * @return \OCP\Files\Mount\IMountPoint[] |
|
47 | - * @since 24.0.0 |
|
48 | - */ |
|
49 | - public function getUserMountsForProviderClasses(IUser $user, array $mountProviderClasses): array; |
|
41 | + /** |
|
42 | + * Get the configured mount points for the user from a specific mount provider |
|
43 | + * |
|
44 | + * @param \OCP\IUser $user |
|
45 | + * @param class-string<IMountProvider>[] $mountProviderClasses |
|
46 | + * @return \OCP\Files\Mount\IMountPoint[] |
|
47 | + * @since 24.0.0 |
|
48 | + */ |
|
49 | + public function getUserMountsForProviderClasses(IUser $user, array $mountProviderClasses): array; |
|
50 | 50 | |
51 | - /** |
|
52 | - * Get the configured home mount for this user |
|
53 | - * |
|
54 | - * @param \OCP\IUser $user |
|
55 | - * @return \OCP\Files\Mount\IMountPoint |
|
56 | - * @since 9.1.0 |
|
57 | - */ |
|
58 | - public function getHomeMountForUser(IUser $user); |
|
51 | + /** |
|
52 | + * Get the configured home mount for this user |
|
53 | + * |
|
54 | + * @param \OCP\IUser $user |
|
55 | + * @return \OCP\Files\Mount\IMountPoint |
|
56 | + * @since 9.1.0 |
|
57 | + */ |
|
58 | + public function getHomeMountForUser(IUser $user); |
|
59 | 59 | |
60 | - /** |
|
61 | - * Add a provider for mount points |
|
62 | - * |
|
63 | - * @param \OCP\Files\Config\IMountProvider $provider |
|
64 | - * @since 8.0.0 |
|
65 | - */ |
|
66 | - public function registerProvider(IMountProvider $provider); |
|
60 | + /** |
|
61 | + * Add a provider for mount points |
|
62 | + * |
|
63 | + * @param \OCP\Files\Config\IMountProvider $provider |
|
64 | + * @since 8.0.0 |
|
65 | + */ |
|
66 | + public function registerProvider(IMountProvider $provider); |
|
67 | 67 | |
68 | - /** |
|
69 | - * Add a filter for mounts |
|
70 | - * |
|
71 | - * @param callable $filter (IMountPoint $mountPoint, IUser $user) => boolean |
|
72 | - * @since 14.0.0 |
|
73 | - */ |
|
74 | - public function registerMountFilter(callable $filter); |
|
68 | + /** |
|
69 | + * Add a filter for mounts |
|
70 | + * |
|
71 | + * @param callable $filter (IMountPoint $mountPoint, IUser $user) => boolean |
|
72 | + * @since 14.0.0 |
|
73 | + */ |
|
74 | + public function registerMountFilter(callable $filter); |
|
75 | 75 | |
76 | - /** |
|
77 | - * Add a provider for home mount points |
|
78 | - * |
|
79 | - * @param \OCP\Files\Config\IHomeMountProvider $provider |
|
80 | - * @since 9.1.0 |
|
81 | - */ |
|
82 | - public function registerHomeProvider(IHomeMountProvider $provider); |
|
76 | + /** |
|
77 | + * Add a provider for home mount points |
|
78 | + * |
|
79 | + * @param \OCP\Files\Config\IHomeMountProvider $provider |
|
80 | + * @since 9.1.0 |
|
81 | + */ |
|
82 | + public function registerHomeProvider(IHomeMountProvider $provider); |
|
83 | 83 | |
84 | - /** |
|
85 | - * Get the mount cache which can be used to search for mounts without setting up the filesystem |
|
86 | - * |
|
87 | - * @return IUserMountCache |
|
88 | - * @since 9.0.0 |
|
89 | - */ |
|
90 | - public function getMountCache(); |
|
84 | + /** |
|
85 | + * Get the mount cache which can be used to search for mounts without setting up the filesystem |
|
86 | + * |
|
87 | + * @return IUserMountCache |
|
88 | + * @since 9.0.0 |
|
89 | + */ |
|
90 | + public function getMountCache(); |
|
91 | 91 | |
92 | - /** |
|
93 | - * Get all root mountpoints |
|
94 | - * |
|
95 | - * @return \OCP\Files\Mount\IMountPoint[] |
|
96 | - * @since 20.0.0 |
|
97 | - */ |
|
98 | - public function getRootMounts(): array; |
|
92 | + /** |
|
93 | + * Get all root mountpoints |
|
94 | + * |
|
95 | + * @return \OCP\Files\Mount\IMountPoint[] |
|
96 | + * @since 20.0.0 |
|
97 | + */ |
|
98 | + public function getRootMounts(): array; |
|
99 | 99 | } |
@@ -32,22 +32,22 @@ |
||
32 | 32 | * @since 24.0.0 |
33 | 33 | */ |
34 | 34 | class OwnerLockedException extends LockedException { |
35 | - private ILock $lock; |
|
35 | + private ILock $lock; |
|
36 | 36 | |
37 | - /** |
|
38 | - * @since 24.0.0 |
|
39 | - */ |
|
40 | - public function __construct(ILock $lock) { |
|
41 | - $this->lock = $lock; |
|
42 | - $path = ''; |
|
43 | - $readablePath = ''; |
|
44 | - parent::__construct($path, null, $lock->getOwner(), $readablePath); |
|
45 | - } |
|
37 | + /** |
|
38 | + * @since 24.0.0 |
|
39 | + */ |
|
40 | + public function __construct(ILock $lock) { |
|
41 | + $this->lock = $lock; |
|
42 | + $path = ''; |
|
43 | + $readablePath = ''; |
|
44 | + parent::__construct($path, null, $lock->getOwner(), $readablePath); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @since 24.0.0 |
|
49 | - */ |
|
50 | - public function getLock(): ILock { |
|
51 | - return $this->lock; |
|
52 | - } |
|
47 | + /** |
|
48 | + * @since 24.0.0 |
|
49 | + */ |
|
50 | + public function getLock(): ILock { |
|
51 | + return $this->lock; |
|
52 | + } |
|
53 | 53 | } |
@@ -34,122 +34,122 @@ |
||
34 | 34 | use OCP\Migration\SimpleMigrationStep; |
35 | 35 | |
36 | 36 | class Version1011Date20200630192246 extends SimpleMigrationStep { |
37 | - /** |
|
38 | - * @param IOutput $output |
|
39 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
40 | - * @param array $options |
|
41 | - * @return null|ISchemaWrapper |
|
42 | - */ |
|
43 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
44 | - /** @var ISchemaWrapper $schema */ |
|
45 | - $schema = $schemaClosure(); |
|
37 | + /** |
|
38 | + * @param IOutput $output |
|
39 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
40 | + * @param array $options |
|
41 | + * @return null|ISchemaWrapper |
|
42 | + */ |
|
43 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
44 | + /** @var ISchemaWrapper $schema */ |
|
45 | + $schema = $schemaClosure(); |
|
46 | 46 | |
47 | - if (!$schema->hasTable('external_mounts')) { |
|
48 | - $table = $schema->createTable('external_mounts'); |
|
49 | - $table->addColumn('mount_id', Types::BIGINT, [ |
|
50 | - 'autoincrement' => true, |
|
51 | - 'notnull' => true, |
|
52 | - 'length' => 6, |
|
53 | - ]); |
|
54 | - $table->addColumn('mount_point', Types::STRING, [ |
|
55 | - 'notnull' => true, |
|
56 | - 'length' => 128, |
|
57 | - ]); |
|
58 | - $table->addColumn('storage_backend', Types::STRING, [ |
|
59 | - 'notnull' => true, |
|
60 | - 'length' => 64, |
|
61 | - ]); |
|
62 | - $table->addColumn('auth_backend', Types::STRING, [ |
|
63 | - 'notnull' => true, |
|
64 | - 'length' => 64, |
|
65 | - ]); |
|
66 | - $table->addColumn('priority', Types::INTEGER, [ |
|
67 | - 'notnull' => true, |
|
68 | - 'length' => 4, |
|
69 | - 'default' => 100, |
|
70 | - ]); |
|
71 | - $table->addColumn('type', Types::INTEGER, [ |
|
72 | - 'notnull' => true, |
|
73 | - 'length' => 4, |
|
74 | - ]); |
|
75 | - $table->setPrimaryKey(['mount_id']); |
|
76 | - } |
|
47 | + if (!$schema->hasTable('external_mounts')) { |
|
48 | + $table = $schema->createTable('external_mounts'); |
|
49 | + $table->addColumn('mount_id', Types::BIGINT, [ |
|
50 | + 'autoincrement' => true, |
|
51 | + 'notnull' => true, |
|
52 | + 'length' => 6, |
|
53 | + ]); |
|
54 | + $table->addColumn('mount_point', Types::STRING, [ |
|
55 | + 'notnull' => true, |
|
56 | + 'length' => 128, |
|
57 | + ]); |
|
58 | + $table->addColumn('storage_backend', Types::STRING, [ |
|
59 | + 'notnull' => true, |
|
60 | + 'length' => 64, |
|
61 | + ]); |
|
62 | + $table->addColumn('auth_backend', Types::STRING, [ |
|
63 | + 'notnull' => true, |
|
64 | + 'length' => 64, |
|
65 | + ]); |
|
66 | + $table->addColumn('priority', Types::INTEGER, [ |
|
67 | + 'notnull' => true, |
|
68 | + 'length' => 4, |
|
69 | + 'default' => 100, |
|
70 | + ]); |
|
71 | + $table->addColumn('type', Types::INTEGER, [ |
|
72 | + 'notnull' => true, |
|
73 | + 'length' => 4, |
|
74 | + ]); |
|
75 | + $table->setPrimaryKey(['mount_id']); |
|
76 | + } |
|
77 | 77 | |
78 | - if (!$schema->hasTable('external_applicable')) { |
|
79 | - $table = $schema->createTable('external_applicable'); |
|
80 | - $table->addColumn('applicable_id', Types::BIGINT, [ |
|
81 | - 'autoincrement' => true, |
|
82 | - 'notnull' => true, |
|
83 | - 'length' => 6, |
|
84 | - ]); |
|
85 | - $table->addColumn('mount_id', Types::BIGINT, [ |
|
86 | - 'notnull' => true, |
|
87 | - 'length' => 6, |
|
88 | - ]); |
|
89 | - $table->addColumn('type', Types::INTEGER, [ |
|
90 | - 'notnull' => true, |
|
91 | - 'length' => 4, |
|
92 | - ]); |
|
93 | - $table->addColumn('value', Types::STRING, [ |
|
94 | - 'notnull' => false, |
|
95 | - 'length' => 64, |
|
96 | - ]); |
|
97 | - $table->setPrimaryKey(['applicable_id']); |
|
98 | - $table->addIndex(['mount_id'], 'applicable_mount'); |
|
99 | - $table->addUniqueIndex(['type', 'value', 'mount_id'], 'applicable_type_value_mount'); |
|
100 | - } |
|
78 | + if (!$schema->hasTable('external_applicable')) { |
|
79 | + $table = $schema->createTable('external_applicable'); |
|
80 | + $table->addColumn('applicable_id', Types::BIGINT, [ |
|
81 | + 'autoincrement' => true, |
|
82 | + 'notnull' => true, |
|
83 | + 'length' => 6, |
|
84 | + ]); |
|
85 | + $table->addColumn('mount_id', Types::BIGINT, [ |
|
86 | + 'notnull' => true, |
|
87 | + 'length' => 6, |
|
88 | + ]); |
|
89 | + $table->addColumn('type', Types::INTEGER, [ |
|
90 | + 'notnull' => true, |
|
91 | + 'length' => 4, |
|
92 | + ]); |
|
93 | + $table->addColumn('value', Types::STRING, [ |
|
94 | + 'notnull' => false, |
|
95 | + 'length' => 64, |
|
96 | + ]); |
|
97 | + $table->setPrimaryKey(['applicable_id']); |
|
98 | + $table->addIndex(['mount_id'], 'applicable_mount'); |
|
99 | + $table->addUniqueIndex(['type', 'value', 'mount_id'], 'applicable_type_value_mount'); |
|
100 | + } |
|
101 | 101 | |
102 | - if (!$schema->hasTable('external_config')) { |
|
103 | - $table = $schema->createTable('external_config'); |
|
104 | - $table->addColumn('config_id', Types::BIGINT, [ |
|
105 | - 'autoincrement' => true, |
|
106 | - 'notnull' => true, |
|
107 | - 'length' => 6, |
|
108 | - ]); |
|
109 | - $table->addColumn('mount_id', Types::BIGINT, [ |
|
110 | - 'notnull' => true, |
|
111 | - 'length' => 6, |
|
112 | - ]); |
|
113 | - $table->addColumn('key', Types::STRING, [ |
|
114 | - 'notnull' => true, |
|
115 | - 'length' => 64, |
|
116 | - ]); |
|
117 | - $table->addColumn('value', Types::STRING, [ |
|
118 | - 'notnull' => false, |
|
119 | - 'length' => 4000, |
|
120 | - ]); |
|
121 | - $table->setPrimaryKey(['config_id']); |
|
122 | - $table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key'); |
|
123 | - } else { |
|
124 | - $table = $schema->getTable('external_config'); |
|
125 | - $table->changeColumn('value', [ |
|
126 | - 'notnull' => false, |
|
127 | - 'length' => 4000, |
|
128 | - ]); |
|
129 | - } |
|
102 | + if (!$schema->hasTable('external_config')) { |
|
103 | + $table = $schema->createTable('external_config'); |
|
104 | + $table->addColumn('config_id', Types::BIGINT, [ |
|
105 | + 'autoincrement' => true, |
|
106 | + 'notnull' => true, |
|
107 | + 'length' => 6, |
|
108 | + ]); |
|
109 | + $table->addColumn('mount_id', Types::BIGINT, [ |
|
110 | + 'notnull' => true, |
|
111 | + 'length' => 6, |
|
112 | + ]); |
|
113 | + $table->addColumn('key', Types::STRING, [ |
|
114 | + 'notnull' => true, |
|
115 | + 'length' => 64, |
|
116 | + ]); |
|
117 | + $table->addColumn('value', Types::STRING, [ |
|
118 | + 'notnull' => false, |
|
119 | + 'length' => 4000, |
|
120 | + ]); |
|
121 | + $table->setPrimaryKey(['config_id']); |
|
122 | + $table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key'); |
|
123 | + } else { |
|
124 | + $table = $schema->getTable('external_config'); |
|
125 | + $table->changeColumn('value', [ |
|
126 | + 'notnull' => false, |
|
127 | + 'length' => 4000, |
|
128 | + ]); |
|
129 | + } |
|
130 | 130 | |
131 | - if (!$schema->hasTable('external_options')) { |
|
132 | - $table = $schema->createTable('external_options'); |
|
133 | - $table->addColumn('option_id', Types::BIGINT, [ |
|
134 | - 'autoincrement' => true, |
|
135 | - 'notnull' => true, |
|
136 | - 'length' => 6, |
|
137 | - ]); |
|
138 | - $table->addColumn('mount_id', Types::BIGINT, [ |
|
139 | - 'notnull' => true, |
|
140 | - 'length' => 6, |
|
141 | - ]); |
|
142 | - $table->addColumn('key', Types::STRING, [ |
|
143 | - 'notnull' => true, |
|
144 | - 'length' => 64, |
|
145 | - ]); |
|
146 | - $table->addColumn('value', Types::STRING, [ |
|
147 | - 'notnull' => true, |
|
148 | - 'length' => 256, |
|
149 | - ]); |
|
150 | - $table->setPrimaryKey(['option_id']); |
|
151 | - $table->addUniqueIndex(['mount_id', 'key'], 'option_mount_key'); |
|
152 | - } |
|
153 | - return $schema; |
|
154 | - } |
|
131 | + if (!$schema->hasTable('external_options')) { |
|
132 | + $table = $schema->createTable('external_options'); |
|
133 | + $table->addColumn('option_id', Types::BIGINT, [ |
|
134 | + 'autoincrement' => true, |
|
135 | + 'notnull' => true, |
|
136 | + 'length' => 6, |
|
137 | + ]); |
|
138 | + $table->addColumn('mount_id', Types::BIGINT, [ |
|
139 | + 'notnull' => true, |
|
140 | + 'length' => 6, |
|
141 | + ]); |
|
142 | + $table->addColumn('key', Types::STRING, [ |
|
143 | + 'notnull' => true, |
|
144 | + 'length' => 64, |
|
145 | + ]); |
|
146 | + $table->addColumn('value', Types::STRING, [ |
|
147 | + 'notnull' => true, |
|
148 | + 'length' => 256, |
|
149 | + ]); |
|
150 | + $table->setPrimaryKey(['option_id']); |
|
151 | + $table->addUniqueIndex(['mount_id', 'key'], 'option_mount_key'); |
|
152 | + } |
|
153 | + return $schema; |
|
154 | + } |
|
155 | 155 | } |
@@ -33,19 +33,19 @@ |
||
33 | 33 | |
34 | 34 | class Version24000Date20220208195521 extends SimpleMigrationStep { |
35 | 35 | |
36 | - /** |
|
37 | - * @param IOutput $output |
|
38 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 | - * @param array $options |
|
40 | - * @return null|ISchemaWrapper |
|
41 | - */ |
|
42 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
43 | - $schema = $schemaClosure(); |
|
44 | - $table = $schema->getTable('share'); |
|
45 | - $table->addColumn('password_expiration_time', Types::DATETIME, [ |
|
46 | - 'notnull' => false, |
|
47 | - ]); |
|
48 | - return $schema; |
|
49 | - } |
|
36 | + /** |
|
37 | + * @param IOutput $output |
|
38 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 | + * @param array $options |
|
40 | + * @return null|ISchemaWrapper |
|
41 | + */ |
|
42 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
43 | + $schema = $schemaClosure(); |
|
44 | + $table = $schema->getTable('share'); |
|
45 | + $table->addColumn('password_expiration_time', Types::DATETIME, [ |
|
46 | + 'notnull' => false, |
|
47 | + ]); |
|
48 | + return $schema; |
|
49 | + } |
|
50 | 50 | |
51 | 51 | } |
@@ -32,22 +32,22 @@ |
||
32 | 32 | use OCP\Migration\SimpleMigrationStep; |
33 | 33 | |
34 | 34 | class Version24000Date20220425072957 extends SimpleMigrationStep { |
35 | - /** |
|
36 | - * @param IOutput $output |
|
37 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | - * @param array $options |
|
39 | - * @return null|ISchemaWrapper |
|
40 | - */ |
|
41 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
42 | - /** @var ISchemaWrapper $schema */ |
|
43 | - $schema = $schemaClosure(); |
|
35 | + /** |
|
36 | + * @param IOutput $output |
|
37 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | + * @param array $options |
|
39 | + * @return null|ISchemaWrapper |
|
40 | + */ |
|
41 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
42 | + /** @var ISchemaWrapper $schema */ |
|
43 | + $schema = $schemaClosure(); |
|
44 | 44 | |
45 | - $table = $schema->getTable('mounts'); |
|
46 | - if (!$table->hasIndex('mount_user_storage')) { |
|
47 | - $table->addIndex(['storage_id', 'user_id'], 'mount_user_storage'); |
|
48 | - return $schema; |
|
49 | - } |
|
45 | + $table = $schema->getTable('mounts'); |
|
46 | + if (!$table->hasIndex('mount_user_storage')) { |
|
47 | + $table->addIndex(['storage_id', 'user_id'], 'mount_user_storage'); |
|
48 | + return $schema; |
|
49 | + } |
|
50 | 50 | |
51 | - return null; |
|
52 | - } |
|
51 | + return null; |
|
52 | + } |
|
53 | 53 | } |
@@ -27,13 +27,13 @@ |
||
27 | 27 | * @since 24.0.0 |
28 | 28 | */ |
29 | 29 | interface IEmojiHelper { |
30 | - /** |
|
31 | - * @since 24.0.0 |
|
32 | - */ |
|
33 | - public function doesPlatformSupportEmoji(): bool; |
|
30 | + /** |
|
31 | + * @since 24.0.0 |
|
32 | + */ |
|
33 | + public function doesPlatformSupportEmoji(): bool; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @since 24.0.0 |
|
37 | - */ |
|
38 | - public function isValidSingleEmoji(string $emoji): bool; |
|
35 | + /** |
|
36 | + * @since 24.0.0 |
|
37 | + */ |
|
38 | + public function isValidSingleEmoji(string $emoji): bool; |
|
39 | 39 | } |
@@ -36,47 +36,47 @@ |
||
36 | 36 | * @since 8.1.0 |
37 | 37 | */ |
38 | 38 | interface ILockingProvider { |
39 | - /** |
|
40 | - * @since 8.1.0 |
|
41 | - */ |
|
42 | - public const LOCK_SHARED = 1; |
|
43 | - /** |
|
44 | - * @since 8.1.0 |
|
45 | - */ |
|
46 | - public const LOCK_EXCLUSIVE = 2; |
|
39 | + /** |
|
40 | + * @since 8.1.0 |
|
41 | + */ |
|
42 | + public const LOCK_SHARED = 1; |
|
43 | + /** |
|
44 | + * @since 8.1.0 |
|
45 | + */ |
|
46 | + public const LOCK_EXCLUSIVE = 2; |
|
47 | 47 | |
48 | - /** |
|
49 | - * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $type |
|
50 | - * @since 8.1.0 |
|
51 | - */ |
|
52 | - public function isLocked(string $path, int $type): bool; |
|
48 | + /** |
|
49 | + * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $type |
|
50 | + * @since 8.1.0 |
|
51 | + */ |
|
52 | + public function isLocked(string $path, int $type): bool; |
|
53 | 53 | |
54 | - /** |
|
55 | - * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $type |
|
56 | - * @param ?string $readablePath A human-readable path to use in error messages, since 20.0.0 |
|
57 | - * @throws LockedException |
|
58 | - * @since 8.1.0 |
|
59 | - */ |
|
60 | - public function acquireLock(string $path, int $type, ?string $readablePath = null): void; |
|
54 | + /** |
|
55 | + * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $type |
|
56 | + * @param ?string $readablePath A human-readable path to use in error messages, since 20.0.0 |
|
57 | + * @throws LockedException |
|
58 | + * @since 8.1.0 |
|
59 | + */ |
|
60 | + public function acquireLock(string $path, int $type, ?string $readablePath = null): void; |
|
61 | 61 | |
62 | - /** |
|
63 | - * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $type |
|
64 | - * @since 8.1.0 |
|
65 | - */ |
|
66 | - public function releaseLock(string $path, int $type): void; |
|
62 | + /** |
|
63 | + * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $type |
|
64 | + * @since 8.1.0 |
|
65 | + */ |
|
66 | + public function releaseLock(string $path, int $type): void; |
|
67 | 67 | |
68 | - /** |
|
69 | - * Change the target type of an existing lock |
|
70 | - * |
|
71 | - * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $targetType |
|
72 | - * @throws LockedException |
|
73 | - * @since 8.1.0 |
|
74 | - */ |
|
75 | - public function changeLock(string $path, int $targetType): void; |
|
68 | + /** |
|
69 | + * Change the target type of an existing lock |
|
70 | + * |
|
71 | + * @psalm-param self::LOCK_SHARED|self::LOCK_EXCLUSIVE $targetType |
|
72 | + * @throws LockedException |
|
73 | + * @since 8.1.0 |
|
74 | + */ |
|
75 | + public function changeLock(string $path, int $targetType): void; |
|
76 | 76 | |
77 | - /** |
|
78 | - * Release all lock acquired by this instance |
|
79 | - * @since 8.1.0 |
|
80 | - */ |
|
81 | - public function releaseAll(): void; |
|
77 | + /** |
|
78 | + * Release all lock acquired by this instance |
|
79 | + * @since 8.1.0 |
|
80 | + */ |
|
81 | + public function releaseAll(): void; |
|
82 | 82 | } |