Commit 1a90a945 authored by skummer's avatar skummer

ZP-149

- added: semantic checks can be globally disabled setting DO_SEMANTIC_CHECKS to false

git-svn-id: https://z-push.org/svn/z-push/trunk@1368 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent cabc0616
...@@ -195,6 +195,11 @@ class SyncAppointment extends SyncObject { ...@@ -195,6 +195,11 @@ class SyncAppointment extends SyncObject {
*/ */
public function Check($logAsDebug = false) { public function Check($logAsDebug = false) {
$ret = parent::Check($logAsDebug); $ret = parent::Check($logAsDebug);
// semantic checks general "turn off switch"
if (defined("DO_SEMANTIC_CHECKS") && DO_SEMANTIC_CHECKS === false)
return $ret;
if (!$ret) if (!$ret)
return false; return false;
......
...@@ -219,6 +219,12 @@ abstract class SyncObject extends Streamer { ...@@ -219,6 +219,12 @@ abstract class SyncObject extends Streamer {
* @return boolean * @return boolean
*/ */
public function Check($logAsDebug = false) { public function Check($logAsDebug = false) {
// semantic checks general "turn off switch"
if (defined("DO_SEMANTIC_CHECKS") && DO_SEMANTIC_CHECKS === false) {
ZLog::Write(LOGLEVEL_DEBUG, "SyncObject->Check(): semantic checks disabled. Check your config for 'DO_SEMANTIC_CHECKS'.");
return true;
}
$defaultLogLevel = LOGLEVEL_WARN; $defaultLogLevel = LOGLEVEL_WARN;
// in some cases non-false checks should not provoke a WARN log but only a DEBUG log // in some cases non-false checks should not provoke a WARN log but only a DEBUG log
......
...@@ -146,6 +146,11 @@ class SyncTask extends SyncObject { ...@@ -146,6 +146,11 @@ class SyncTask extends SyncObject {
*/ */
public function Check($logAsDebug = false) { public function Check($logAsDebug = false) {
$ret = parent::Check($logAsDebug); $ret = parent::Check($logAsDebug);
// semantic checks general "turn off switch"
if (defined("DO_SEMANTIC_CHECKS") && DO_SEMANTIC_CHECKS === false)
return $ret;
if (!$ret) if (!$ret)
return false; return false;
......
...@@ -136,6 +136,11 @@ class SyncTaskRecurrence extends SyncObject { ...@@ -136,6 +136,11 @@ class SyncTaskRecurrence extends SyncObject {
*/ */
public function Check($logAsDebug = false) { public function Check($logAsDebug = false) {
$ret = parent::Check($logAsDebug); $ret = parent::Check($logAsDebug);
// semantic checks general "turn off switch"
if (defined("DO_SEMANTIC_CHECKS") && DO_SEMANTIC_CHECKS === false)
return $ret;
if (!$ret) if (!$ret)
return false; return false;
......
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