From 05e5c6181f886f06bd2224785e6a7e9ab867b31f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 31 May 2016 22:44:19 +0200 Subject: [PATCH] fix PHP Fatal error: Call to undefined method EGroupware\Api\Session::appsession() during SiteMgr installation --- api/src/Egw/Base.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/src/Egw/Base.php b/api/src/Egw/Base.php index 80be600b18..9ebef9112a 100644 --- a/api/src/Egw/Base.php +++ b/api/src/Egw/Base.php @@ -17,11 +17,6 @@ namespace EGroupware\Api\Egw; use EGroupware\Api; -// explicitly list old, non-namespaced classes -// they are only used, if phpgwapi is installed -use accounts as egw_accounts; -use egw_session; - /** * Egw\Base object used in setup, does not instanciate anything by default * @@ -119,6 +114,12 @@ class Base unset($e); return null; } + case 'session': + $class = file_exists(EGW_SERVER_ROOT.'/phpgwapi') ? 'egw_session' : 'EGroupware\\Api\\Session'; + break; + case 'accounts': + $class = file_exists(EGW_SERVER_ROOT.'/phpgwapi') ? 'accounts' : 'EGroupware\\Api\\Accounts'; + break; case 'ldap': return $this->ldap = Api\Ldap::factory(false); default: