@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $notification->setParsedSubject($l->t('Update to %1$s is available.', [$parameters['version']])); |
109 | 109 | |
110 | 110 | if ($this->isAdmin()) { |
111 | - $notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']) . '#version'); |
|
111 | + $notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']).'#version'); |
|
112 | 112 | } |
113 | 113 | } else { |
114 | 114 | $appInfo = $this->getAppInfo($notification->getObjectType()); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ]); |
129 | 129 | |
130 | 130 | if ($this->isAdmin()) { |
131 | - $notification->setLink($this->url->linkToRouteAbsolute('settings.AppSettings.viewApps', ['category' => 'updates']) . '#app-' . $notification->getObjectType()); |
|
131 | + $notification->setLink($this->url->linkToRouteAbsolute('settings.AppSettings.viewApps', ['category' => 'updates']).'#app-'.$notification->getObjectType()); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 |
@@ -39,161 +39,161 @@ |
||
39 | 39 | |
40 | 40 | class Notifier implements INotifier { |
41 | 41 | |
42 | - /** @var IURLGenerator */ |
|
43 | - protected $url; |
|
44 | - |
|
45 | - /** @var IConfig */ |
|
46 | - protected $config; |
|
47 | - |
|
48 | - /** @var IManager */ |
|
49 | - protected $notificationManager; |
|
50 | - |
|
51 | - /** @var IFactory */ |
|
52 | - protected $l10NFactory; |
|
53 | - |
|
54 | - /** @var IUserSession */ |
|
55 | - protected $userSession; |
|
56 | - |
|
57 | - /** @var IGroupManager */ |
|
58 | - protected $groupManager; |
|
59 | - |
|
60 | - /** @var string[] */ |
|
61 | - protected $appVersions; |
|
62 | - |
|
63 | - /** |
|
64 | - * Notifier constructor. |
|
65 | - * |
|
66 | - * @param IURLGenerator $url |
|
67 | - * @param IConfig $config |
|
68 | - * @param IManager $notificationManager |
|
69 | - * @param IFactory $l10NFactory |
|
70 | - * @param IUserSession $userSession |
|
71 | - * @param IGroupManager $groupManager |
|
72 | - */ |
|
73 | - public function __construct(IURLGenerator $url, IConfig $config, IManager $notificationManager, IFactory $l10NFactory, IUserSession $userSession, IGroupManager $groupManager) { |
|
74 | - $this->url = $url; |
|
75 | - $this->notificationManager = $notificationManager; |
|
76 | - $this->config = $config; |
|
77 | - $this->l10NFactory = $l10NFactory; |
|
78 | - $this->userSession = $userSession; |
|
79 | - $this->groupManager = $groupManager; |
|
80 | - $this->appVersions = $this->getAppVersions(); |
|
81 | - } |
|
82 | - |
|
83 | - /** |
|
84 | - * Identifier of the notifier, only use [a-z0-9_] |
|
85 | - * |
|
86 | - * @return string |
|
87 | - * @since 17.0.0 |
|
88 | - */ |
|
89 | - public function getID(): string { |
|
90 | - return 'updatenotification'; |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * Human readable name describing the notifier |
|
95 | - * |
|
96 | - * @return string |
|
97 | - * @since 17.0.0 |
|
98 | - */ |
|
99 | - public function getName(): string { |
|
100 | - return $this->l10NFactory->get('updatenotification')->t('Update notifications'); |
|
101 | - } |
|
102 | - |
|
103 | - /** |
|
104 | - * @param INotification $notification |
|
105 | - * @param string $languageCode The code of the language that should be used to prepare the notification |
|
106 | - * @return INotification |
|
107 | - * @throws \InvalidArgumentException When the notification was not prepared by a notifier |
|
108 | - * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted |
|
109 | - * @since 9.0.0 |
|
110 | - */ |
|
111 | - public function prepare(INotification $notification, string $languageCode): INotification { |
|
112 | - if ($notification->getApp() !== 'updatenotification') { |
|
113 | - throw new \InvalidArgumentException('Unknown app id'); |
|
114 | - } |
|
115 | - |
|
116 | - $l = $this->l10NFactory->get('updatenotification', $languageCode); |
|
117 | - if ($notification->getSubject() === 'connection_error') { |
|
118 | - $errors = (int) $this->config->getAppValue('updatenotification', 'update_check_errors', 0); |
|
119 | - if ($errors === 0) { |
|
120 | - $this->notificationManager->markProcessed($notification); |
|
121 | - throw new \InvalidArgumentException('Update checked worked again'); |
|
122 | - } |
|
123 | - |
|
124 | - $notification->setParsedSubject($l->t('The update server could not be reached since %d days to check for new updates.', [$errors])) |
|
125 | - ->setParsedMessage($l->t('Please check the Nextcloud and server log files for errors.')); |
|
126 | - } elseif ($notification->getObjectType() === 'core') { |
|
127 | - $this->updateAlreadyInstalledCheck($notification, $this->getCoreVersions()); |
|
128 | - |
|
129 | - $parameters = $notification->getSubjectParameters(); |
|
130 | - $notification->setParsedSubject($l->t('Update to %1$s is available.', [$parameters['version']])); |
|
131 | - |
|
132 | - if ($this->isAdmin()) { |
|
133 | - $notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']) . '#version'); |
|
134 | - } |
|
135 | - } else { |
|
136 | - $appInfo = $this->getAppInfo($notification->getObjectType()); |
|
137 | - $appName = ($appInfo === null) ? $notification->getObjectType() : $appInfo['name']; |
|
138 | - |
|
139 | - if (isset($this->appVersions[$notification->getObjectType()])) { |
|
140 | - $this->updateAlreadyInstalledCheck($notification, $this->appVersions[$notification->getObjectType()]); |
|
141 | - } |
|
142 | - |
|
143 | - $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()])) |
|
144 | - ->setRichSubject($l->t('Update for {app} to version %s is available.', [$notification->getObjectId()]), [ |
|
145 | - 'app' => [ |
|
146 | - 'type' => 'app', |
|
147 | - 'id' => $notification->getObjectType(), |
|
148 | - 'name' => $appName, |
|
149 | - ] |
|
150 | - ]); |
|
151 | - |
|
152 | - if ($this->isAdmin()) { |
|
153 | - $notification->setLink($this->url->linkToRouteAbsolute('settings.AppSettings.viewApps', ['category' => 'updates']) . '#app-' . $notification->getObjectType()); |
|
154 | - } |
|
155 | - } |
|
156 | - |
|
157 | - $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('updatenotification', 'notification.svg'))); |
|
158 | - |
|
159 | - return $notification; |
|
160 | - } |
|
161 | - |
|
162 | - /** |
|
163 | - * Remove the notification and prevent rendering, when the update is installed |
|
164 | - * |
|
165 | - * @param INotification $notification |
|
166 | - * @param string $installedVersion |
|
167 | - * @throws AlreadyProcessedException When the update is already installed |
|
168 | - */ |
|
169 | - protected function updateAlreadyInstalledCheck(INotification $notification, $installedVersion) { |
|
170 | - if (version_compare($notification->getObjectId(), $installedVersion, '<=')) { |
|
171 | - throw new AlreadyProcessedException(); |
|
172 | - } |
|
173 | - } |
|
174 | - |
|
175 | - /** |
|
176 | - * @return bool |
|
177 | - */ |
|
178 | - protected function isAdmin(): bool { |
|
179 | - $user = $this->userSession->getUser(); |
|
180 | - |
|
181 | - if ($user instanceof IUser) { |
|
182 | - return $this->groupManager->isAdmin($user->getUID()); |
|
183 | - } |
|
184 | - |
|
185 | - return false; |
|
186 | - } |
|
187 | - |
|
188 | - protected function getCoreVersions(): string { |
|
189 | - return implode('.', Util::getVersion()); |
|
190 | - } |
|
191 | - |
|
192 | - protected function getAppVersions(): array { |
|
193 | - return \OC_App::getAppVersions(); |
|
194 | - } |
|
195 | - |
|
196 | - protected function getAppInfo($appId) { |
|
197 | - return \OC_App::getAppInfo($appId); |
|
198 | - } |
|
42 | + /** @var IURLGenerator */ |
|
43 | + protected $url; |
|
44 | + |
|
45 | + /** @var IConfig */ |
|
46 | + protected $config; |
|
47 | + |
|
48 | + /** @var IManager */ |
|
49 | + protected $notificationManager; |
|
50 | + |
|
51 | + /** @var IFactory */ |
|
52 | + protected $l10NFactory; |
|
53 | + |
|
54 | + /** @var IUserSession */ |
|
55 | + protected $userSession; |
|
56 | + |
|
57 | + /** @var IGroupManager */ |
|
58 | + protected $groupManager; |
|
59 | + |
|
60 | + /** @var string[] */ |
|
61 | + protected $appVersions; |
|
62 | + |
|
63 | + /** |
|
64 | + * Notifier constructor. |
|
65 | + * |
|
66 | + * @param IURLGenerator $url |
|
67 | + * @param IConfig $config |
|
68 | + * @param IManager $notificationManager |
|
69 | + * @param IFactory $l10NFactory |
|
70 | + * @param IUserSession $userSession |
|
71 | + * @param IGroupManager $groupManager |
|
72 | + */ |
|
73 | + public function __construct(IURLGenerator $url, IConfig $config, IManager $notificationManager, IFactory $l10NFactory, IUserSession $userSession, IGroupManager $groupManager) { |
|
74 | + $this->url = $url; |
|
75 | + $this->notificationManager = $notificationManager; |
|
76 | + $this->config = $config; |
|
77 | + $this->l10NFactory = $l10NFactory; |
|
78 | + $this->userSession = $userSession; |
|
79 | + $this->groupManager = $groupManager; |
|
80 | + $this->appVersions = $this->getAppVersions(); |
|
81 | + } |
|
82 | + |
|
83 | + /** |
|
84 | + * Identifier of the notifier, only use [a-z0-9_] |
|
85 | + * |
|
86 | + * @return string |
|
87 | + * @since 17.0.0 |
|
88 | + */ |
|
89 | + public function getID(): string { |
|
90 | + return 'updatenotification'; |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * Human readable name describing the notifier |
|
95 | + * |
|
96 | + * @return string |
|
97 | + * @since 17.0.0 |
|
98 | + */ |
|
99 | + public function getName(): string { |
|
100 | + return $this->l10NFactory->get('updatenotification')->t('Update notifications'); |
|
101 | + } |
|
102 | + |
|
103 | + /** |
|
104 | + * @param INotification $notification |
|
105 | + * @param string $languageCode The code of the language that should be used to prepare the notification |
|
106 | + * @return INotification |
|
107 | + * @throws \InvalidArgumentException When the notification was not prepared by a notifier |
|
108 | + * @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted |
|
109 | + * @since 9.0.0 |
|
110 | + */ |
|
111 | + public function prepare(INotification $notification, string $languageCode): INotification { |
|
112 | + if ($notification->getApp() !== 'updatenotification') { |
|
113 | + throw new \InvalidArgumentException('Unknown app id'); |
|
114 | + } |
|
115 | + |
|
116 | + $l = $this->l10NFactory->get('updatenotification', $languageCode); |
|
117 | + if ($notification->getSubject() === 'connection_error') { |
|
118 | + $errors = (int) $this->config->getAppValue('updatenotification', 'update_check_errors', 0); |
|
119 | + if ($errors === 0) { |
|
120 | + $this->notificationManager->markProcessed($notification); |
|
121 | + throw new \InvalidArgumentException('Update checked worked again'); |
|
122 | + } |
|
123 | + |
|
124 | + $notification->setParsedSubject($l->t('The update server could not be reached since %d days to check for new updates.', [$errors])) |
|
125 | + ->setParsedMessage($l->t('Please check the Nextcloud and server log files for errors.')); |
|
126 | + } elseif ($notification->getObjectType() === 'core') { |
|
127 | + $this->updateAlreadyInstalledCheck($notification, $this->getCoreVersions()); |
|
128 | + |
|
129 | + $parameters = $notification->getSubjectParameters(); |
|
130 | + $notification->setParsedSubject($l->t('Update to %1$s is available.', [$parameters['version']])); |
|
131 | + |
|
132 | + if ($this->isAdmin()) { |
|
133 | + $notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']) . '#version'); |
|
134 | + } |
|
135 | + } else { |
|
136 | + $appInfo = $this->getAppInfo($notification->getObjectType()); |
|
137 | + $appName = ($appInfo === null) ? $notification->getObjectType() : $appInfo['name']; |
|
138 | + |
|
139 | + if (isset($this->appVersions[$notification->getObjectType()])) { |
|
140 | + $this->updateAlreadyInstalledCheck($notification, $this->appVersions[$notification->getObjectType()]); |
|
141 | + } |
|
142 | + |
|
143 | + $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()])) |
|
144 | + ->setRichSubject($l->t('Update for {app} to version %s is available.', [$notification->getObjectId()]), [ |
|
145 | + 'app' => [ |
|
146 | + 'type' => 'app', |
|
147 | + 'id' => $notification->getObjectType(), |
|
148 | + 'name' => $appName, |
|
149 | + ] |
|
150 | + ]); |
|
151 | + |
|
152 | + if ($this->isAdmin()) { |
|
153 | + $notification->setLink($this->url->linkToRouteAbsolute('settings.AppSettings.viewApps', ['category' => 'updates']) . '#app-' . $notification->getObjectType()); |
|
154 | + } |
|
155 | + } |
|
156 | + |
|
157 | + $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('updatenotification', 'notification.svg'))); |
|
158 | + |
|
159 | + return $notification; |
|
160 | + } |
|
161 | + |
|
162 | + /** |
|
163 | + * Remove the notification and prevent rendering, when the update is installed |
|
164 | + * |
|
165 | + * @param INotification $notification |
|
166 | + * @param string $installedVersion |
|
167 | + * @throws AlreadyProcessedException When the update is already installed |
|
168 | + */ |
|
169 | + protected function updateAlreadyInstalledCheck(INotification $notification, $installedVersion) { |
|
170 | + if (version_compare($notification->getObjectId(), $installedVersion, '<=')) { |
|
171 | + throw new AlreadyProcessedException(); |
|
172 | + } |
|
173 | + } |
|
174 | + |
|
175 | + /** |
|
176 | + * @return bool |
|
177 | + */ |
|
178 | + protected function isAdmin(): bool { |
|
179 | + $user = $this->userSession->getUser(); |
|
180 | + |
|
181 | + if ($user instanceof IUser) { |
|
182 | + return $this->groupManager->isAdmin($user->getUID()); |
|
183 | + } |
|
184 | + |
|
185 | + return false; |
|
186 | + } |
|
187 | + |
|
188 | + protected function getCoreVersions(): string { |
|
189 | + return implode('.', Util::getVersion()); |
|
190 | + } |
|
191 | + |
|
192 | + protected function getAppVersions(): array { |
|
193 | + return \OC_App::getAppVersions(); |
|
194 | + } |
|
195 | + |
|
196 | + protected function getAppInfo($appId) { |
|
197 | + return \OC_App::getAppInfo($appId); |
|
198 | + } |
|
199 | 199 | } |
@@ -34,22 +34,22 @@ |
||
34 | 34 | */ |
35 | 35 | interface IProvidesIcons extends IProvider { |
36 | 36 | |
37 | - /** |
|
38 | - * Get the path to the light (white) icon of this provider |
|
39 | - * |
|
40 | - * @return String |
|
41 | - * |
|
42 | - * @since 15.0.0 |
|
43 | - */ |
|
44 | - public function getLightIcon(): String; |
|
37 | + /** |
|
38 | + * Get the path to the light (white) icon of this provider |
|
39 | + * |
|
40 | + * @return String |
|
41 | + * |
|
42 | + * @since 15.0.0 |
|
43 | + */ |
|
44 | + public function getLightIcon(): String; |
|
45 | 45 | |
46 | - /** |
|
47 | - * Get the path to the dark (black) icon of this provider |
|
48 | - * |
|
49 | - * @return String |
|
50 | - * |
|
51 | - * @since 15.0.0 |
|
52 | - */ |
|
53 | - public function getDarkIcon(): String; |
|
46 | + /** |
|
47 | + * Get the path to the dark (black) icon of this provider |
|
48 | + * |
|
49 | + * @return String |
|
50 | + * |
|
51 | + * @since 15.0.0 |
|
52 | + */ |
|
53 | + public function getDarkIcon(): String; |
|
54 | 54 | |
55 | 55 | } |
@@ -30,19 +30,19 @@ |
||
30 | 30 | |
31 | 31 | class CheckBackupCodes implements IRepairStep { |
32 | 32 | |
33 | - /** @var IJobList */ |
|
34 | - private $jobList; |
|
33 | + /** @var IJobList */ |
|
34 | + private $jobList; |
|
35 | 35 | |
36 | - public function __construct(IJobList $jobList) { |
|
37 | - $this->jobList = $jobList; |
|
38 | - } |
|
36 | + public function __construct(IJobList $jobList) { |
|
37 | + $this->jobList = $jobList; |
|
38 | + } |
|
39 | 39 | |
40 | - public function getName(): string { |
|
41 | - return 'Add background job to check for backup codes'; |
|
42 | - } |
|
40 | + public function getName(): string { |
|
41 | + return 'Add background job to check for backup codes'; |
|
42 | + } |
|
43 | 43 | |
44 | - public function run(IOutput $output) { |
|
45 | - $this->jobList->add(\OCA\TwoFactorBackupCodes\BackgroundJob\CheckBackupCodes::class); |
|
46 | - } |
|
44 | + public function run(IOutput $output) { |
|
45 | + $this->jobList->add(\OCA\TwoFactorBackupCodes\BackgroundJob\CheckBackupCodes::class); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | } |
@@ -64,10 +64,10 @@ |
||
64 | 64 | public function setupDatabase($username) { |
65 | 65 | $datadir = $this->config->getValue( |
66 | 66 | 'datadirectory', |
67 | - \OC::$SERVERROOT . '/data' |
|
67 | + \OC::$SERVERROOT.'/data' |
|
68 | 68 | ); |
69 | 69 | |
70 | - $sqliteFile = $datadir . '/' . $this->dbName . 'db'; |
|
70 | + $sqliteFile = $datadir.'/'.$this->dbName.'db'; |
|
71 | 71 | if (file_exists($sqliteFile)) { |
72 | 72 | unlink($sqliteFile); |
73 | 73 | } |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | use OC\DB\ConnectionFactory; |
27 | 27 | |
28 | 28 | class Sqlite extends AbstractDatabase { |
29 | - public $dbprettyname = 'Sqlite'; |
|
29 | + public $dbprettyname = 'Sqlite'; |
|
30 | 30 | |
31 | - public function validate($config) { |
|
32 | - return []; |
|
33 | - } |
|
31 | + public function validate($config) { |
|
32 | + return []; |
|
33 | + } |
|
34 | 34 | |
35 | - public function initialize($config) { |
|
36 | - /* |
|
35 | + public function initialize($config) { |
|
36 | + /* |
|
37 | 37 | * Web: When using web based installer its not possible to set dbname |
38 | 38 | * or dbtableprefix. Defaults used from ConnectionFactory and dbtype = 'sqlite' |
39 | 39 | * is written to config.php. |
@@ -44,32 +44,32 @@ discard block |
||
44 | 44 | * in connection factory configuration is obtained from config.php. |
45 | 45 | */ |
46 | 46 | |
47 | - $this->dbName = empty($config['dbname']) |
|
48 | - ? ConnectionFactory::DEFAULT_DBNAME |
|
49 | - : $config['dbname']; |
|
47 | + $this->dbName = empty($config['dbname']) |
|
48 | + ? ConnectionFactory::DEFAULT_DBNAME |
|
49 | + : $config['dbname']; |
|
50 | 50 | |
51 | - $this->tablePrefix = empty($config['dbtableprefix']) |
|
52 | - ? ConnectionFactory::DEFAULT_DBTABLEPREFIX |
|
53 | - : $config['dbtableprefix']; |
|
51 | + $this->tablePrefix = empty($config['dbtableprefix']) |
|
52 | + ? ConnectionFactory::DEFAULT_DBTABLEPREFIX |
|
53 | + : $config['dbtableprefix']; |
|
54 | 54 | |
55 | - if ($this->dbName !== ConnectionFactory::DEFAULT_DBNAME) { |
|
56 | - $this->config->setValue('dbname', $this->dbName); |
|
57 | - } |
|
55 | + if ($this->dbName !== ConnectionFactory::DEFAULT_DBNAME) { |
|
56 | + $this->config->setValue('dbname', $this->dbName); |
|
57 | + } |
|
58 | 58 | |
59 | - if ($this->tablePrefix !== ConnectionFactory::DEFAULT_DBTABLEPREFIX) { |
|
60 | - $this->config->setValue('dbtableprefix', $this->tablePrefix); |
|
61 | - } |
|
62 | - } |
|
59 | + if ($this->tablePrefix !== ConnectionFactory::DEFAULT_DBTABLEPREFIX) { |
|
60 | + $this->config->setValue('dbtableprefix', $this->tablePrefix); |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | - public function setupDatabase($username) { |
|
65 | - $datadir = $this->config->getValue( |
|
66 | - 'datadirectory', |
|
67 | - \OC::$SERVERROOT . '/data' |
|
68 | - ); |
|
64 | + public function setupDatabase($username) { |
|
65 | + $datadir = $this->config->getValue( |
|
66 | + 'datadirectory', |
|
67 | + \OC::$SERVERROOT . '/data' |
|
68 | + ); |
|
69 | 69 | |
70 | - $sqliteFile = $datadir . '/' . $this->dbName . 'db'; |
|
71 | - if (file_exists($sqliteFile)) { |
|
72 | - unlink($sqliteFile); |
|
73 | - } |
|
74 | - } |
|
70 | + $sqliteFile = $datadir . '/' . $this->dbName . 'db'; |
|
71 | + if (file_exists($sqliteFile)) { |
|
72 | + unlink($sqliteFile); |
|
73 | + } |
|
74 | + } |
|
75 | 75 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if ($host === '') { |
141 | 141 | $additionalConnectionParams['dbname'] = $dbName; // use dbname as easy connect name |
142 | 142 | } else { |
143 | - $additionalConnectionParams['dbname'] = '//' . $host . (!empty($port) ? ":{$port}" : "") . '/' . $dbName; |
|
143 | + $additionalConnectionParams['dbname'] = '//'.$host.(!empty($port) ? ":{$port}" : "").'/'.$dbName; |
|
144 | 144 | } |
145 | 145 | unset($additionalConnectionParams['host']); |
146 | 146 | break; |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | $name = $this->config->getValue('dbname', self::DEFAULT_DBNAME); |
196 | 196 | |
197 | 197 | if ($this->normalizeType($type) === 'sqlite3') { |
198 | - $dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT . '/data'); |
|
199 | - $connectionParams['path'] = $dataDir . '/' . $name . '.db'; |
|
198 | + $dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT.'/data'); |
|
199 | + $connectionParams['path'] = $dataDir.'/'.$name.'.db'; |
|
200 | 200 | } else { |
201 | 201 | $host = $this->config->getValue('dbhost', ''); |
202 | 202 | $connectionParams = array_merge($connectionParams, $this->splitHostFromPortAndSocket($host)); |
@@ -40,219 +40,219 @@ |
||
40 | 40 | * Takes care of creating and configuring Doctrine connections. |
41 | 41 | */ |
42 | 42 | class ConnectionFactory { |
43 | - /** @var string default database name */ |
|
44 | - public const DEFAULT_DBNAME = 'owncloud'; |
|
43 | + /** @var string default database name */ |
|
44 | + public const DEFAULT_DBNAME = 'owncloud'; |
|
45 | 45 | |
46 | - /** @var string default database table prefix */ |
|
47 | - public const DEFAULT_DBTABLEPREFIX = 'oc_'; |
|
46 | + /** @var string default database table prefix */ |
|
47 | + public const DEFAULT_DBTABLEPREFIX = 'oc_'; |
|
48 | 48 | |
49 | - /** |
|
50 | - * @var array |
|
51 | - * |
|
52 | - * Array mapping DBMS type to default connection parameters passed to |
|
53 | - * \Doctrine\DBAL\DriverManager::getConnection(). |
|
54 | - */ |
|
55 | - protected $defaultConnectionParams = [ |
|
56 | - 'mysql' => [ |
|
57 | - 'adapter' => AdapterMySQL::class, |
|
58 | - 'charset' => 'UTF8', |
|
59 | - 'driver' => 'pdo_mysql', |
|
60 | - 'wrapperClass' => Connection::class, |
|
61 | - ], |
|
62 | - 'oci' => [ |
|
63 | - 'adapter' => AdapterOCI8::class, |
|
64 | - 'charset' => 'AL32UTF8', |
|
65 | - 'driver' => 'oci8', |
|
66 | - 'wrapperClass' => OracleConnection::class, |
|
67 | - ], |
|
68 | - 'pgsql' => [ |
|
69 | - 'adapter' => AdapterPgSql::class, |
|
70 | - 'driver' => 'pdo_pgsql', |
|
71 | - 'wrapperClass' => Connection::class, |
|
72 | - ], |
|
73 | - 'sqlite3' => [ |
|
74 | - 'adapter' => AdapterSqlite::class, |
|
75 | - 'driver' => 'pdo_sqlite', |
|
76 | - 'wrapperClass' => Connection::class, |
|
77 | - ], |
|
78 | - ]; |
|
49 | + /** |
|
50 | + * @var array |
|
51 | + * |
|
52 | + * Array mapping DBMS type to default connection parameters passed to |
|
53 | + * \Doctrine\DBAL\DriverManager::getConnection(). |
|
54 | + */ |
|
55 | + protected $defaultConnectionParams = [ |
|
56 | + 'mysql' => [ |
|
57 | + 'adapter' => AdapterMySQL::class, |
|
58 | + 'charset' => 'UTF8', |
|
59 | + 'driver' => 'pdo_mysql', |
|
60 | + 'wrapperClass' => Connection::class, |
|
61 | + ], |
|
62 | + 'oci' => [ |
|
63 | + 'adapter' => AdapterOCI8::class, |
|
64 | + 'charset' => 'AL32UTF8', |
|
65 | + 'driver' => 'oci8', |
|
66 | + 'wrapperClass' => OracleConnection::class, |
|
67 | + ], |
|
68 | + 'pgsql' => [ |
|
69 | + 'adapter' => AdapterPgSql::class, |
|
70 | + 'driver' => 'pdo_pgsql', |
|
71 | + 'wrapperClass' => Connection::class, |
|
72 | + ], |
|
73 | + 'sqlite3' => [ |
|
74 | + 'adapter' => AdapterSqlite::class, |
|
75 | + 'driver' => 'pdo_sqlite', |
|
76 | + 'wrapperClass' => Connection::class, |
|
77 | + ], |
|
78 | + ]; |
|
79 | 79 | |
80 | - /** @var SystemConfig */ |
|
81 | - private $config; |
|
80 | + /** @var SystemConfig */ |
|
81 | + private $config; |
|
82 | 82 | |
83 | - /** |
|
84 | - * ConnectionFactory constructor. |
|
85 | - * |
|
86 | - * @param SystemConfig $systemConfig |
|
87 | - */ |
|
88 | - public function __construct(SystemConfig $systemConfig) { |
|
89 | - $this->config = $systemConfig; |
|
90 | - if ($this->config->getValue('mysql.utf8mb4', false)) { |
|
91 | - $this->defaultConnectionParams['mysql']['charset'] = 'utf8mb4'; |
|
92 | - } |
|
93 | - } |
|
83 | + /** |
|
84 | + * ConnectionFactory constructor. |
|
85 | + * |
|
86 | + * @param SystemConfig $systemConfig |
|
87 | + */ |
|
88 | + public function __construct(SystemConfig $systemConfig) { |
|
89 | + $this->config = $systemConfig; |
|
90 | + if ($this->config->getValue('mysql.utf8mb4', false)) { |
|
91 | + $this->defaultConnectionParams['mysql']['charset'] = 'utf8mb4'; |
|
92 | + } |
|
93 | + } |
|
94 | 94 | |
95 | - /** |
|
96 | - * @brief Get default connection parameters for a given DBMS. |
|
97 | - * @param string $type DBMS type |
|
98 | - * @throws \InvalidArgumentException If $type is invalid |
|
99 | - * @return array Default connection parameters. |
|
100 | - */ |
|
101 | - public function getDefaultConnectionParams($type) { |
|
102 | - $normalizedType = $this->normalizeType($type); |
|
103 | - if (!isset($this->defaultConnectionParams[$normalizedType])) { |
|
104 | - throw new \InvalidArgumentException("Unsupported type: $type"); |
|
105 | - } |
|
106 | - $result = $this->defaultConnectionParams[$normalizedType]; |
|
107 | - // \PDO::MYSQL_ATTR_FOUND_ROWS may not be defined, e.g. when the MySQL |
|
108 | - // driver is missing. In this case, we won't be able to connect anyway. |
|
109 | - if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) { |
|
110 | - $result['driverOptions'] = [ |
|
111 | - \PDO::MYSQL_ATTR_FOUND_ROWS => true, |
|
112 | - ]; |
|
113 | - } |
|
114 | - return $result; |
|
115 | - } |
|
95 | + /** |
|
96 | + * @brief Get default connection parameters for a given DBMS. |
|
97 | + * @param string $type DBMS type |
|
98 | + * @throws \InvalidArgumentException If $type is invalid |
|
99 | + * @return array Default connection parameters. |
|
100 | + */ |
|
101 | + public function getDefaultConnectionParams($type) { |
|
102 | + $normalizedType = $this->normalizeType($type); |
|
103 | + if (!isset($this->defaultConnectionParams[$normalizedType])) { |
|
104 | + throw new \InvalidArgumentException("Unsupported type: $type"); |
|
105 | + } |
|
106 | + $result = $this->defaultConnectionParams[$normalizedType]; |
|
107 | + // \PDO::MYSQL_ATTR_FOUND_ROWS may not be defined, e.g. when the MySQL |
|
108 | + // driver is missing. In this case, we won't be able to connect anyway. |
|
109 | + if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) { |
|
110 | + $result['driverOptions'] = [ |
|
111 | + \PDO::MYSQL_ATTR_FOUND_ROWS => true, |
|
112 | + ]; |
|
113 | + } |
|
114 | + return $result; |
|
115 | + } |
|
116 | 116 | |
117 | - /** |
|
118 | - * @brief Get default connection parameters for a given DBMS. |
|
119 | - * @param string $type DBMS type |
|
120 | - * @param array $additionalConnectionParams Additional connection parameters |
|
121 | - * @return \OC\DB\Connection |
|
122 | - */ |
|
123 | - public function getConnection($type, $additionalConnectionParams) { |
|
124 | - $normalizedType = $this->normalizeType($type); |
|
125 | - $eventManager = new EventManager(); |
|
126 | - $eventManager->addEventSubscriber(new SetTransactionIsolationLevel()); |
|
127 | - switch ($normalizedType) { |
|
128 | - case 'mysql': |
|
129 | - $eventManager->addEventSubscriber( |
|
130 | - new SQLSessionInit("SET SESSION AUTOCOMMIT=1")); |
|
131 | - break; |
|
132 | - case 'oci': |
|
133 | - $eventManager->addEventSubscriber(new OracleSessionInit); |
|
134 | - // the driverOptions are unused in dbal and need to be mapped to the parameters |
|
135 | - if (isset($additionalConnectionParams['driverOptions'])) { |
|
136 | - $additionalConnectionParams = array_merge($additionalConnectionParams, $additionalConnectionParams['driverOptions']); |
|
137 | - } |
|
138 | - $host = $additionalConnectionParams['host']; |
|
139 | - $port = isset($additionalConnectionParams['port']) ? $additionalConnectionParams['port'] : null; |
|
140 | - $dbName = $additionalConnectionParams['dbname']; |
|
117 | + /** |
|
118 | + * @brief Get default connection parameters for a given DBMS. |
|
119 | + * @param string $type DBMS type |
|
120 | + * @param array $additionalConnectionParams Additional connection parameters |
|
121 | + * @return \OC\DB\Connection |
|
122 | + */ |
|
123 | + public function getConnection($type, $additionalConnectionParams) { |
|
124 | + $normalizedType = $this->normalizeType($type); |
|
125 | + $eventManager = new EventManager(); |
|
126 | + $eventManager->addEventSubscriber(new SetTransactionIsolationLevel()); |
|
127 | + switch ($normalizedType) { |
|
128 | + case 'mysql': |
|
129 | + $eventManager->addEventSubscriber( |
|
130 | + new SQLSessionInit("SET SESSION AUTOCOMMIT=1")); |
|
131 | + break; |
|
132 | + case 'oci': |
|
133 | + $eventManager->addEventSubscriber(new OracleSessionInit); |
|
134 | + // the driverOptions are unused in dbal and need to be mapped to the parameters |
|
135 | + if (isset($additionalConnectionParams['driverOptions'])) { |
|
136 | + $additionalConnectionParams = array_merge($additionalConnectionParams, $additionalConnectionParams['driverOptions']); |
|
137 | + } |
|
138 | + $host = $additionalConnectionParams['host']; |
|
139 | + $port = isset($additionalConnectionParams['port']) ? $additionalConnectionParams['port'] : null; |
|
140 | + $dbName = $additionalConnectionParams['dbname']; |
|
141 | 141 | |
142 | - // we set the connect string as dbname and unset the host to coerce doctrine into using it as connect string |
|
143 | - if ($host === '') { |
|
144 | - $additionalConnectionParams['dbname'] = $dbName; // use dbname as easy connect name |
|
145 | - } else { |
|
146 | - $additionalConnectionParams['dbname'] = '//' . $host . (!empty($port) ? ":{$port}" : "") . '/' . $dbName; |
|
147 | - } |
|
148 | - unset($additionalConnectionParams['host']); |
|
149 | - break; |
|
142 | + // we set the connect string as dbname and unset the host to coerce doctrine into using it as connect string |
|
143 | + if ($host === '') { |
|
144 | + $additionalConnectionParams['dbname'] = $dbName; // use dbname as easy connect name |
|
145 | + } else { |
|
146 | + $additionalConnectionParams['dbname'] = '//' . $host . (!empty($port) ? ":{$port}" : "") . '/' . $dbName; |
|
147 | + } |
|
148 | + unset($additionalConnectionParams['host']); |
|
149 | + break; |
|
150 | 150 | |
151 | - case 'sqlite3': |
|
152 | - $journalMode = $additionalConnectionParams['sqlite.journal_mode']; |
|
153 | - $additionalConnectionParams['platform'] = new OCSqlitePlatform(); |
|
154 | - $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode)); |
|
155 | - break; |
|
156 | - } |
|
157 | - /** @var Connection $connection */ |
|
158 | - $connection = DriverManager::getConnection( |
|
159 | - array_merge($this->getDefaultConnectionParams($type), $additionalConnectionParams), |
|
160 | - new Configuration(), |
|
161 | - $eventManager |
|
162 | - ); |
|
163 | - return $connection; |
|
164 | - } |
|
151 | + case 'sqlite3': |
|
152 | + $journalMode = $additionalConnectionParams['sqlite.journal_mode']; |
|
153 | + $additionalConnectionParams['platform'] = new OCSqlitePlatform(); |
|
154 | + $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode)); |
|
155 | + break; |
|
156 | + } |
|
157 | + /** @var Connection $connection */ |
|
158 | + $connection = DriverManager::getConnection( |
|
159 | + array_merge($this->getDefaultConnectionParams($type), $additionalConnectionParams), |
|
160 | + new Configuration(), |
|
161 | + $eventManager |
|
162 | + ); |
|
163 | + return $connection; |
|
164 | + } |
|
165 | 165 | |
166 | - /** |
|
167 | - * @brief Normalize DBMS type |
|
168 | - * @param string $type DBMS type |
|
169 | - * @return string Normalized DBMS type |
|
170 | - */ |
|
171 | - public function normalizeType($type) { |
|
172 | - return $type === 'sqlite' ? 'sqlite3' : $type; |
|
173 | - } |
|
166 | + /** |
|
167 | + * @brief Normalize DBMS type |
|
168 | + * @param string $type DBMS type |
|
169 | + * @return string Normalized DBMS type |
|
170 | + */ |
|
171 | + public function normalizeType($type) { |
|
172 | + return $type === 'sqlite' ? 'sqlite3' : $type; |
|
173 | + } |
|
174 | 174 | |
175 | - /** |
|
176 | - * Checks whether the specified DBMS type is valid. |
|
177 | - * |
|
178 | - * @param string $type |
|
179 | - * @return bool |
|
180 | - */ |
|
181 | - public function isValidType($type) { |
|
182 | - $normalizedType = $this->normalizeType($type); |
|
183 | - return isset($this->defaultConnectionParams[$normalizedType]); |
|
184 | - } |
|
175 | + /** |
|
176 | + * Checks whether the specified DBMS type is valid. |
|
177 | + * |
|
178 | + * @param string $type |
|
179 | + * @return bool |
|
180 | + */ |
|
181 | + public function isValidType($type) { |
|
182 | + $normalizedType = $this->normalizeType($type); |
|
183 | + return isset($this->defaultConnectionParams[$normalizedType]); |
|
184 | + } |
|
185 | 185 | |
186 | - /** |
|
187 | - * Create the connection parameters for the config |
|
188 | - * |
|
189 | - * @return array |
|
190 | - */ |
|
191 | - public function createConnectionParams() { |
|
192 | - $type = $this->config->getValue('dbtype', 'sqlite'); |
|
186 | + /** |
|
187 | + * Create the connection parameters for the config |
|
188 | + * |
|
189 | + * @return array |
|
190 | + */ |
|
191 | + public function createConnectionParams() { |
|
192 | + $type = $this->config->getValue('dbtype', 'sqlite'); |
|
193 | 193 | |
194 | - $connectionParams = [ |
|
195 | - 'user' => $this->config->getValue('dbuser', ''), |
|
196 | - 'password' => $this->config->getValue('dbpassword', ''), |
|
197 | - ]; |
|
198 | - $name = $this->config->getValue('dbname', self::DEFAULT_DBNAME); |
|
194 | + $connectionParams = [ |
|
195 | + 'user' => $this->config->getValue('dbuser', ''), |
|
196 | + 'password' => $this->config->getValue('dbpassword', ''), |
|
197 | + ]; |
|
198 | + $name = $this->config->getValue('dbname', self::DEFAULT_DBNAME); |
|
199 | 199 | |
200 | - if ($this->normalizeType($type) === 'sqlite3') { |
|
201 | - $dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT . '/data'); |
|
202 | - $connectionParams['path'] = $dataDir . '/' . $name . '.db'; |
|
203 | - } else { |
|
204 | - $host = $this->config->getValue('dbhost', ''); |
|
205 | - $connectionParams = array_merge($connectionParams, $this->splitHostFromPortAndSocket($host)); |
|
206 | - $connectionParams['dbname'] = $name; |
|
207 | - } |
|
200 | + if ($this->normalizeType($type) === 'sqlite3') { |
|
201 | + $dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT . '/data'); |
|
202 | + $connectionParams['path'] = $dataDir . '/' . $name . '.db'; |
|
203 | + } else { |
|
204 | + $host = $this->config->getValue('dbhost', ''); |
|
205 | + $connectionParams = array_merge($connectionParams, $this->splitHostFromPortAndSocket($host)); |
|
206 | + $connectionParams['dbname'] = $name; |
|
207 | + } |
|
208 | 208 | |
209 | - $connectionParams['tablePrefix'] = $this->config->getValue('dbtableprefix', self::DEFAULT_DBTABLEPREFIX); |
|
210 | - $connectionParams['sqlite.journal_mode'] = $this->config->getValue('sqlite.journal_mode', 'WAL'); |
|
209 | + $connectionParams['tablePrefix'] = $this->config->getValue('dbtableprefix', self::DEFAULT_DBTABLEPREFIX); |
|
210 | + $connectionParams['sqlite.journal_mode'] = $this->config->getValue('sqlite.journal_mode', 'WAL'); |
|
211 | 211 | |
212 | - //additional driver options, eg. for mysql ssl |
|
213 | - $driverOptions = $this->config->getValue('dbdriveroptions', null); |
|
214 | - if ($driverOptions) { |
|
215 | - $connectionParams['driverOptions'] = $driverOptions; |
|
216 | - } |
|
212 | + //additional driver options, eg. for mysql ssl |
|
213 | + $driverOptions = $this->config->getValue('dbdriveroptions', null); |
|
214 | + if ($driverOptions) { |
|
215 | + $connectionParams['driverOptions'] = $driverOptions; |
|
216 | + } |
|
217 | 217 | |
218 | - // set default table creation options |
|
219 | - $connectionParams['defaultTableOptions'] = [ |
|
220 | - 'collate' => 'utf8_bin', |
|
221 | - 'tablePrefix' => $connectionParams['tablePrefix'] |
|
222 | - ]; |
|
218 | + // set default table creation options |
|
219 | + $connectionParams['defaultTableOptions'] = [ |
|
220 | + 'collate' => 'utf8_bin', |
|
221 | + 'tablePrefix' => $connectionParams['tablePrefix'] |
|
222 | + ]; |
|
223 | 223 | |
224 | - if ($this->config->getValue('mysql.utf8mb4', false)) { |
|
225 | - $connectionParams['defaultTableOptions'] = [ |
|
226 | - 'collate' => 'utf8mb4_bin', |
|
227 | - 'charset' => 'utf8mb4', |
|
228 | - 'row_format' => 'compressed', |
|
229 | - 'tablePrefix' => $connectionParams['tablePrefix'] |
|
230 | - ]; |
|
231 | - } |
|
224 | + if ($this->config->getValue('mysql.utf8mb4', false)) { |
|
225 | + $connectionParams['defaultTableOptions'] = [ |
|
226 | + 'collate' => 'utf8mb4_bin', |
|
227 | + 'charset' => 'utf8mb4', |
|
228 | + 'row_format' => 'compressed', |
|
229 | + 'tablePrefix' => $connectionParams['tablePrefix'] |
|
230 | + ]; |
|
231 | + } |
|
232 | 232 | |
233 | - return $connectionParams; |
|
234 | - } |
|
233 | + return $connectionParams; |
|
234 | + } |
|
235 | 235 | |
236 | - /** |
|
237 | - * @param string $host |
|
238 | - * @return array |
|
239 | - */ |
|
240 | - protected function splitHostFromPortAndSocket($host): array { |
|
241 | - $params = [ |
|
242 | - 'host' => $host, |
|
243 | - ]; |
|
236 | + /** |
|
237 | + * @param string $host |
|
238 | + * @return array |
|
239 | + */ |
|
240 | + protected function splitHostFromPortAndSocket($host): array { |
|
241 | + $params = [ |
|
242 | + 'host' => $host, |
|
243 | + ]; |
|
244 | 244 | |
245 | - $matches = []; |
|
246 | - if (preg_match('/^(.*):([^\]:]+)$/', $host, $matches)) { |
|
247 | - // Host variable carries a port or socket. |
|
248 | - $params['host'] = $matches[1]; |
|
249 | - if (is_numeric($matches[2])) { |
|
250 | - $params['port'] = (int) $matches[2]; |
|
251 | - } else { |
|
252 | - $params['unix_socket'] = $matches[2]; |
|
253 | - } |
|
254 | - } |
|
245 | + $matches = []; |
|
246 | + if (preg_match('/^(.*):([^\]:]+)$/', $host, $matches)) { |
|
247 | + // Host variable carries a port or socket. |
|
248 | + $params['host'] = $matches[1]; |
|
249 | + if (is_numeric($matches[2])) { |
|
250 | + $params['port'] = (int) $matches[2]; |
|
251 | + } else { |
|
252 | + $params['unix_socket'] = $matches[2]; |
|
253 | + } |
|
254 | + } |
|
255 | 255 | |
256 | - return $params; |
|
257 | - } |
|
256 | + return $params; |
|
257 | + } |
|
258 | 258 | } |
@@ -33,11 +33,11 @@ |
||
33 | 33 | */ |
34 | 34 | interface IPersonalProviderSettings { |
35 | 35 | |
36 | - /** |
|
37 | - * @return Template |
|
38 | - * |
|
39 | - * @since 15.0.0 |
|
40 | - */ |
|
41 | - public function getBody(): Template; |
|
36 | + /** |
|
37 | + * @return Template |
|
38 | + * |
|
39 | + * @since 15.0.0 |
|
40 | + */ |
|
41 | + public function getBody(): Template; |
|
42 | 42 | |
43 | 43 | } |
@@ -35,13 +35,13 @@ |
||
35 | 35 | */ |
36 | 36 | interface IProvidesPersonalSettings extends IProvider { |
37 | 37 | |
38 | - /** |
|
39 | - * @param IUser $user |
|
40 | - * |
|
41 | - * @return IPersonalProviderSettings |
|
42 | - * |
|
43 | - * @since 15.0.0 |
|
44 | - */ |
|
45 | - public function getPersonalSettings(IUser $user): IPersonalProviderSettings; |
|
38 | + /** |
|
39 | + * @param IUser $user |
|
40 | + * |
|
41 | + * @return IPersonalProviderSettings |
|
42 | + * |
|
43 | + * @since 15.0.0 |
|
44 | + */ |
|
45 | + public function getPersonalSettings(IUser $user): IPersonalProviderSettings; |
|
46 | 46 | |
47 | 47 | } |
@@ -31,41 +31,41 @@ |
||
31 | 31 | */ |
32 | 32 | interface IManager { |
33 | 33 | |
34 | - /** |
|
35 | - * Registers a resource backend |
|
36 | - * |
|
37 | - * @param string $backendClass |
|
38 | - * @return void |
|
39 | - * @since 14.0.0 |
|
40 | - */ |
|
41 | - public function registerBackend(string $backendClass); |
|
34 | + /** |
|
35 | + * Registers a resource backend |
|
36 | + * |
|
37 | + * @param string $backendClass |
|
38 | + * @return void |
|
39 | + * @since 14.0.0 |
|
40 | + */ |
|
41 | + public function registerBackend(string $backendClass); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Unregisters a resource backend |
|
45 | - * |
|
46 | - * @param string $backendClass |
|
47 | - * @return void |
|
48 | - * @since 14.0.0 |
|
49 | - */ |
|
50 | - public function unregisterBackend(string $backendClass); |
|
43 | + /** |
|
44 | + * Unregisters a resource backend |
|
45 | + * |
|
46 | + * @param string $backendClass |
|
47 | + * @return void |
|
48 | + * @since 14.0.0 |
|
49 | + */ |
|
50 | + public function unregisterBackend(string $backendClass); |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return IBackend[] |
|
54 | - * @since 14.0.0 |
|
55 | - */ |
|
56 | - public function getBackends():array; |
|
52 | + /** |
|
53 | + * @return IBackend[] |
|
54 | + * @since 14.0.0 |
|
55 | + */ |
|
56 | + public function getBackends():array; |
|
57 | 57 | |
58 | - /** |
|
59 | - * @param string $backendId |
|
60 | - * @return IBackend|null |
|
61 | - * @since 14.0.0 |
|
62 | - */ |
|
63 | - public function getBackend($backendId); |
|
58 | + /** |
|
59 | + * @param string $backendId |
|
60 | + * @return IBackend|null |
|
61 | + * @since 14.0.0 |
|
62 | + */ |
|
63 | + public function getBackend($backendId); |
|
64 | 64 | |
65 | - /** |
|
66 | - * removes all registered backend instances |
|
67 | - * @return void |
|
68 | - * @since 14.0.0 |
|
69 | - */ |
|
70 | - public function clear(); |
|
65 | + /** |
|
66 | + * removes all registered backend instances |
|
67 | + * @return void |
|
68 | + * @since 14.0.0 |
|
69 | + */ |
|
70 | + public function clear(); |
|
71 | 71 | } |
@@ -31,41 +31,41 @@ |
||
31 | 31 | */ |
32 | 32 | interface IManager { |
33 | 33 | |
34 | - /** |
|
35 | - * Registers a room backend |
|
36 | - * |
|
37 | - * @param string $backendClass |
|
38 | - * @return void |
|
39 | - * @since 14.0.0 |
|
40 | - */ |
|
41 | - public function registerBackend(string $backendClass); |
|
34 | + /** |
|
35 | + * Registers a room backend |
|
36 | + * |
|
37 | + * @param string $backendClass |
|
38 | + * @return void |
|
39 | + * @since 14.0.0 |
|
40 | + */ |
|
41 | + public function registerBackend(string $backendClass); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Unregisters a room backend |
|
45 | - * |
|
46 | - * @param string $backendClass |
|
47 | - * @return void |
|
48 | - * @since 14.0.0 |
|
49 | - */ |
|
50 | - public function unregisterBackend(string $backendClass); |
|
43 | + /** |
|
44 | + * Unregisters a room backend |
|
45 | + * |
|
46 | + * @param string $backendClass |
|
47 | + * @return void |
|
48 | + * @since 14.0.0 |
|
49 | + */ |
|
50 | + public function unregisterBackend(string $backendClass); |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return IBackend[] |
|
54 | - * @since 14.0.0 |
|
55 | - */ |
|
56 | - public function getBackends():array; |
|
52 | + /** |
|
53 | + * @return IBackend[] |
|
54 | + * @since 14.0.0 |
|
55 | + */ |
|
56 | + public function getBackends():array; |
|
57 | 57 | |
58 | - /** |
|
59 | - * @param string $backendId |
|
60 | - * @return IBackend|null |
|
61 | - * @since 14.0.0 |
|
62 | - */ |
|
63 | - public function getBackend($backendId); |
|
58 | + /** |
|
59 | + * @param string $backendId |
|
60 | + * @return IBackend|null |
|
61 | + * @since 14.0.0 |
|
62 | + */ |
|
63 | + public function getBackend($backendId); |
|
64 | 64 | |
65 | - /** |
|
66 | - * removes all registered backend instances |
|
67 | - * @return void |
|
68 | - * @since 14.0.0 |
|
69 | - */ |
|
70 | - public function clear(); |
|
65 | + /** |
|
66 | + * removes all registered backend instances |
|
67 | + * @return void |
|
68 | + * @since 14.0.0 |
|
69 | + */ |
|
70 | + public function clear(); |
|
71 | 71 | } |