]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replacing ini_get instances with inigetwrapper usages
authorClark Tomlinson <fallen013@gmail.com>
Wed, 17 Sep 2014 14:07:32 +0000 (10:07 -0400)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 23 Nov 2015 13:12:31 +0000 (14:12 +0100)
apps/files/admin.php
apps/files/ajax/upload.php
core/js/config.php
lib/private/files.php
lib/private/helper.php
lib/private/memcache/apc.php
lib/private/memcache/apcu.php
lib/private/memcache/xcache.php

index 786a8edf2a64207fe73bd5ed74eae78424ceb82e..f23f9b52698e65e20df7cd195dd1553b447850da 100644 (file)
@@ -30,9 +30,8 @@
 OCP\User::checkAdminUser();
 
 $htaccessWorking=(getenv('htaccessWorking')=='true');
-
-$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
+$upload_max_filesize = OC::$server->getIniWrapper()->getBytes('upload_max_filesize');
+$post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size');
 $maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
 if($_POST && OC_Util::isCallRegistered()) {
        if(isset($_POST['maxUploadSize'])) {
index 18e9cfe6117b7d591f02c8ac1743f30d76d51d3c..14f56a24b4b5f07dbe110e79246215fe7d102892 100644 (file)
@@ -114,7 +114,7 @@ foreach ($_FILES['files']['error'] as $error) {
                $errors = array(
                        UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'),
                        UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
-                       . ini_get('upload_max_filesize'),
+                       . OC::$server->getIniWrapper()->getNumeric('upload_max_filesize'),
                        UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'),
                        UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'),
                        UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'),
index 953bd2ede4550d4b7456ad3ba0a7639ad3b460f3..376e1080557caa017e4e1b6234ebc1407ba8ecb4 100644 (file)
@@ -136,7 +136,7 @@ $array = array(
        "firstDay" => json_encode($l->getFirstWeekDay()) ,
        "oc_config" => json_encode(
                array(
-                       'session_lifetime'      => min(\OCP\Config::getSystemValue('session_lifetime', ini_get('session.gc_maxlifetime')), ini_get('session.gc_maxlifetime')),
+                       'session_lifetime'      => min(\OCP\Config::getSystemValue('session_lifetime', OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')),
                        'session_keepalive'     => \OCP\Config::getSystemValue('session_keepalive', true),
                        'version'                       => implode('.', OC_Util::getVersion()),
                        'versionstring'         => OC_Util::getVersionString(),
index af10f3e1e320fe4d04da2177a7463ed56b146f07..1cda28496cbbe961142693566e48e473f37d5c22 100644 (file)
@@ -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) {
index ee2f520fe2b58cfb4f83904b2d267d9c0f4c61fa..3bb81fba603c4867f69479b3a4602c4ce2cac3dc 100644 (file)
@@ -462,7 +462,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]) {
index f768cdc1c6ef33ce8e9bcce5dec2bf09c0c9f339..e38b4bd3a397cc9a8f382e0b59784e4ea8f2d3d1 100644 (file)
@@ -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;
index 9a8da2ae60cf1eb23de7b8006b4207718a45c62d..84147233ef09765006a4d8ea2beecc8940cc9fc7 100644 (file)
@@ -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;
index a6265ed56225a796f4641bf61fa2eeae11750056..f1f932ba2c07c8af966f5d0a4997c5ab844a3826 100644 (file)
@@ -118,7 +118,7 @@ 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.