summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rwxr-xr-xlib/private/util.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index c5483c1654b..04f00f42447 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -401,14 +401,15 @@ class OC_Util {
/**
* check if the current server configuration is suitable for ownCloud
*
+ * @param \OCP\IConfig $config
* @return array arrays with error messages and hints
*/
- public static function checkServer() {
+ public static function checkServer($config) {
$l = \OC::$server->getL10N('lib');
$errors = array();
- $CONFIG_DATADIRECTORY = OC_Config::getValue('datadirectory', OC::$SERVERROOT . '/data');
+ $CONFIG_DATADIRECTORY = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data');
- if (!self::needUpgrade() && OC_Config::getValue('installed', false)) {
+ if (!self::needUpgrade($config) && $config->getSystemValue('installed', false)) {
// this check needs to be done every time
$errors = self::checkDataDirectoryValidity($CONFIG_DATADIRECTORY);
}
@@ -448,7 +449,7 @@ class OC_Util {
}
// Check if there is a writable install folder.
- if (OC_Config::getValue('appstoreenabled', true)) {
+ if ($config->getSystemValue('appstoreenabled', true)) {
if (OC_App::getInstallPath() === null
|| !is_writable(OC_App::getInstallPath())
|| !is_readable(OC_App::getInstallPath())
@@ -462,7 +463,7 @@ class OC_Util {
);
}
}
- // Create root dir.
+
if (!is_dir($CONFIG_DATADIRECTORY)) {
$success = @mkdir($CONFIG_DATADIRECTORY);
if ($success) {
@@ -1435,11 +1436,12 @@ class OC_Util {
* either when the core version is higher or any app requires
* an upgrade.
*
+ * @param \OCP\IConfig $config
* @return bool whether the core or any app needs an upgrade
*/
- public static function needUpgrade() {
- if (OC_Config::getValue('installed', false)) {
- $installedVersion = OC_Config::getValue('version', '0.0.0');
+ public static function needUpgrade($config) {
+ if ($config->getSystemValue('installed', false)) {
+ $installedVersion = $config->getSystemValue('version', '0.0.0');
$currentVersion = implode('.', OC_Util::getVersion());
if (version_compare($currentVersion, $installedVersion, '>')) {
return true;