';
if($activeConfigurations) {
- if (\OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') {
+ if (\OC::$server->getConfig()->getSystemValue( 'dbtype', 'sqlite' ) === 'oci') {
//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
$sql .= ' AND to_char(`configvalue`)=\'1\'';
} else {
$statement = $this->replaceTablePrefix($statement);
$statement = $this->adapter->fixupStatement($statement);
- if(\OC_Config::getValue( 'log_query', false)) {
+ if(\OC::$server->getSystemConfig()->getValue( 'log_query', false)) {
\OCP\Util::writeLog('core', 'DB prepare : '.$statement, \OCP\Util::DEBUG);
}
return parent::prepare($statement);
* @return \OC_DB_StatementWrapper|int
*/
public function execute($input=array()) {
- if(OC_Config::getValue( "log_query", false)) {
+ if(\OC::$server->getSystemConfig()->getValue( "log_query", false)) {
$params_str = str_replace("\n", " ", var_export($input, true));
\OCP\Util::writeLog('core', 'DB execute with arguments : '.$params_str, \OCP\Util::DEBUG);
}
* Init class data
*/
public static function init() {
- $defaultLogFile = OC_Config::getValue("datadirectory", OC::$SERVERROOT.'/data').'/owncloud.log';
- self::$logFile = OC_Config::getValue("logfile", $defaultLogFile);
+ $systemConfig = \OC::$server->getSystemConfig();
+ $defaultLogFile = $systemConfig->getValue("datadirectory", OC::$SERVERROOT.'/data').'/owncloud.log';
+ self::$logFile = $systemConfig->getValue("logfile", $defaultLogFile);
/*
* Fall back to default log file if specified logfile does not exist
*/
public static function getEntries($limit=50, $offset=0) {
self::init();
- $minLevel=OC_Config::getValue( "loglevel", \OCP\Util::WARN );
+ $minLevel = \OC::$server->getSystemConfig()->getValue("loglevel", \OCP\Util::WARN);
$entries = array();
$handle = @fopen(self::$logFile, 'rb');
if ($handle) {
class Rotate extends \OC\BackgroundJob\Job {
private $max_log_size;
public function run($logFile) {
- $this->max_log_size = \OC_Config::getValue('log_rotate_size', false);
+ $this->max_log_size = \OC::$server->getConfig()->getSystemValue('log_rotate_size', false);
if ($this->max_log_size) {
$filesize = @filesize($logFile);
if ($filesize >= $this->max_log_size) {
* Init class data
*/
public static function init() {
- openlog(OC_Config::getValue("syslog_tag", "ownCloud"), LOG_PID | LOG_CONS, LOG_USER);
+ openlog(\OC::$server->getSystemConfig()->getValue("syslog_tag", "ownCloud"), LOG_PID | LOG_CONS, LOG_USER);
// Close at shutdown
register_shutdown_function('closelog');
}
$this->loadRoutes($app);
} else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 10) === '/settings/') {
\OC::$REQUESTEDAPP = $url;
- if (!\OC_Config::getValue('maintenance', false) && !\OCP\Util::needUpgrade()) {
+ if (!\OC::$server->getConfig()->getSystemValue('maintenance', false) && !\OCP\Util::needUpgrade()) {
\OC_App::loadApps();
}
$this->loadRoutes('core');
*/
public function getHome($uid) {
if ($this->userExists($uid)) {
- return OC_Config::getValue("datadirectory", OC::$SERVERROOT . "/data") . '/' . $uid;
+ return \OC::$server->getConfig()->getSystemValue("datadirectory", OC::$SERVERROOT . "/data") . '/' . $uid;
}
return false;
*/
public function setMagicInCookie($username, $token) {
$secureCookie = \OC::$server->getRequest()->getServerProtocol() === 'https';
- $expires = time() + \OC_Config::getValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
+ $expires = time() + \OC::$server->getConfig()->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
setcookie("oc_username", $username, $expires, \OC::$WEBROOT, '', $secureCookie, true);
setcookie("oc_token", $token, $expires, \OC::$WEBROOT, '', $secureCookie, true);
setcookie("oc_remember_login", "1", $expires, \OC::$WEBROOT, '', $secureCookie, true);