Commit cf3ad6fb authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #36 in ZP/z-push from feature/ZP-678-allow-to-autoload-backends to develop

* commit '86eea041':
  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.
parents 113e7645 86eea041
......@@ -144,7 +144,7 @@ class ZPush {
self::COMMAND_SETTINGS => array(self::ASV_12, self::REQUESTHANDLER => "Settings"),
self::COMMAND_WEBSERVICE_DEVICE => array(self::REQUESTHANDLER => "Webservice", self::PLAININPUT, self::NOACTIVESYNCCOMMAND, self::WEBSERVICECOMMAND),
self::COMMAND_WEBSERVICE_USERS => array(self::REQUESTHANDLER => "Webservice", self::PLAININPUT, self::NOACTIVESYNCCOMMAND, self::WEBSERVICECOMMAND),
self::COMMAND_WEBSERVICE_USERS => array(self::REQUESTHANDLER => "Webservice", self::PLAININPUT, self::NOACTIVESYNCCOMMAND, self::WEBSERVICECOMMAND),
);
......@@ -273,10 +273,10 @@ class ZPush {
else if (SINK_FORCERECHECK !== false && (!is_int(SINK_FORCERECHECK) || SINK_FORCERECHECK < 1))
throw new FatalMisconfigurationException("The SINK_FORCERECHECK value must be 'false' or a number higher than 0.");
if (!defined('SYNC_CONTACTS_MAXPICTURESIZE')) {
define('SYNC_CONTACTS_MAXPICTURESIZE', 49152);
}
else if ((!is_int(SYNC_CONTACTS_MAXPICTURESIZE) || SYNC_CONTACTS_MAXPICTURESIZE < 1))
if (!defined('SYNC_CONTACTS_MAXPICTURESIZE')) {
define('SYNC_CONTACTS_MAXPICTURESIZE', 49152);
}
else if ((!is_int(SYNC_CONTACTS_MAXPICTURESIZE) || SYNC_CONTACTS_MAXPICTURESIZE < 1))
throw new FatalMisconfigurationException("The SYNC_CONTACTS_MAXPICTURESIZE value must be a number higher than 0.");
if (!defined('USE_PARTIAL_FOLDERSYNC')) {
......@@ -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