Commit 14483645 authored by Sebastian Kummer's avatar Sebastian Kummer

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

Merge pull request #192 in ZP/z-push from feature/ZP-698-Allow-different-IPC-backends-using-current-IPC-logic to develop

* commit '2bb112bd':
  ZP-698 Renamed getIsDownTime() to getIsDownUntil().
  ZP-698 Fixed name as it was wrong in the correction comments.
  ZP-698 Another dot in a class that shouldn't need to be touched.
  ZP-698 added a dot before someone gets crazy and writes another 64 comments about it.
  ZP-698 fixed typo in memcached provider filename, when waiting for a mutex only log up to 5 messages (spread over the configured total amount of time), if memcache is down don't retry in other connections for up to 30 seconds (configurable), removed TCP_NODELAY and NO_BLOCK options, memcache servers are setup in a single string, renamed ReInitSharedMem() to ReInitIPC(), fixed comments and public/private/protected visibility, fixed upper/lowercasing of method names, added some dots.
  ZP-698 Remove debug.
  ZP-698 Renamed IPC backend to IPC Provider, added general config section, added config file for memcache provider, InterProcessData autoloads available IPC providers.
  ZP-698 Allow different IPC backends using current IPC logic. Released under the Affero GNU General Public License (AGPL) version 3. adding a Memcached backend and - by default disabled - configuration in config.php
  ZP-698 Allow different IPC backends using current IPC logic. Released under the Affero GNU General Public License (AGPL) version 3. split up into a backend interface, a SHM backend and abstract class
  ZP-698 Allow different IPC backends using current IPC logic. Released under the Affero GNU General Public License (AGPL) version 3.
parents d3390c22 2bb112bd
<?php
/***********************************************
* File : ipcmemcached/config.php
* Project : Z-Push
* Descr : Configuration file for the
* memcache IPC provider.
*
* Created : 02.05.2016
*
* Copyright 2007-2016 Zarafa Deutschland GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation with the following additional
* term according to sec. 7:
*
* According to sec. 7 of the GNU Affero General Public License, version 3,
* the terms of the AGPL are supplemented with the following terms:
*
* "Zarafa" is a registered trademark of Zarafa B.V.
* "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
* The licensing of the Program under the AGPL does not imply a trademark license.
* Therefore any rights, title and interest in our trademarks remain entirely with us.
*
* However, if you propagate an unmodified version of the Program you are
* allowed to use the term "Z-Push" to indicate that you distribute the Program.
* Furthermore you may use our trademarks where it is necessary to indicate
* the intended purpose of a product or service provided you use it in accordance
* with honest practices in industrial or commercial matters.
* If you want to propagate modified versions of the Program under the name "Z-Push",
* you may only do so if you have a written permission by Zarafa Deutschland GmbH
* (to acquire a permission please contact Zarafa at trademark@zarafa.com).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Consult LICENSE file for details
************************************************/
// Comma separated list of available memcache servers.
// Servers can be added as 'hostname:port,otherhost:port'
define('MEMCACHED_SERVERS','localhost:11211');
// Memcached down indicator
// In case memcached is not available, a lock file will be written to disk
define('MEMCACHED_DOWN_LOCK_FILE', '/tmp/z-push-memcache-down');
// indicates how long the lock file will be maintained (in seconds)
define('MEMCACHED_DOWN_LOCK_EXPIRATION', 30);
// Prefix to used for keys
define('MEMCACHED_PREFIX', 'z-push-ipc');
// Connection timeout in ms
define('MEMCACHED_TIMEOUT', 100);
// Mutex timeout (in seconds)
define('MEMCACHED_MUTEX_TIMEOUT', 5);
// Waiting time before re-trying to aquire mutex (in ms), must be higher than 0
define('MEMCACHED_BLOCK_WAIT', 10);
<?php
/***********************************************
* File : ipcmemcachedprovider.php
* Project : Z-Push
* Descr : IPC provider using Memcached PHP extension
* and memcached servers defined in
* $zpush_ipc_memcached_servers
*
* Created : 22.11.2015 by Ralf Becker <rb@stylite.de>
*
* Copyright 2007 - 2016 Zarafa Deutschland GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation with the following additional
* term according to sec. 7:
*
* According to sec. 7 of the GNU Affero General Public License, version 3,
* the terms of the AGPL are supplemented with the following terms:
*
* "Zarafa" is a registered trademark of Zarafa B.V.
* "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
* The licensing of the Program under the AGPL does not imply a trademark license.
* Therefore any rights, title and interest in our trademarks remain entirely with us.
*
* However, if you propagate an unmodified version of the Program you are
* allowed to use the term "Z-Push" to indicate that you distribute the Program.
* Furthermore you may use our trademarks where it is necessary to indicate
* the intended purpose of a product or service provided you use it in accordance
* with honest practices in industrial or commercial matters.
* If you want to propagate modified versions of the Program under the name "Z-Push",
* you may only do so if you have a written permission by Zarafa Deutschland GmbH
* (to acquire a permission please contact Zarafa at trademark@zarafa.com).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Consult LICENSE file for details
************************************************/
class IpcMemcachedProvider implements IIpcProvider {
protected $type;
private $maxWaitCycles;
private $logWaitCycles;
private $isDownUntil;
private $wasDown;
private $reconnectCount;
/**
* Instance of memcached class
*
* @var memcached
*/
protected $memcached;
/**
* Constructor
*
* @param int $type
* @param int $allocate
* @param string $class
*/
public function __construct($type, $allocate, $class) {
$this->type = $type;
$this->maxWaitCycles = round(MEMCACHED_MUTEX_TIMEOUT * 1000 / MEMCACHED_BLOCK_WAIT)+1;
$this->logWaitCycles = round($this->maxWaitCycles/5);
// not used, but required by function signature
unset($allocate, $class);
if (!class_exists('Memcached')) {
throw new FatalMisconfigurationException("IpcMemcachedProvider failure: can not find class Memcached. Please make sure the php memcached extension is installed.");
}
$this->reconnectCount = 0;
$this->init();
// check if memcached was down recently
$this->isDownUntil = $this->getIsDownUntil();
$this->wasDown = ! $this->IsActive();
}
/**
* Initializes the Memcached object & connection.
*
* @access private
* @return void
*/
private function init() {
$this->memcached = new Memcached(md5(MEMCACHED_SERVERS) . $this->reconnectCount++);
$this->memcached->setOptions(array(
// setting a short timeout, to better kope with failed nodes
Memcached::OPT_CONNECT_TIMEOUT => MEMCACHED_TIMEOUT,
Memcached::OPT_SEND_TIMEOUT => MEMCACHED_TIMEOUT * 1000,
Memcached::OPT_RECV_TIMEOUT => MEMCACHED_TIMEOUT * 1000,
// use igbinary, if available
Memcached::OPT_SERIALIZER => Memcached::HAVE_IGBINARY ? Memcached::SERIALIZER_IGBINARY : (Memcached::HAVE_JSON ? Memcached::SERIALIZER_JSON : Memcached::SERIALIZER_PHP),
// use more efficient binary protocol (also required for consistent hashing)
Memcached::OPT_BINARY_PROTOCOL => true,
// enable Libketama compatible consistent hashing
Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
// automatic failover and disabling of failed nodes
Memcached::OPT_SERVER_FAILURE_LIMIT => 2,
Memcached::OPT_AUTO_EJECT_HOSTS => true,
// setting a prefix for all keys
Memcached::OPT_PREFIX_KEY => MEMCACHED_PREFIX,
));
// with persistent connections, only add servers, if they not already added!
if (!count($this->memcached->getServerList())) {
foreach(explode(',', MEMCACHED_SERVERS) as $host_port) {
list($host,$port) = explode(':', trim($host_port));
$this->memcached->addServer($host, $port);
}
}
}
/**
* Reinitializes the IPC data. If the provider has no way of performing
* this action, it should return 'false'.
*
* @access public
* @return boolean
*/
public function ReInitIPC() {
// this is not supported in memcache
return false;
}
/**
* Cleans up the IPC data block.
*
* @access public
* @return boolean
*/
public function Clean() {
return false;
}
/**
* Indicates if the IPC is active.
*
* @access public
* @return boolean
*/
public function IsActive() {
$down = $this->isDownUntil > time();
// reconnect if we were down but should retry now
if (!$down && $this->wasDown) {
ZLog::Write(LOGLEVEL_DEBUG, "IpcMemcachedProvider->IsActive(): memcache was down, trying to reconnect");
$this->init();
$this->wasDown = false;
}
return !$down;
}
/**
* Blocks the class mutex.
* Method blocks until mutex is available!
* ATTENTION: make sure that you *always* release a blocked mutex!
*
* We try to add mutex to our cache, until we succeed.
* It will fail as long other client has stored it or the
* MEMCACHED_MUTEX_TIMEOUT is reached.
*
* @access public
* @return boolean
*/
public function BlockMutex() {
if (!$this->IsActive()) {
return false;
}
$n = 0;
while(!$this->memcached->add($this->type+10, true, MEMCACHED_MUTEX_TIMEOUT)) {
if (++$n % $this->logWaitCycles == 0) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("IpcMemcachedProvider->BlockMutex() waiting to aquire mutex for type: %s ", $this->type));
}
// wait before retrying
usleep(MEMCACHED_BLOCK_WAIT * 1000);
if ($n > $this->maxWaitCycles) {
ZLog::Write(LOGLEVEL_ERROR, sprintf("IpcMemcachedProvider->BlockMutex() could not aquire mutex for type: %s. Check memcache service!", $this->type));
$this->markAsDown();
return false;
}
}
if ($n) {
ZLog::Write(LOGLEVEL_WARN, sprintf("IpcMemcachedProvider->BlockMutex() mutex aquired after waiting for %sms for type: %s", ($n*MEMCACHED_BLOCK_WAIT), $this->type));
}
return true;
}
/**
* Releases the class mutex.
* After the release other processes are able to block the mutex themselves.
*
* @access public
* @return boolean
*/
public function ReleaseMutex() {
return $this->memcached->delete($this->type+10);
}
/**
* Indicates if the requested variable is available in IPC data.
*
* @param int $id int indicating the variable
*
* @access public
* @return boolean
*/
public function HasData($id = 2) {
$this->memcached->get($this->type.':'.$id);
return $this->memcached->getResultCode() === Memcached::RES_SUCCESS;
}
/**
* Returns the requested variable from IPC data.
*
* @param int $id int indicating the variable
*
* @access public
* @return mixed
*/
public function GetData($id = 2) {
return $this->memcached->get($this->type.':'.$id);
}
/**
* Writes the transmitted variable to IPC data.
* Subclasses may never use an id < 2!
*
* @param mixed $data data which should be saved into IPC data
* @param int $id int indicating the variable (bigger than 2!)
*
* @access public
* @return boolean
*/
public function SetData($data, $id = 2) {
return $this->memcached->set($this->type.':'.$id, $data);
}
/**
* Gets the epoch time until the memcache server should not be retried.
* If there is no data available, 0 is returned.
*
* @access private
* @return long
*/
private function getIsDownUntil() {
if (file_exists(MEMCACHED_DOWN_LOCK_FILE)) {
$timestamp = file_get_contents(MEMCACHED_DOWN_LOCK_FILE);
// is the lock file expired?
if ($timestamp > time()) {
ZLog::Write(LOGLEVEL_WARN, sprintf("IpcMemcachedProvider(): Memcache service is marked as down until %s.", strftime("%d.%m.%Y %H:%M:%S", $timestamp)));
return $timestamp;
}
else {
unlink(MEMCACHED_DOWN_LOCK_FILE);
}
}
return 0;
}
/**
* Indicates that memcache is not available and that it should not be retried.
*
* @access private
* @return boolean
*/
private function markAsDown() {
ZLog::Write(LOGLEVEL_WARN, sprintf("IpcMemcachedProvider(): Marking memcache service as down for %d seconds.", MEMCACHED_DOWN_LOCK_EXPIRATION));
$downUntil = time() + MEMCACHED_DOWN_LOCK_EXPIRATION;
$this->isDownUntil = $downUntil;
$this->wasDown = true;
return !!file_put_contents(MEMCACHED_DOWN_LOCK_FILE, $downUntil);
}
}
\ No newline at end of file
<?php
/***********************************************
* File : ipcsharedmemoryprovider.php
* Project : Z-Push
* Descr : IPC Provider for PHP shared memory extension
*
* Created : 20.10.2011
*
* Copyright 2007 - 2016 Zarafa Deutschland GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation with the following additional
* term according to sec. 7:
*
* According to sec. 7 of the GNU Affero General Public License, version 3,
* the terms of the AGPL are supplemented with the following terms:
*
* "Zarafa" is a registered trademark of Zarafa B.V.
* "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
* The licensing of the Program under the AGPL does not imply a trademark license.
* Therefore any rights, title and interest in our trademarks remain entirely with us.
*
* However, if you propagate an unmodified version of the Program you are
* allowed to use the term "Z-Push" to indicate that you distribute the Program.
* Furthermore you may use our trademarks where it is necessary to indicate
* the intended purpose of a product or service provided you use it in accordance
* with honest practices in industrial or commercial matters.
* If you want to propagate modified versions of the Program under the name "Z-Push",
* you may only do so if you have a written permission by Zarafa Deutschland GmbH
* (to acquire a permission please contact Zarafa at trademark@zarafa.com).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Consult LICENSE file for details
************************************************/
class IpcSharedMemoryProvider implements IIpcProvider {
private $mutexid;
private $memid;
protected $type;
protected $allocate;
/**
* Constructor
*
* @param int $type
* @param int $allocate
* @param string $class
*/
public function __construct($type, $allocate, $class) {
$this->type = $type;
$this->allocate = $allocate;
if ($this->initSharedMem())
ZLog::Write(LOGLEVEL_DEBUG, sprintf("%s(): Initialized mutexid %s and memid %s.", $class, $this->mutexid, $this->memid));
}
/**
* Allocates shared memory.
*
* @access private
* @return boolean
*/
private function initSharedMem() {
if (!function_exists('sem_get') || !function_exists('shm_attach') || !function_exists('sem_acquire')|| !function_exists('shm_get_var')) {
ZLog::Write(LOGLEVEL_INFO, "IpcSharedMemoryProvider->initSharedMem(): PHP libraries for the use shared memory are not available. Check the isntalled php packages or use e.g. the memcache IPC provider.");
return false;
}
// Create mutex
$this->mutexid = @sem_get($this->type, 1);
if ($this->mutexid === false) {
ZLog::Write(LOGLEVEL_ERROR, "IpcSharedMemoryProvider->initSharedMem(): could not aquire semaphore");
return false;
}
// Attach shared memory
$this->memid = shm_attach($this->type+10, $this->allocate);
if ($this->memid === false) {
ZLog::Write(LOGLEVEL_ERROR, "IpcSharedMemoryProvider->initSharedMem(): could not attach shared memory");
@sem_remove($this->mutexid);
$this->mutexid = false;
return false;
}
// TODO mem cleanup has to be implemented
//$this->setInitialCleanTime();
return true;
}
/**
* Removes and detaches shared memory.
*
* @access private
* @return boolean
*/
private function removeSharedMem() {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false)) {
@sem_acquire($this->mutexid);
$memid = $this->memid;
$this->memid = false;
@sem_release($this->mutexid);
@sem_remove($this->mutexid);
@shm_remove($memid);
@shm_detach($memid);
$this->mutexid = false;
return true;
}
return false;
}
/**
* Reinitializes the IPC data by removing, detaching and re-allocating it.
*
* @access public
* @return boolean
*/
public function ReInitIPC() {
return ($this->removeSharedMem() && $this->initSharedMem());
}
/**
* Cleans up the IPC data block.
*
* @access public
* @return boolean
*/
public function Clean() {
$stat = false;
// exclusive block
if ($this->BlockMutex()) {
$cleanuptime = ($this->HasData(1)) ? $this->GetData(1) : false;
// TODO implement Shared Memory cleanup
$this->ReleaseMutex();
}
// end exclusive block
return $stat;
}
/**
* Indicates if the IPC is active.
*
* @access public
* @return boolean
*/
public function IsActive() {
return ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false));
}
/**
* Blocks the class mutex.
* Method blocks until mutex is available!
* ATTENTION: make sure that you *always* release a blocked mutex!
*
* @access public
* @return boolean
*/
public function BlockMutex() {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @sem_acquire($this->mutexid);
return false;
}
/**
* Releases the class mutex.
* After the release other processes are able to block the mutex themselves.
*
* @access public
* @return boolean
*/
public function ReleaseMutex() {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @sem_release($this->mutexid);
return false;
}
/**
* Indicates if the requested variable is available in IPC data.
*
* @param int $id int indicating the variable
*
* @access public
* @return boolean
*/
public function HasData($id = 2) {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false)) {
if (function_exists("shm_has_var"))
return @shm_has_var($this->memid, $id);
else {
$some = $this->GetData($id);
return isset($some);
}
}
return false;
}
/**
* Returns the requested variable from IPC data.
*
* @param int $id int indicating the variable
*
* @access public
* @return mixed
*/
public function GetData($id = 2) {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @shm_get_var($this->memid, $id);
return ;
}
/**
* Writes the transmitted variable to IPC data.
* Subclasses may never use an id < 2!
*
* @param mixed $data data which should be saved into IPC data
* @param int $id int indicating the variable (bigger than 2!)
*
* @access public
* @return boolean
*/
public function SetData($data, $id = 2) {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @shm_put_var($this->memid, $id, $data);
return false;
}
/**
* Sets the time when the shared memory block was created.
*
* @access private
* @return boolean
*/
private function setInitialCleanTime() {
$stat = false;
// exclusive block
if ($this->BlockMutex()) {
if ($this->HasData(1) == false)
$stat = $this->SetData(time(), 1);
$this->ReleaseMutex();
}
// end exclusive block
return $stat;
}
}
......@@ -71,10 +71,19 @@
define('USE_FULLEMAIL_FOR_LOGIN', true);
/**********************************************************************************
* Default FileStateMachine settings
* Default State settings
*/
define('STATE_DIR', '/var/lib/z-push/');
/**********************************************************************************
* IPC - InterProcessCommunication
*
* Is either provided by using shared memory on a single host or
* using the memcache provider for multi-host environments.
* When another implementation should be used, the class can be set here explicitly.
* If empty Z-Push will try to use available providers.
*/
define('IPC_PROVIDER', '');
/**********************************************************************************
* Logging settings
......
......@@ -4,10 +4,11 @@
* Project : Z-Push
* Descr : Class takes care of interprocess
* communicaton for different purposes
* using a backend implementing IIpcBackend
*
* Created : 20.10.2011
*
* Copyright 2007 - 2013 Zarafa Deutschland GmbH
* Copyright 2007 - 2016 Zarafa Deutschland GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
......@@ -42,7 +43,13 @@
* Consult LICENSE file for details
************************************************/
// TODO ZP-821 - remove when autoloading
include_once('backend/ipcsharedmemory/ipcsharedmemoryprovider.php');
abstract class InterProcessData {
// Defines which IPC provider to load, first has preference
// if IPC_PROVIDER in the main config is set, that class will be loaded
const PROVIDER_LOAD_ORDER = array('IpcMemcachedProvider', 'IpcSharedMemoryProvider');
const CLEANUPTIME = 1;
static protected $devid;
......@@ -51,146 +58,95 @@ abstract class InterProcessData {
static protected $start;
protected $type;
protected $allocate;
private $mutexid;
private $memid;
protected $provider_class;
/**
* @var IIpcProvider
*/
private $ipcProvider;
/**
* Constructor
*
* @access public
*/
public function InterProcessData() {
public function __construct() {
if (!isset($this->type) || !isset($this->allocate))
throw new FatalNotImplementedException(sprintf("Class InterProcessData can not be initialized. Subclass %s did not initialize type and allocable memory.", get_class($this)));
if ($this->InitSharedMem())
ZLog::Write(LOGLEVEL_DEBUG, sprintf("%s(): Initialized mutexid %s and memid %s.", get_class($this), $this->mutexid, $this->memid));
}
/**
* Initializes internal parameters
*
* @access public
* @return boolean
*/
public function InitializeParams() {
if (!isset(self::$devid)) {
self::$devid = Request::GetDeviceID();
self::$pid = @getmypid();
self::$user = Request::GetAuthUser();
self::$start = time();
$this->provider_class = defined('IPC_PROVIDER') ? IPC_PROVIDER : false;
if (!$this->provider_class) {
foreach(self::PROVIDER_LOAD_ORDER as $provider) {
if (class_exists($provider)) {
$this->provider_class = $provider;
break;
}
return true;
}
/**
* Allocates shared memory
*
* @access private
* @return boolean
*/
private function InitSharedMem() {
// shared mem general "turn off switch"
if (defined("USE_SHARED_MEM") && USE_SHARED_MEM === false) {
ZLog::Write(LOGLEVEL_INFO, "InterProcessData::InitSharedMem(): the usage of shared memory for Z-Push has been disabled. Check your config for 'USE_SHARED_MEM'.");
return false;
}
if (!function_exists('sem_get') || !function_exists('shm_attach') || !function_exists('sem_acquire')|| !function_exists('shm_get_var')) {
ZLog::Write(LOGLEVEL_INFO, "InterProcessData::InitSharedMem(): PHP libraries for the use shared memory are not available. Functionalities like z-push-top or loop detection are not available. Check your php packages.");
return false;
try {
if (!$this->provider_class) {
throw new Exception("No IPC provider available");
}
$this->ipcProvider = new $this->provider_class($this->type, $this->allocate, get_class($this));
ZLog::Write(LOGLEVEL_DEBUG, sprintf("%s initialised with IPC provider '%s'", get_class($this), $this->provider_class));
// Create mutex
$this->mutexid = @sem_get($this->type, 1);
if ($this->mutexid === false) {
ZLog::Write(LOGLEVEL_ERROR, "InterProcessData::InitSharedMem(): could not aquire semaphore");
return false;
}
// Attach shared memory
$this->memid = shm_attach($this->type+10, $this->allocate);
if ($this->memid === false) {
ZLog::Write(LOGLEVEL_ERROR, "InterProcessData::InitSharedMem(): could not attach shared memory");
@sem_remove($this->mutexid);
$this->mutexid = false;
return false;
catch (Exception $e) {
// ipcProvider could not initialise
ZLog::Write(LOGLEVEL_ERROR, sprintf("%s could not initialise IPC provider '%s': %s", get_class($this), $this->provider_class, $e->getMessage()));
}
// TODO mem cleanup has to be implemented
//$this->setInitialCleanTime();
return true;
}
/**
* Removes and detaches shared memory
* Initializes internal parameters.
*
* @access private
* @access protected
* @return boolean
*/
private function RemoveSharedMem() {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false)) {
@sem_acquire($this->mutexid);
$memid = $this->memid;
$this->memid = false;
@sem_release($this->mutexid);
@sem_remove($this->mutexid);
@shm_remove($memid);
@shm_detach($memid);
$this->mutexid = false;
return true;
protected function initializeParams() {
if (!isset(self::$devid)) {
self::$devid = Request::GetDeviceID();
self::$pid = @getmypid();
self::$user = Request::GetAuthUser();
self::$start = time();
}
return false;
return true;
}
/**
* Reinitializes shared memory by removing, detaching and re-allocating it
* Reinitializes the IPC data by removing, detaching and re-allocating it.
*
* @access public
* @return boolean
*/
public function ReInitSharedMem() {
return ($this->RemoveSharedMem() && $this->InitSharedMem());
public function ReInitIPC() {
return $this->ipcProvider ? $this->ipcProvider->ReInitIPC() : false;
}
/**
* Cleans up the shared memory block
* Cleans up the IPC data block.
*
* @access public
* @return boolean
*/
public function Clean() {
$stat = false;
// exclusive block
if ($this->blockMutex()) {
$cleanuptime = ($this->hasData(1)) ? $this->getData(1) : false;
// TODO implement Shared Memory cleanup
$this->releaseMutex();
}
// end exclusive block
return $stat;
return $this->ipcProvider ? $this->ipcProvider->Clean() : false;
}
/**
* Indicates if the shared memory is active
* Indicates if the IPC is active.
*
* @access public
* @return boolean
*/
public function IsActive() {
return ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false));
return $this->ipcProvider ? $this->ipcProvider->IsActive() : false;
}
/**
* Blocks the class mutex
* Blocks the class mutex.
* Method blocks until mutex is available!
* ATTENTION: make sure that you *always* release a blocked mutex!
*
......@@ -198,28 +154,22 @@ abstract class InterProcessData {
* @return boolean
*/
protected function blockMutex() {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @sem_acquire($this->mutexid);
return false;
return $this->ipcProvider ? $this->ipcProvider->BlockMutex() : false;
}
/**
* Releases the class mutex
* After the release other processes are able to block the mutex themselfs
* Releases the class mutex.
* After the release other processes are able to block the mutex themselves.
*
* @access protected
* @return boolean
*/
protected function releaseMutex() {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @sem_release($this->mutexid);
return false;
return $this->ipcProvider ? $this->ipcProvider->ReleaseMutex() : false;
}
/**
* Indicates if the requested variable is available in shared memory
* Indicates if the requested variable is available in IPC data.
*
* @param int $id int indicating the variable
*
......@@ -227,19 +177,11 @@ abstract class InterProcessData {
* @return boolean
*/
protected function hasData($id = 2) {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false)) {
if (function_exists("shm_has_var"))
return @shm_has_var($this->memid, $id);
else {
$some = $this->getData($id);
return isset($some);
}
}
return false;
return $this->ipcProvider ? $this->ipcProvider->HasData($id) : false;
}
/**
* Returns the requested variable from shared memory
* Returns the requested variable from IPC data.
*
* @param int $id int indicating the variable
*
......@@ -247,49 +189,20 @@ abstract class InterProcessData {
* @return mixed
*/
protected function getData($id = 2) {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @shm_get_var($this->memid, $id);
return ;
return $this->ipcProvider ? $this->ipcProvider->GetData($id) : null;
}
/**
* Writes the transmitted variable to shared memory
* Writes the transmitted variable to IPC data.
* Subclasses may never use an id < 2!
*
* @param mixed $data data which should be saved into shared memory
* @param mixed $data data which should be saved into IPC data
* @param int $id int indicating the variable (bigger than 2!)
*
* @access protected
* @return boolean
*/
protected function setData($data, $id = 2) {
if ((isset($this->mutexid) && $this->mutexid !== false) && (isset($this->memid) && $this->memid !== false))
return @shm_put_var($this->memid, $id, $data);
return false;
}
/**
* Sets the time when the shared memory block was created
*
* @access private
* @return boolean
*/
private function setInitialCleanTime() {
$stat = false;
// exclusive block
if ($this->blockMutex()) {
if ($this->hasData(1) == false)
$stat = $this->setData(time(), 1);
$this->releaseMutex();
return $this->ipcProvider ? $this->ipcProvider->SetData($data, $id) : false;
}
// end exclusive block
return $stat;
}
}
......@@ -305,7 +305,7 @@ class LoopDetection extends InterProcessData {
*/
private function updateProcessStack() {
// initialize params
$this->InitializeParams();
$this->initializeParams();
if ($this->blockMutex()) {
$loopdata = ($this->hasData()) ? $this->getData() : array();
......@@ -354,7 +354,7 @@ class LoopDetection extends InterProcessData {
*/
private function getProcessStack() {
// initialize params
$this->InitializeParams();
$this->initializeParams();
$stack = array();
if ($this->blockMutex()) {
......@@ -401,7 +401,7 @@ class LoopDetection extends InterProcessData {
$brokenkey = self::BROKENMSGS ."-". $folderid;
// initialize params
$this->InitializeParams();
$this->initializeParams();
if ($this->blockMutex()) {
$loopdata = ($this->hasData()) ? $this->getData() : array();
......@@ -443,7 +443,7 @@ class LoopDetection extends InterProcessData {
$okIds = array();
// initialize params
$this->InitializeParams();
$this->initializeParams();
if ($this->blockMutex()) {
$loopdata = ($this->hasData()) ? $this->getData() : array();
......@@ -504,7 +504,7 @@ class LoopDetection extends InterProcessData {
*/
public function SetSyncStateUsage($folderid, $uuid, $counter) {
// initialize params
$this->InitializeParams();
$this->initializeParams();
ZLog::Write(LOGLEVEL_DEBUG, sprintf("LoopDetection->SetSyncStateUsage(): uuid: %s counter: %d", $uuid, $counter));
......@@ -551,7 +551,7 @@ class LoopDetection extends InterProcessData {
*/
public function IsSyncStateObsolete($folderid, $uuid, $counter) {
// initialize params
$this->InitializeParams();
$this->initializeParams();
$obsolete = false;
......@@ -636,7 +636,7 @@ class LoopDetection extends InterProcessData {
}
// initialize params
$this->InitializeParams();
$this->initializeParams();
$loop = false;
......
......@@ -89,7 +89,7 @@ class PingTracking extends InterProcessData {
$stat = false;
// initialize params
$this->InitializeParams();
$this->initializeParams();
// exclusive block
if ($this->blockMutex()) {
......
......@@ -63,7 +63,7 @@ class TopCollector extends InterProcessData {
parent::__construct();
// initialize params
$this->InitializeParams();
$this->initializeParams();
$this->preserved = array();
// static vars come from the parent class
......@@ -222,9 +222,10 @@ class TopCollector extends InterProcessData {
}
}
}
foreach ($toClear as $tc)
foreach ($toClear as $tc) {
unset($topdata[$tc[0]][$tc[1]][$tc[2]]);
}
}
$stat = $this->setData($topdata, self::TOPDATA);
$this->releaseMutex();
......@@ -260,6 +261,20 @@ class TopCollector extends InterProcessData {
return true;
}
/**
* Reinitializes the IPC data.
*
* @access public
* @return boolean
*/
public function ReInitIPC() {
$status = parent::ReInitIPC();
if (!status) {
$this->SetData(array(), self::TOPDATA);
}
return $status;
}
/**
* Indicates if top data should be saved or not
* Returns true for 10 seconds after the latest CollectData()
......
......@@ -57,7 +57,7 @@ class SimpleMutex extends InterProcessData {
}
/**
* Blocks the mutex
* Blocks the mutex.
* Method blocks until mutex is available!
* ATTENTION: make sure that you *always* release a blocked mutex!
*
......@@ -74,7 +74,7 @@ class SimpleMutex extends InterProcessData {
/**
* Releases the mutex
* After the release other processes are able to block the mutex themselfs
* After the release other processes are able to block the mutex themselves.
*
* @access public
* @return boolean
......
<?php
/***********************************************
* File : iipcprovider.php
* Project : Z-Push
* Descr : Interface for interprocess communication
* providers for different purposes
*
* Created : 20.10.2011
*
* Copyright 2007 - 2016 Zarafa Deutschland GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation with the following additional
* term according to sec. 7:
*
* According to sec. 7 of the GNU Affero General Public License, version 3,
* the terms of the AGPL are supplemented with the following terms:
*
* "Zarafa" is a registered trademark of Zarafa B.V.
* "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
* The licensing of the Program under the AGPL does not imply a trademark license.
* Therefore any rights, title and interest in our trademarks remain entirely with us.
*
* However, if you propagate an unmodified version of the Program you are
* allowed to use the term "Z-Push" to indicate that you distribute the Program.
* Furthermore you may use our trademarks where it is necessary to indicate
* the intended purpose of a product or service provided you use it in accordance
* with honest practices in industrial or commercial matters.
* If you want to propagate modified versions of the Program under the name "Z-Push",
* you may only do so if you have a written permission by Zarafa Deutschland GmbH
* (to acquire a permission please contact Zarafa at trademark@zarafa.com).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Consult LICENSE file for details
************************************************/
interface IIpcProvider
{
/**
* Constructor
*
* @param int $type
* @param int $allocate
* @param string $class
*/
public function __construct($type, $allocate, $class);
/**
* Reinitializes the IPC data. If the provider has no way of performing
* this action, it should return 'false'.
*
* @access public
* @return boolean
*/
public function ReInitIPC();
/**
* Cleans up the IPC data block.
*
* @access public
* @return boolean
*/
public function Clean();
/**
* Indicates if the IPC is active.
*
* @access public
* @return boolean
*/
public function IsActive();
/**
* Blocks the class mutex.
* Method blocks until mutex is available!
* ATTENTION: make sure that you *always* release a blocked mutex!
*
* @access public
* @return boolean
*/
public function BlockMutex();
/**
* Releases the class mutex.
* After the release other processes are able to block the mutex themselves.
*
* @access public
* @return boolean
*/
public function ReleaseMutex();
/**
* Indicates if the requested variable is available in IPC data.
*
* @param int $id int indicating the variable
*
* @access public
* @return boolean
*/
public function HasData($id = 2);
/**
* Returns the requested variable from IPC data.
*
* @param int $id int indicating the variable
*
* @access public
* @return mixed
*/
public function GetData($id = 2);
/**
* Writes the transmitted variable to IPC data.
* Subclasses may never use an id < 2!
*
* @param mixed $data data which should be saved into IPC data
* @param int $id int indicating the variable (bigger than 2!)
*
* @access public
* @return boolean
*/
public function SetData($data, $id = 2);
}
Copyright (c) 2015 Nils Adermann, Jordi Boggiano
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -34,6 +34,7 @@ return array(
'IChanges' => $baseDir . '/lib/interface/ichanges.php',
'IExportChanges' => $baseDir . '/lib/interface/iexportchanges.php',
'IImportChanges' => $baseDir . '/lib/interface/iimportchanges.php',
'IIpcProvider' => $baseDir . '/lib/interface/iipcprovider.php',
'ISearchProvider' => $baseDir . '/lib/interface/isearchprovider.php',
'IStateMachine' => $baseDir . '/lib/interface/istatemachine.php',
'ImportChangesDiff' => $baseDir . '/lib/default/diffbackend/importchangesdiff.php',
......
......@@ -23,6 +23,12 @@ class ComposerAutoloaderInitd6749fc2fb9944bbe86b2b7d79a7852f
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitd6749fc2fb9944bbe86b2b7d79a7852f', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitd6749fc2fb9944bbe86b2b7d79a7852f::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
......@@ -37,10 +43,15 @@ class ComposerAutoloaderInitd6749fc2fb9944bbe86b2b7d79a7852f
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitd6749fc2fb9944bbe86b2b7d79a7852f::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequired6749fc2fb9944bbe86b2b7d79a7852f($fileIdentifier, $file);
}
......
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitd6749fc2fb9944bbe86b2b7d79a7852f
{
public static $files = array (
'158e247719544c05f5e89c414f630c24' => __DIR__ . '/../..' . '/version.php',
'7e65a9fc8bb44d8c2fe16fa283aeaaee' => __DIR__ . '/../..' . '/lib/core/zpushdefs.php',
'd2a63a53b4a43a2bd71de0cec5c1abfb' => __DIR__ . '/../..' . '/lib/utils/compat.php',
);
public static $classMap = array (
'ASDevice' => __DIR__ . '/../..' . '/lib/core/asdevice.php',
'AuthenticationRequiredException' => __DIR__ . '/../..' . '/lib/exceptions/authenticationrequiredexception.php',
'Backend' => __DIR__ . '/../..' . '/lib/default/backend.php',
'BackendDiff' => __DIR__ . '/../..' . '/lib/default/diffbackend/diffbackend.php',
'BodyPreference' => __DIR__ . '/../..' . '/lib/core/bodypreference.php',
'CalDAVClient' => __DIR__ . '/../..' . '/include/z_caldav.php',
'CalendarInfo' => __DIR__ . '/../..' . '/include/z_caldav.php',
'ChangesMemoryWrapper' => __DIR__ . '/../..' . '/lib/core/changesmemorywrapper.php',
'ContentParameters' => __DIR__ . '/../..' . '/lib/core/contentparameters.php',
'DeviceManager' => __DIR__ . '/../..' . '/lib/core/devicemanager.php',
'DiffState' => __DIR__ . '/../..' . '/lib/default/diffbackend/diffstate.php',
'ExportChangesDiff' => __DIR__ . '/../..' . '/lib/default/diffbackend/exportchangesdiff.php',
'FatalException' => __DIR__ . '/../..' . '/lib/exceptions/fatalexception.php',
'FatalMisconfigurationException' => __DIR__ . '/../..' . '/lib/exceptions/fatalmisconfigurationexception.php',
'FatalNotImplementedException' => __DIR__ . '/../..' . '/lib/exceptions/fatalnotimplementedexception.php',
'FileLog' => __DIR__ . '/../..' . '/lib/log/filelog.php',
'FileStateMachine' => __DIR__ . '/../..' . '/lib/default/filestatemachine.php',
'FolderChange' => __DIR__ . '/../..' . '/lib/request/folderchange.php',
'FolderSync' => __DIR__ . '/../..' . '/lib/request/foldersync.php',
'GetAttachment' => __DIR__ . '/../..' . '/lib/request/getattachment.php',
'GetHierarchy' => __DIR__ . '/../..' . '/lib/request/gethierarchy.php',
'GetItemEstimate' => __DIR__ . '/../..' . '/lib/request/getitemestimate.php',
'HTTPReturnCodeException' => __DIR__ . '/../..' . '/lib/exceptions/httpreturncodeexception.php',
'HierarchyCache' => __DIR__ . '/../..' . '/lib/core/hierarchycache.php',
'IBackend' => __DIR__ . '/../..' . '/lib/interface/ibackend.php',
'IChanges' => __DIR__ . '/../..' . '/lib/interface/ichanges.php',
'IExportChanges' => __DIR__ . '/../..' . '/lib/interface/iexportchanges.php',
'IImportChanges' => __DIR__ . '/../..' . '/lib/interface/iimportchanges.php',
'IIpcProvider' => __DIR__ . '/../..' . '/lib/interface/iipcprovider.php',
'ISearchProvider' => __DIR__ . '/../..' . '/lib/interface/isearchprovider.php',
'IStateMachine' => __DIR__ . '/../..' . '/lib/interface/istatemachine.php',
'ImportChangesDiff' => __DIR__ . '/../..' . '/lib/default/diffbackend/importchangesdiff.php',
'ImportChangesStream' => __DIR__ . '/../..' . '/lib/core/streamimporter.php',
'InterProcessData' => __DIR__ . '/../..' . '/lib/core/interprocessdata.php',
'ItemOperations' => __DIR__ . '/../..' . '/lib/request/itemoperations.php',
'Log' => __DIR__ . '/../..' . '/lib/log/log.php',
'LoopDetection' => __DIR__ . '/../..' . '/lib/core/loopdetection.php',
'Mail_RFC822' => __DIR__ . '/../..' . '/include/z_RFC822.php',
'Mail_mimeDecode' => __DIR__ . '/../..' . '/include/mimeDecode.php',
'MeetingResponse' => __DIR__ . '/../..' . '/lib/request/meetingresponse.php',
'MoveItems' => __DIR__ . '/../..' . '/lib/request/moveitems.php',
'NoHierarchyCacheAvailableException' => __DIR__ . '/../..' . '/lib/exceptions/nohierarchycacheavailableexception.php',
'NoPostRequestException' => __DIR__ . '/../..' . '/lib/exceptions/nopostrequestexception.php',
'NotImplementedException' => __DIR__ . '/../..' . '/lib/exceptions/notimplementedexception.php',
'Notify' => __DIR__ . '/../..' . '/lib/request/notify.php',
'Ping' => __DIR__ . '/../..' . '/lib/request/ping.php',
'PingTracking' => __DIR__ . '/../..' . '/lib/core/pingtracking.php',
'Provisioning' => __DIR__ . '/../..' . '/lib/request/provisioning.php',
'ProvisioningRequiredException' => __DIR__ . '/../..' . '/lib/exceptions/provisioningrequiredexception.php',
'ReplaceNullcharFilter' => __DIR__ . '/../..' . '/lib/wbxml/replacenullcharfilter.php',
'Request' => __DIR__ . '/../..' . '/lib/request/request.php',
'RequestProcessor' => __DIR__ . '/../..' . '/lib/request/requestprocessor.php',
'ResolveRecipients' => __DIR__ . '/../..' . '/lib/request/resolverecipients.php',
'Search' => __DIR__ . '/../..' . '/lib/request/search.php',
'SearchProvider' => __DIR__ . '/../..' . '/lib/default/searchprovider.php',
'SendMail' => __DIR__ . '/../..' . '/lib/request/sendmail.php',
'Settings' => __DIR__ . '/../..' . '/lib/request/settings.php',
'SimpleMutex' => __DIR__ . '/../..' . '/lib/default/simplemutex.php',
'StateInvalidException' => __DIR__ . '/../..' . '/lib/exceptions/stateinvalidexception.php',
'StateManager' => __DIR__ . '/../..' . '/lib/core/statemanager.php',
'StateNotFoundException' => __DIR__ . '/../..' . '/lib/exceptions/statenotfoundexception.php',
'StateNotYetAvailableException' => __DIR__ . '/../..' . '/lib/exceptions/statenotyetavailableexception.php',
'StateObject' => __DIR__ . '/../..' . '/lib/core/stateobject.php',
'StatusException' => __DIR__ . '/../..' . '/lib/exceptions/statusexception.php',
'Streamer' => __DIR__ . '/../..' . '/lib/core/streamer.php',
'StringStreamWrapper' => __DIR__ . '/../..' . '/lib/utils/stringstreamwrapper.php',
'Sync' => __DIR__ . '/../..' . '/lib/request/sync.php',
'SyncAppointment' => __DIR__ . '/../..' . '/lib/syncobjects/syncappointment.php',
'SyncAppointmentException' => __DIR__ . '/../..' . '/lib/syncobjects/syncappointmentexception.php',
'SyncAttachment' => __DIR__ . '/../..' . '/lib/syncobjects/syncattachment.php',
'SyncAttendee' => __DIR__ . '/../..' . '/lib/syncobjects/syncattendee.php',
'SyncBaseAttachment' => __DIR__ . '/../..' . '/lib/syncobjects/syncbaseattachment.php',
'SyncBaseBody' => __DIR__ . '/../..' . '/lib/syncobjects/syncbasebody.php',
'SyncCollections' => __DIR__ . '/../..' . '/lib/core/synccollections.php',
'SyncContact' => __DIR__ . '/../..' . '/lib/syncobjects/synccontact.php',
'SyncDeviceInformation' => __DIR__ . '/../..' . '/lib/syncobjects/syncdeviceinformation.php',
'SyncDevicePassword' => __DIR__ . '/../..' . '/lib/syncobjects/syncdevicepassword.php',
'SyncFolder' => __DIR__ . '/../..' . '/lib/syncobjects/syncfolder.php',
'SyncItemOperationsAttachment' => __DIR__ . '/../..' . '/lib/syncobjects/syncitemoperationsattachment.php',
'SyncMail' => __DIR__ . '/../..' . '/lib/syncobjects/syncmail.php',
'SyncMailFlags' => __DIR__ . '/../..' . '/lib/syncobjects/syncmailflags.php',
'SyncMeetingRequest' => __DIR__ . '/../..' . '/lib/syncobjects/syncmeetingrequest.php',
'SyncMeetingRequestRecurrence' => __DIR__ . '/../..' . '/lib/syncobjects/syncmeetingrequestrecurrence.php',
'SyncNote' => __DIR__ . '/../..' . '/lib/syncobjects/syncnote.php',
'SyncOOF' => __DIR__ . '/../..' . '/lib/syncobjects/syncoof.php',
'SyncOOFMessage' => __DIR__ . '/../..' . '/lib/syncobjects/syncoofmessage.php',
'SyncObject' => __DIR__ . '/../..' . '/lib/syncobjects/syncobject.php',
'SyncObjectBrokenException' => __DIR__ . '/../..' . '/lib/exceptions/syncobjectbrokenexception.php',
'SyncParameters' => __DIR__ . '/../..' . '/lib/core/syncparameters.php',
'SyncProvisioning' => __DIR__ . '/../..' . '/lib/syncobjects/syncprovisioning.php',
'SyncRecurrence' => __DIR__ . '/../..' . '/lib/syncobjects/syncrecurrence.php',
'SyncResolveRecipient' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipient.php',
'SyncResolveRecipients' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipients.php',
'SyncResolveRecipientsAvailability' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipientsavailability.php',
'SyncResolveRecipientsCertificates' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipientscertificates.php',
'SyncResolveRecipientsOptions' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipientsoptions.php',
'SyncResolveRecipientsPicture' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipientspicture.php',
'SyncResolveRecipientsResponse' => __DIR__ . '/../..' . '/lib/syncobjects/syncresolverecipientsresponse.php',
'SyncSendMail' => __DIR__ . '/../..' . '/lib/syncobjects/syncsendmail.php',
'SyncSendMailSource' => __DIR__ . '/../..' . '/lib/syncobjects/syncsendmailsource.php',
'SyncTask' => __DIR__ . '/../..' . '/lib/syncobjects/synctask.php',
'SyncTaskRecurrence' => __DIR__ . '/../..' . '/lib/syncobjects/synctaskrecurrence.php',
'SyncUserInformation' => __DIR__ . '/../..' . '/lib/syncobjects/syncuserinformation.php',
'SyncValidateCert' => __DIR__ . '/../..' . '/lib/syncobjects/syncvalidatecert.php',
'Syslog' => __DIR__ . '/../..' . '/lib/log/syslog.php',
'TimezoneUtil' => __DIR__ . '/../..' . '/lib/utils/timezoneutil.php',
'TopCollector' => __DIR__ . '/../..' . '/lib/core/topcollector.php',
'Utils' => __DIR__ . '/../..' . '/lib/utils/utils.php',
'ValidateCert' => __DIR__ . '/../..' . '/lib/request/validatecert.php',
'WBXMLDecoder' => __DIR__ . '/../..' . '/lib/wbxml/wbxmldecoder.php',
'WBXMLDefs' => __DIR__ . '/../..' . '/lib/wbxml/wbxmldefs.php',
'WBXMLEncoder' => __DIR__ . '/../..' . '/lib/wbxml/wbxmlencoder.php',
'WBXMLException' => __DIR__ . '/../..' . '/lib/exceptions/wbxmlexception.php',
'Webservice' => __DIR__ . '/../..' . '/lib/webservice/webservice.php',
'WebserviceDevice' => __DIR__ . '/../..' . '/lib/webservice/webservicedevice.php',
'WebserviceUsers' => __DIR__ . '/../..' . '/lib/webservice/webserviceusers.php',
'ZLog' => __DIR__ . '/../..' . '/lib/core/zlog.php',
'ZPush' => __DIR__ . '/../..' . '/lib/core/zpush.php',
'ZPushAdmin' => __DIR__ . '/../..' . '/lib/utils/zpushadmin.php',
'ZPushAutodiscover' => __DIR__ . '/../..' . '/autodiscover/autodiscover.php',
'ZPushException' => __DIR__ . '/../..' . '/lib/exceptions/zpushexception.php',
'carddav_backend' => __DIR__ . '/../..' . '/include/z_carddav.php',
'iCalComponent' => __DIR__ . '/../..' . '/include/iCalendar.php',
'iCalProp' => __DIR__ . '/../..' . '/include/iCalendar.php',
'iCalendar' => __DIR__ . '/../..' . '/include/iCalendar.php',
'rtf' => __DIR__ . '/../..' . '/include/z_RTF.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInitd6749fc2fb9944bbe86b2b7d79a7852f::$classMap;
}, null, ClassLoader::class);
}
}
......@@ -480,7 +480,7 @@ class ZPushTop {
else if ($cmds[0] == "clear" ) {
$this->topCollector->ClearLatest(true);
$this->topCollector->CollectData(true);
$this->topCollector->ReInitSharedMem();
$this->topCollector->ReInitIPC();
}
else if ($cmds[0] == "filter" || $cmds[0] == "f") {
if (!isset($cmds[1]) || $cmds[1] == "") {
......
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