. /** * STOMP interface for GNU social queues * * @package GNUsocial * @author Miguel Dantas * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ defined('GNUSOCIAL') || die(); class StompQueuePlugin extends Plugin { const PLUGIN_VERSION = '0.0.1'; // settings which can be set in config.php with addPlugin('StompQueue', ['param'=>'value', ...]); public $servers = null; public $vhost = ''; public $username = 'guest'; public $password = 'guest'; public $basename = ''; public $control = 'gnusocial:control'; public $breakout; public $useTransactions = false; public $useAcks = false; public $manualFailover = false; public $defaultIdx = 0; public $persistent = []; public function onStartNewQueueManager(?QueueManager &$qm) { if (empty($this->servers)) { throw new ServerException('Invalid STOMP server address'); } elseif (!is_array($this->servers)) { $this->servers = [$this->servers]; } if (empty($this->basename)) { $this->basename = 'queue:gnusocial-' . common_config('site', 'name') . ':'; } $qm = new StompQueueManager($this); return false; } public function onPluginVersion(array &$versions): bool { $versions[] = array('name' => 'StompQueue', 'version' => self::VERSION, 'author' => 'Miguel Dantas', 'description' => // TRANS: Plugin description. _m('Plugin implementing STOMP as a backend for GNU social queues')); return true; } };