/** * @return SharedMemory **/ public function clean() { $segment = shm_attach(self::INDEX_SEGMENT); try { $index = shm_get_var($segment, 1); } catch (BaseException $e) { // nothing to clean return null; } foreach ($index as $key) { try { $sem = shm_attach($this->stringToInt($key)); shm_remove($sem); } catch (BaseException $e) { // already removed, probably } } shm_remove($segment); return parent::clean(); }
/** * @return AggregateCache **/ public function clean() { foreach ($this->peers as $peer) { $peer['object']->clean(); } $this->checkAlive(); return parent::clean(); }