summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-08-20 14:08:18 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-08-20 16:35:38 +0200
commitb09620651cbb72e5a623d47ed409e949b114c7cf (patch)
tree7ebae0d2f95477044de84c666f07b341da7b5efd /lib
parent420a3762cba2f8ef300f95f7c9de188bcbef65bb (diff)
downloadnextcloud-server-b09620651cbb72e5a623d47ed409e949b114c7cf.tar.gz
nextcloud-server-b09620651cbb72e5a623d47ed409e949b114c7cf.zip
Don't use deprecated getIniWrapper() anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php2
-rwxr-xr-xlib/private/LargeFileHelper.php4
-rw-r--r--lib/private/Memcache/APCu.php5
-rw-r--r--lib/private/Server.php4
-rw-r--r--lib/private/Setup.php2
-rw-r--r--lib/private/TempManager.php16
-rw-r--r--lib/private/TemplateLayout.php5
-rw-r--r--lib/private/legacy/OC_Files.php3
-rw-r--r--lib/private/legacy/OC_Helper.php7
-rw-r--r--lib/private/legacy/OC_Util.php5
10 files changed, 30 insertions, 23 deletions
diff --git a/lib/base.php b/lib/base.php
index 8b8e8e5fe32..6b715f9c248 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -936,7 +936,7 @@ class OC {
\OC::$server->getSession()->clear();
$setupHelper = new OC\Setup(
$systemConfig,
- \OC::$server->getIniWrapper(),
+ \OC::$server->get(\bantu\IniGetWrapper\IniGetWrapper::class),
\OC::$server->getL10N('lib'),
\OC::$server->query(\OCP\Defaults::class),
\OC::$server->getLogger(),
diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php
index 2a6a6714eb3..c4e76d22c5a 100755
--- a/lib/private/LargeFileHelper.php
+++ b/lib/private/LargeFileHelper.php
@@ -29,6 +29,8 @@
namespace OC;
+use bantu\IniGetWrapper\IniGetWrapper;
+
/**
* Helper class for large files on 32-bit platforms.
*/
@@ -117,7 +119,7 @@ class LargeFileHelper {
* null on failure.
*/
public function getFileSizeViaCurl($fileName) {
- if (\OC::$server->getIniWrapper()->getString('open_basedir') === '') {
+ if (\OC::$server->get(IniGetWrapper::class)->getString('open_basedir') === '') {
$encodedFileName = rawurlencode($fileName);
$ch = curl_init("file:///$encodedFileName");
curl_setopt($ch, CURLOPT_NOBODY, true);
diff --git a/lib/private/Memcache/APCu.php b/lib/private/Memcache/APCu.php
index 87d72ec1968..f7ef6eb2d3e 100644
--- a/lib/private/Memcache/APCu.php
+++ b/lib/private/Memcache/APCu.php
@@ -28,6 +28,7 @@
namespace OC\Memcache;
+use bantu\IniGetWrapper\IniGetWrapper;
use OCP\IMemcache;
class APCu extends Cache implements IMemcache {
@@ -154,9 +155,9 @@ class APCu extends Cache implements IMemcache {
public static function isAvailable() {
if (!extension_loaded('apcu')) {
return false;
- } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) {
+ } elseif (!\OC::$server->get(IniGetWrapper::class)->getBool('apc.enabled')) {
return false;
- } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enable_cli') && \OC::$CLI) {
+ } elseif (!\OC::$server->get(IniGetWrapper::class)->getBool('apc.enable_cli') && \OC::$CLI) {
return false;
} elseif (
version_compare(phpversion('apc') ?: '0.0.0', '4.0.6') === -1 &&
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 9b452f21ce1..e1dce286a2a 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -1012,7 +1012,7 @@ class Server extends ServerContainer implements IServerContainer {
return $factory->getLDAPProvider();
});
$this->registerService(ILockingProvider::class, function (Server $c) {
- $ini = $c->getIniWrapper();
+ $ini = $c->get(IniGetWrapper::class);
$config = $c->getConfig();
$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
@@ -1953,7 +1953,7 @@ class Server extends ServerContainer implements IServerContainer {
* @deprecated
*/
public function getIniWrapper() {
- return $this->query('IniWrapper');
+ return $this->query(IniGetWrapper::class);
}
/**
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 775c2d0a952..839ef9f7bea 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -503,7 +503,7 @@ class Setup {
$setupHelper = new \OC\Setup(
$config,
- \OC::$server->getIniWrapper(),
+ \OC::$server->get(IniGetWrapper::class),
\OC::$server->getL10N('lib'),
\OC::$server->query(Defaults::class),
\OC::$server->getLogger(),
diff --git a/lib/private/TempManager.php b/lib/private/TempManager.php
index 49d4ee94cf6..b4db44f6b1c 100644
--- a/lib/private/TempManager.php
+++ b/lib/private/TempManager.php
@@ -31,30 +31,30 @@
namespace OC;
+use bantu\IniGetWrapper\IniGetWrapper;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\ITempManager;
+use Psr\Log\LoggerInterface;
class TempManager implements ITempManager {
/** @var string[] Current temporary files and folders, used for cleanup */
protected $current = [];
/** @var string i.e. /tmp on linux systems */
protected $tmpBaseDir;
- /** @var ILogger */
+ /** @var LoggerInterface */
protected $log;
/** @var IConfig */
protected $config;
+ /** @var IniGetWrapper */
+ protected $iniGetWrapper;
/** Prefix */
public const TMP_PREFIX = 'oc_tmp_';
- /**
- * @param \OCP\ILogger $logger
- * @param \OCP\IConfig $config
- */
- public function __construct(ILogger $logger, IConfig $config) {
+ public function __construct(LoggerInterface $logger, IConfig $config, IniGetWrapper $iniGetWrapper) {
$this->log = $logger;
$this->config = $config;
+ $this->iniGetWrapper = $iniGetWrapper;
$this->tmpBaseDir = $this->getTempBaseDir();
}
@@ -218,7 +218,7 @@ class TempManager implements ITempManager {
if ($temp = $this->config->getSystemValue('tempdirectory', null)) {
$directories[] = $temp;
}
- if ($temp = \OC::$server->getIniWrapper()->get('upload_tmp_dir')) {
+ if ($temp = $this->iniGetWrapper->get('upload_tmp_dir')) {
$directories[] = $temp;
}
if ($temp = getenv('TMP')) {
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index af3aeb440d2..4a0ec75b517 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -44,6 +44,7 @@
namespace OC;
+use bantu\IniGetWrapper\IniGetWrapper;
use OC\Search\SearchQuery;
use OC\Template\JSCombiner;
use OC\Template\JSConfigHelper;
@@ -202,7 +203,7 @@ class TemplateLayout extends \OC_Template {
\OC::$server->getUserSession()->getUser(),
$this->config,
\OC::$server->getGroupManager(),
- \OC::$server->getIniWrapper(),
+ \OC::$server->get(IniGetWrapper::class),
\OC::$server->getURLGenerator(),
\OC::$server->getCapabilitiesManager(),
\OC::$server->query(IInitialStateService::class)
@@ -259,7 +260,7 @@ class TemplateLayout extends \OC_Template {
}
}
}
-
+
$this->assign('initialStates', $this->initialState->getInitialStates());
}
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php
index ddb824cd6cd..f5f91fc9958 100644
--- a/lib/private/legacy/OC_Files.php
+++ b/lib/private/legacy/OC_Files.php
@@ -41,6 +41,7 @@
*
*/
+use bantu\IniGetWrapper\IniGetWrapper;
use OC\Files\View;
use OC\Streamer;
use OCP\Lock\ILockingProvider;
@@ -164,7 +165,7 @@ class OC_Files {
OC_Util::obEnd();
$streamer->sendHeaders($name);
- $executionTime = (int)OC::$server->getIniWrapper()->getNumeric('max_execution_time');
+ $executionTime = (int)OC::$server->get(IniGetWrapper::class)->getNumeric('max_execution_time');
if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
@set_time_limit(0);
}
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 8cd492de117..4e9c5cffe98 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -44,6 +44,7 @@
*
*/
+use bantu\IniGetWrapper\IniGetWrapper;
use Symfony\Component\Process\ExecutableFinder;
/**
@@ -220,7 +221,7 @@ class OC_Helper {
// Default check will be done with $path directories :
$dirs = explode(PATH_SEPARATOR, $path);
// WARNING : We have to check if open_basedir is enabled :
- $obd = OC::$server->getIniWrapper()->getString('open_basedir');
+ $obd = OC::$server->get(IniGetWrapper::class)->getString('open_basedir');
if ($obd != "none") {
$obd_values = explode(PATH_SEPARATOR, $obd);
if (count($obd_values) > 0 and $obd_values[0]) {
@@ -414,7 +415,7 @@ class OC_Helper {
* @return int PHP upload file size limit
*/
public static function uploadLimit() {
- $ini = \OC::$server->getIniWrapper();
+ $ini = \OC::$server->get(IniGetWrapper::class);
$upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize'));
$post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size'));
if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) {
@@ -436,7 +437,7 @@ class OC_Helper {
if (!function_exists($function_name)) {
return false;
}
- $ini = \OC::$server->getIniWrapper();
+ $ini = \OC::$server->get(IniGetWrapper::class);
$disabled = explode(',', $ini->get('disable_functions') ?: '');
$disabled = array_map('trim', $disabled);
if (in_array($function_name, $disabled)) {
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index f2aa0545afd..caae862ad41 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -62,6 +62,7 @@
*
*/
+use bantu\IniGetWrapper\IniGetWrapper;
use OC\AppFramework\Http\Request;
use OC\Files\Storage\LocalRootStorage;
use OCP\IConfig;
@@ -738,7 +739,7 @@ class OC_Util {
$webServerRestart = false;
$setup = new \OC\Setup(
$config,
- \OC::$server->getIniWrapper(),
+ \OC::$server->get(IniGetWrapper::class),
\OC::$server->getL10N('lib'),
\OC::$server->query(\OCP\Defaults::class),
\OC::$server->getLogger(),
@@ -863,7 +864,7 @@ class OC_Util {
$missingDependencies = [];
$invalidIniSettings = [];
- $iniWrapper = \OC::$server->getIniWrapper();
+ $iniWrapper = \OC::$server->get(IniGetWrapper::class);
foreach ($dependencies['classes'] as $class => $module) {
if (!class_exists($class)) {
$missingDependencies[] = $module;