Skip to content

Commit 22889d4

Browse files
committed
chore: deprecate OC_Helper::isReadOnlyConfigEnabled
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent e2a331f commit 22889d4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

lib/base.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ public static function checkConfig(): void {
196196

197197
// Check if config is writable
198198
$configFileWritable = is_writable($configFilePath);
199-
if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled()
199+
$configReadOnly = Server::get(IConfig::class)->getSystemValueBool('config_is_read_only');
200+
if (!$configFileWritable && !$configReadOnly
200201
|| !$configFileWritable && \OCP\Util::needUpgrade()) {
201202
$urlGenerator = Server::get(IURLGenerator::class);
202203
$l = Server::get(\OCP\L10N\IFactory::class)->get('lib');

lib/private/legacy/OC_Helper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public static function is_function_enabled(string $function_name): bool {
199199

200200
/**
201201
* Try to find a program
202-
* @deprecated 25.0.0 Use \OC\BinaryFinder directly
202+
* @deprecated 25.0.0 Use \OCP\IBinaryFinder directly
203203
*/
204204
public static function findBinaryPath(string $program): ?string {
205205
$result = Server::get(IBinaryFinder::class)->findBinaryPath($program);
@@ -415,6 +415,7 @@ public static function clearStorageInfo(string $absolutePath): void {
415415
/**
416416
* Returns whether the config file is set manually to read-only
417417
* @return bool
418+
* @deprecated 32.0.0 use the `config_is_read_only` system config directly
418419
*/
419420
public static function isReadOnlyConfigEnabled() {
420421
return \OC::$server->getConfig()->getSystemValueBool('config_is_read_only', false);

lib/private/legacy/OC_Util.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public static function isDefaultExpireDateEnforced() {
9898
*
9999
* @param IUser|null $user
100100
* @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false|float Quota bytes
101+
* @deprecated 9.0.0 - Use \OCP\IUser::getQuota
101102
*/
102103
public static function getUserQuota(?IUser $user) {
103104
if (is_null($user)) {
@@ -331,7 +332,7 @@ public static function checkServer(\OC\SystemConfig $config) {
331332
}
332333

333334
// Check if config folder is writable.
334-
if (!OC_Helper::isReadOnlyConfigEnabled()) {
335+
if (!(bool)$config->getValue('config_is_read_only', false)) {
335336
if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
336337
$errors[] = [
337338
'error' => $l->t('Cannot write into "config" directory.'),

0 commit comments

Comments
 (0)