remove deprecated \OC:$session
This commit is contained in:
parent
a2457b5fb9
commit
5097d4dc05
12
lib/base.php
12
lib/base.php
|
@ -66,16 +66,10 @@ class OC {
|
||||||
public static $REQUESTEDAPP = '';
|
public static $REQUESTEDAPP = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if owncloud runs in cli mode
|
* check if ownCloud runs in cli mode
|
||||||
*/
|
*/
|
||||||
public static $CLI = false;
|
public static $CLI = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use \OC::$server->getSession() instead
|
|
||||||
* @var \OC\Session\Session
|
|
||||||
*/
|
|
||||||
public static $session = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \OC\Autoloader $loader
|
* @var \OC\Autoloader $loader
|
||||||
*/
|
*/
|
||||||
|
@ -531,9 +525,7 @@ class OC {
|
||||||
|
|
||||||
\OC::$server->getEventLogger()->start('init_session', 'Initialize session');
|
\OC::$server->getEventLogger()->start('init_session', 'Initialize session');
|
||||||
OC_App::loadApps(array('session'));
|
OC_App::loadApps(array('session'));
|
||||||
if (self::$CLI) {
|
if (!self::$CLI) {
|
||||||
self::$session = new \OC\Session\Memory('');
|
|
||||||
} else {
|
|
||||||
self::initSession();
|
self::initSession();
|
||||||
}
|
}
|
||||||
\OC::$server->getEventLogger()->end('init_session');
|
\OC::$server->getEventLogger()->end('init_session');
|
||||||
|
|
|
@ -88,15 +88,6 @@ class Session implements IUserSession, Emitter {
|
||||||
* @return \OCP\ISession
|
* @return \OCP\ISession
|
||||||
*/
|
*/
|
||||||
public function getSession() {
|
public function getSession() {
|
||||||
// fetch the deprecated \OC::$session if it changed for backwards compatibility
|
|
||||||
if (isset(\OC::$session) && \OC::$session !== $this->session) {
|
|
||||||
\OC::$server->getLogger()->warning(
|
|
||||||
'One of your installed apps still seems to use the deprecated ' .
|
|
||||||
'\OC::$session and has replaced it with a new instance. Please file a bug against it.' .
|
|
||||||
'Closing and replacing session in UserSession instance.'
|
|
||||||
);
|
|
||||||
$this->setSession(\OC::$session);
|
|
||||||
}
|
|
||||||
return $this->session;
|
return $this->session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,14 +102,6 @@ class Session implements IUserSession, Emitter {
|
||||||
}
|
}
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->activeUser = null;
|
$this->activeUser = null;
|
||||||
|
|
||||||
// maintain deprecated \OC::$session
|
|
||||||
if (\OC::$session !== $this->session) {
|
|
||||||
if (\OC::$session instanceof \OCP\ISession) {
|
|
||||||
\OC::$session->close();
|
|
||||||
}
|
|
||||||
\OC::$session = $session;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue