]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replace new occurences of ini_get with IniWrapper methods
authorMorris Jobke <hey@morrisjobke.de>
Thu, 29 Oct 2015 08:52:13 +0000 (09:52 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 23 Nov 2015 13:12:36 +0000 (14:12 +0100)
lib/private/helper.php
lib/private/memcache/xcache.php
lib/private/tempmanager.php
lib/private/util.php

index 3bb81fba603c4867f69479b3a4602c4ce2cac3dc..e9fe43a4b3448ba2680083db990d5608b2005968 100644 (file)
@@ -753,8 +753,9 @@ class OC_Helper {
         * @return int PHP upload file size limit
         */
        public static function uploadLimit() {
-               $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
-               $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
+               $ini = \OC::$server->getIniWrapper();
+               $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) {
                        return INF;
                } elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) {
@@ -774,12 +775,13 @@ class OC_Helper {
                if (!function_exists($function_name)) {
                        return false;
                }
-               $disabled = explode(',', ini_get('disable_functions'));
+               $ini = \OC::$server->getIniWrapper();
+               $disabled = explode(',', $ini->get('disable_functions'));
                $disabled = array_map('trim', $disabled);
                if (in_array($function_name, $disabled)) {
                        return false;
                }
-               $disabled = explode(',', ini_get('suhosin.executor.func.blacklist'));
+               $disabled = explode(',', $ini->get('suhosin.executor.func.blacklist'));
                $disabled = array_map('trim', $disabled);
                if (in_array($function_name, $disabled)) {
                        return false;
index f1f932ba2c07c8af966f5d0a4997c5ab844a3826..0d2e43a1c18fe1b3e4d36bbcd428f6d3250e2891 100644 (file)
@@ -124,7 +124,7 @@ class XCache extends Cache implements IMemcache {
                        // AND administration functions are password-protected.
                        return false;
                }
-               $var_size = (int)ini_get('xcache.var_size');
+               $var_size = \OC::$server->getIniWrapper()->getNumeric('xcache.var_size');
                if (!$var_size) {
                        return false;
                }
index 365d639389fe468964a7d4364d2477598372466e..ac44b76d6830681f615d506f9154821fd55fd33e 100644 (file)
@@ -213,7 +213,7 @@ class TempManager implements ITempManager {
                if ($temp = $this->config->getSystemValue('tempdirectory', null)) {
                        $directories[] = $temp;
                }
-               if ($temp = ini_get('upload_tmp_dir')) {
+               if ($temp = \OC::$server->getIniWrapper()->get('upload_tmp_dir')) {
                        $directories[] = $temp;
                }
                if ($temp = getenv('TMP')) {
index 69f01c22be9637cf736b16cceb23d74e93932326..95cbc480eaf9fe0ca07d35416e6d7e99adfa50d4 100644 (file)
@@ -1415,7 +1415,7 @@ class OC_Util {
                }
                // XCache
                if (function_exists('xcache_clear_cache')) {
-                       if (ini_get('xcache.admin.enable_auth')) {
+                       if (\OC::$server->getIniWrapper()->getBool('xcache.admin.enable_auth')) {
                                \OCP\Util::writeLog('core', 'XCache opcode cache will not be cleared because "xcache.admin.enable_auth" is enabled.', \OCP\Util::WARN);
                        } else {
                                @xcache_clear_cache(XC_TYPE_PHP, 0);