Commit 51098095 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #302 in ZP/z-push from...

Merge pull request #302 in ZP/z-push from feature/ZP-986-possibility-to-disable-topcollector to develop

* commit 'dc0490a7':
  ZP-986 Added option to completely disable the TopCollector.
parents 504a5102 dc0490a7
......@@ -132,6 +132,10 @@ class TopCollector extends InterProcessData {
* @return boolean
*/
public function AnnounceInformation($addinfo, $preserve = false, $terminating = false) {
if (defined('TOPCOLLECTOR_DISABLED') && constant('TOPCOLLECTOR_DISABLED') === true) {
return true;
}
$this->latest["addinfo"] = $addinfo;
$this->latest["update"] = time();
......
......@@ -78,7 +78,7 @@ include_once(ZPUSH_CONFIG);
system("stty sane");
}
else
echo "Z-Push shared memory interprocess communication is not available.\n";
echo "Z-Push interprocess communication (IPC) is not available or TopCollector is disabled.\n";
}
catch (ZPushException $zpe) {
fwrite(STDERR, get_class($zpe) . ": ". $zpe->getMessage() . "\n");
......@@ -219,6 +219,9 @@ class ZPushTop {
* @return boolean
*/
public function IsAvailable() {
if (defined('TOPCOLLECTOR_DISABLED') && constant('TOPCOLLECTOR_DISABLED') === true) {
return false;
}
return $this->topCollector->IsActive();
}
......
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