diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 10:20:59 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-07 10:20:59 +0100 |
commit | f3d49a89fe99e2d47779b42f9c74a10a67213b0f (patch) | |
tree | 0a8da6371692be98f168ecb11188d06a6d52cee7 /lib | |
parent | 0c3d97921fef6f0c831b1ba8da98933a8e9c87ae (diff) | |
parent | 728648ad77ba3d96d8e61f95a748702df3d615bd (diff) | |
download | nextcloud-server-f3d49a89fe99e2d47779b42f9c74a10a67213b0f.tar.gz nextcloud-server-f3d49a89fe99e2d47779b42f9c74a10a67213b0f.zip |
Merge pull request #11131 from owncloud/use-phpini-wrapper
Replacing ini_get instances with inigetwrapper usages
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files.php | 2 | ||||
-rw-r--r-- | lib/private/helper.php | 12 | ||||
-rw-r--r-- | lib/private/memcache/apc.php | 4 | ||||
-rw-r--r-- | lib/private/memcache/apcu.php | 4 | ||||
-rw-r--r-- | lib/private/memcache/xcache.php | 4 | ||||
-rw-r--r-- | lib/private/tempmanager.php | 2 | ||||
-rw-r--r-- | lib/private/util.php | 2 |
7 files changed, 16 insertions, 14 deletions
diff --git a/lib/private/files.php b/lib/private/files.php index af10f3e1e32..1cda28496cb 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -115,7 +115,7 @@ class OC_Files { self::lockFiles($view, $dir, $files); $streamer->sendHeaders($name); - $executionTime = intval(ini_get('max_execution_time')); + $executionTime = intval(OC::$server->getIniWrapper()->getNumeric('max_execution_time')); set_time_limit(0); if ($getType === self::ZIP_FILES) { foreach ($files as $file) { diff --git a/lib/private/helper.php b/lib/private/helper.php index 3cad77e6667..78a567638ef 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -441,7 +441,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 = ini_get('open_basedir'); + $obd = OC::$server->getIniWrapper()->getString('open_basedir'); if ($obd != "none") { $obd_values = explode(PATH_SEPARATOR, $obd); if (count($obd_values) > 0 and $obd_values[0]) { @@ -701,8 +701,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) { @@ -722,12 +723,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; diff --git a/lib/private/memcache/apc.php b/lib/private/memcache/apc.php index f768cdc1c6e..e38b4bd3a39 100644 --- a/lib/private/memcache/apc.php +++ b/lib/private/memcache/apc.php @@ -115,9 +115,9 @@ class APC extends Cache implements IMemcache { static public function isAvailable() { if (!extension_loaded('apc')) { return false; - } elseif (!ini_get('apc.enabled')) { + } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) { return false; - } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) { + } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enable_cli') && \OC::$CLI) { return false; } else { return true; diff --git a/lib/private/memcache/apcu.php b/lib/private/memcache/apcu.php index 9a8da2ae60c..84147233ef0 100644 --- a/lib/private/memcache/apcu.php +++ b/lib/private/memcache/apcu.php @@ -28,9 +28,9 @@ class APCu extends APC { static public function isAvailable() { if (!extension_loaded('apcu')) { return false; - } elseif (!ini_get('apc.enabled')) { + } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enabled')) { return false; - } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) { + } elseif (!\OC::$server->getIniWrapper()->getBool('apc.enable_cli') && \OC::$CLI) { return false; } elseif (version_compare(phpversion('apc'), '4.0.6') === -1) { return false; diff --git a/lib/private/memcache/xcache.php b/lib/private/memcache/xcache.php index a6265ed5622..0d2e43a1c18 100644 --- a/lib/private/memcache/xcache.php +++ b/lib/private/memcache/xcache.php @@ -118,13 +118,13 @@ class XCache extends Cache implements IMemcache { if (\OC::$CLI && !getenv('XCACHE_TEST')) { return false; } - if (!function_exists('xcache_unset_by_prefix') && ini_get('xcache.admin.enable_auth')) { + if (!function_exists('xcache_unset_by_prefix') && \OC::$server->getIniWrapper()->getBool('xcache.admin.enable_auth')) { // We do not want to use XCache if we can not clear it without // using the administration function xcache_clear_cache() // 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; } diff --git a/lib/private/tempmanager.php b/lib/private/tempmanager.php index 365d639389f..ac44b76d683 100644 --- a/lib/private/tempmanager.php +++ b/lib/private/tempmanager.php @@ -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')) { diff --git a/lib/private/util.php b/lib/private/util.php index ac42b96de2d..97b58351eaf 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1418,7 +1418,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); |