Commit 86eea041 authored by Ralf Becker's avatar Ralf Becker

ZP-678 Allow to autoload backends. Released under the Affero GNU General...

ZP-678 Allow to autoload backends. Released under the Affero GNU General Public License (AGPL) version 3. Do not try to include backend, if it can be or is already autoloaded. Allows to place backends outside z-push package.
parent 35763ff2
......@@ -485,7 +485,7 @@ class ZPush {
$loaded = false;
foreach (self::$autoloadBackendPreference as $autoloadBackend) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZPush::GetBackend(): trying autoload backend '%s'", $autoloadBackend));
$loaded = self::IncludeBackend($autoloadBackend);
$loaded = class_exists($autoloadBackend) || self::IncludeBackend($autoloadBackend);
if ($loaded) {
$ourBackend = $autoloadBackend;
break;
......@@ -494,7 +494,7 @@ class ZPush {
if (!$ourBackend || !$loaded)
throw new FatalMisconfigurationException("No Backend provider can not be loaded. Check your installation and configuration!");
}
else
elseif (!class_exists($ourBackend))
self::IncludeBackend($ourBackend);
if (class_exists($ourBackend))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment