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

throw new \OC\User\NoUserException('Backends provided no user object for ' . $user); 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)) { if (!empty($homeStorage)) {
// sanity checks // sanity checks
if (empty($homeStorage['class'])) { if (empty($homeStorage['class'])) {
* @param string $user user name * @param string $user user name
*/ */
private static function mountCacheDir($user) { private static function mountCacheDir($user) {
$cacheBaseDir = \OC_Config::getValue('cache_path', '');
$cacheBaseDir = \OC::$server->getConfig()->getSystemValue('cache_path', '');
if ($cacheBaseDir !== '') { if ($cacheBaseDir !== '') {
$cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user; $cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user;
if (!file_exists($cacheDir)) { if (!file_exists($cacheDir)) {
static public function isFileBlacklisted($filename) { static public function isFileBlacklisted($filename) {
$filename = self::normalizePath($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)); $filename = strtolower(basename($filename));
return in_array($filename, $blacklist); return in_array($filename, $blacklist);
} }

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

private function initCmd() { private function initCmd() {
$cmd = ''; $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'); $whichLibreOffice = shell_exec('command -v libreoffice');

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

if (!empty($ids)) { if (!empty($ids)) {
$ids = "'".implode("','", $ids)."'"; $ids = "'".implode("','", $ids)."'";
// TODO this should be done with Doctrine platform objects // 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`, ?)'; $andOp = 'BITAND(`permissions`, ?)';
} else { } else {
$andOp = '`permissions` & ?'; $andOp = '`permissions` & ?';

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

* @since 5.0.0 * @since 5.0.0
*/ */
public static function getDefaultEmailAddress($user_part) { 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 = self::getServerHostName();
$host_name = \OC_Config::getValue('mail_domain', $host_name);
$host_name = $config->getSystemValue('mail_domain', $host_name);
$defaultEmailAddress = $user_part.'@'.$host_name; $defaultEmailAddress = $user_part.'@'.$host_name;


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

Loading…
Cancel
Save