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

Reduce OC_Config usage in lib/
This commit is contained in:
Thomas Müller 2015-12-02 15:44:25 +01:00
commit c35a450cb1
4 changed files with 10 additions and 8 deletions

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);
}

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');

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` & ?';

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();