summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-21 12:12:34 +0100
committerLukas Reschke <lukas@owncloud.com>2015-02-21 12:12:34 +0100
commit2f0f38761db366c392c1e3e7c8c1ded2c514ba32 (patch)
treef6a4e4c0300595e6fc6a49a4affff11256cc40c4 /lib
parent906c0e7798cea15ad66bfa3149341e0be7c715e4 (diff)
downloadnextcloud-server-2f0f38761db366c392c1e3e7c8c1ded2c514ba32.tar.gz
nextcloud-server-2f0f38761db366c392c1e3e7c8c1ded2c514ba32.zip
Add helper to check for `ini` values in `OC_Util::checkServer`
This allows to check for specific values in the PHP.ini that ownCloud requires for full compatibility. `mbstring.func_overload`: https://github.com/owncloud/core/issues/14372 `output_buffering`: http://doc.owncloud.org/server/8.0/admin_manual/configuration/big_file_upload_configuration.html#configuring-php Fixes https://github.com/owncloud/core/issues/14372 and https://github.com/owncloud/core/issues/14412
Diffstat (limited to 'lib')
-rw-r--r--lib/private/util.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 1993a7c9a98..c4e137ea48e 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -570,6 +570,7 @@ class OC_Util {
// classes = class_exists
// functions = function_exists
// defined = defined
+ // ini = ini_get
// If the dependency is not found the missing module name is shown to the EndUser
$dependencies = array(
'classes' => array(
@@ -590,9 +591,14 @@ class OC_Util {
),
'defined' => array(
'PDO::ATTR_DRIVER_NAME' => 'PDO'
- )
+ ),
+ 'ini' => [
+ 'mbstring.func_overload' => 0,
+ 'output_buffering' => false,
+ ],
);
$missingDependencies = array();
+ $invalidIniSettings = [];
$moduleHint = $l->t('Please ask your server administrator to install the module.');
foreach ($dependencies['classes'] as $class => $module) {
@@ -610,6 +616,19 @@ class OC_Util {
$missingDependencies[] = $module;
}
}
+ foreach($dependencies['ini'] as $setting => $expected) {
+ $iniWrapper = \OC::$server->getIniWrapper();
+ if(is_bool($expected)) {
+ if($iniWrapper->getBool($setting) !== $expected) {
+ $invalidIniSettings[] = [$setting, $expected];
+ }
+ }
+ if(is_int($expected)) {
+ if($iniWrapper->getNumeric($setting) !== $expected) {
+ $invalidIniSettings[] = [$setting, $expected];
+ }
+ }
+ }
foreach($missingDependencies as $missingDependency) {
$errors[] = array(
@@ -618,6 +637,13 @@ class OC_Util {
);
$webServerRestart = true;
}
+ foreach($invalidIniSettings as $setting) {
+ $errors[] = [
+ 'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], $setting[1]]),
+ 'hint' => $l->t('Adjusting this setting in php.ini will make ownCloud run again')
+ ];
+ $webServerRestart = true;
+ }
if (version_compare(phpversion(), '5.4.0', '<')) {
$errors[] = array(