Browse Source

Merge pull request #20896 from owncloud/reduce-oc_config-usage

Reduce OC_Config usage in lib/
tags/v9.0beta1
Thomas Müller 8 years ago
parent
commit
c35a450cb1

+ 3
- 3
lib/private/files/filesystem.php View File

@@ -386,7 +386,7 @@ class Filesystem {
throw new \OC\User\NoUserException('Backends provided no user object for ' . $user);
}

$homeStorage = \OC_Config::getValue('objectstore');
$homeStorage = \OC::$server->getConfig()->getSystemValue('objectstore');
if (!empty($homeStorage)) {
// sanity checks
if (empty($homeStorage['class'])) {
@@ -458,7 +458,7 @@ class Filesystem {
* @param string $user user name
*/
private static function mountCacheDir($user) {
$cacheBaseDir = \OC_Config::getValue('cache_path', '');
$cacheBaseDir = \OC::$server->getConfig()->getSystemValue('cache_path', '');
if ($cacheBaseDir !== '') {
$cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user;
if (!file_exists($cacheDir)) {
@@ -603,7 +603,7 @@ class Filesystem {
static public function isFileBlacklisted($filename) {
$filename = self::normalizePath($filename);

$blacklist = \OC_Config::getValue('blacklisted_files', array('.htaccess'));
$blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', array('.htaccess'));
$filename = strtolower(basename($filename));
return in_array($filename, $blacklist);
}

+ 3
- 2
lib/private/preview/office.php View File

@@ -79,8 +79,9 @@ abstract class Office extends Provider {
private function initCmd() {
$cmd = '';

if (is_string(\OC_Config::getValue('preview_libreoffice_path', null))) {
$cmd = \OC_Config::getValue('preview_libreoffice_path', null);
$libreOfficePath = \OC::$server->getConfig()->getSystemValue('preview_libreoffice_path', null);
if (is_string($libreOfficePath)) {
$cmd = $libreOfficePath;
}

$whichLibreOffice = shell_exec('command -v libreoffice');

+ 1
- 1
lib/private/share/share.php View File

@@ -1149,7 +1149,7 @@ class Share extends Constants {
if (!empty($ids)) {
$ids = "'".implode("','", $ids)."'";
// TODO this should be done with Doctrine platform objects
if (\OC_Config::getValue( "dbtype") === 'oci') {
if (\OC::$server->getConfig()->getSystemValue("dbtype") === 'oci') {
$andOp = 'BITAND(`permissions`, ?)';
} else {
$andOp = '`permissions` & ?';

+ 3
- 2
lib/public/util.php View File

@@ -361,9 +361,10 @@ class Util {
* @since 5.0.0
*/
public static function getDefaultEmailAddress($user_part) {
$user_part = \OC_Config::getValue('mail_from_address', $user_part);
$config = \OC::$server->getConfig();
$user_part = $config->getSystemValue('mail_from_address', $user_part);
$host_name = self::getServerHostName();
$host_name = \OC_Config::getValue('mail_domain', $host_name);
$host_name = $config->getSystemValue('mail_domain', $host_name);
$defaultEmailAddress = $user_part.'@'.$host_name;

$mailer = \OC::$server->getMailer();

Loading…
Cancel
Save