From 60446dfc20f99dc7364526262f6834c319ef2ab1 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Wed, 11 Dec 2019 02:20:54 +0000 Subject: [PATCH] [CORE] Better queues defaults --- .../SYSTEM_ADMINISTRATORS/CONFIGURE.md | 2 +- lib/util/default.php | 2 +- plugins/DBQueue/DBQueuePlugin.php | 17 ++++++++++------- plugins/DBQueue/{README => README.md} | 6 ++---- plugins/RedisCache/RedisCachePlugin.php | 18 ++++++++++-------- plugins/RedisQueue/{README => README.md} | 8 ++++---- plugins/RedisQueue/RedisQueuePlugin.php | 17 ++++++++++------- plugins/StompQueue/{README => README.md} | 4 ++-- plugins/StompQueue/StompQueuePlugin.php | 17 ++++++++++------- plugins/UnQueue/README | 14 -------------- plugins/UnQueue/README.md | 10 ++++++++++ plugins/UnQueue/UnQueuePlugin.php | 14 ++++++++------ 12 files changed, 68 insertions(+), 61 deletions(-) rename plugins/DBQueue/{README => README.md} (54%) rename plugins/RedisQueue/{README => README.md} (51%) rename plugins/StompQueue/{README => README.md} (96%) delete mode 100644 plugins/UnQueue/README create mode 100644 plugins/UnQueue/README.md diff --git a/DOCUMENTATION/SYSTEM_ADMINISTRATORS/CONFIGURE.md b/DOCUMENTATION/SYSTEM_ADMINISTRATORS/CONFIGURE.md index 6a386821d0..5aca66a15b 100644 --- a/DOCUMENTATION/SYSTEM_ADMINISTRATORS/CONFIGURE.md +++ b/DOCUMENTATION/SYSTEM_ADMINISTRATORS/CONFIGURE.md @@ -228,7 +228,7 @@ sending out SMS email or XMPP messages, for off-line processing. See * `enabled` (boolean, default false): Whether to uses queues. -* `daemon` (boolean, default false): Wather to use queuedaemon. False means +* `daemon` (boolean, default false): Whether to use queuedaemon. False means you'll use OpportunisticQM plugin. * `subsystem` (enum["db", "stomp"], default 'db'): Which kind of queueserver to diff --git a/lib/util/default.php b/lib/util/default.php index 7df0f6172a..1fc7fe52fe 100644 --- a/lib/util/default.php +++ b/lib/util/default.php @@ -356,6 +356,7 @@ $default = 'LRDD' => [], 'Nodeinfo' => [], 'OpenID' => [], + 'DBQueue' => [], 'OpportunisticQM' => [], 'RemoteFollow' => [], 'ActivityPub' => [], // The order is important here (IT HAS TO COME BEFORE OSTATUS) @@ -363,7 +364,6 @@ $default = 'Poll' => [], 'SimpleCaptcha' => [], 'TagSub' => [], - 'UnQueue' => [], 'WebFinger' => [], ], 'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories diff --git a/plugins/DBQueue/DBQueuePlugin.php b/plugins/DBQueue/DBQueuePlugin.php index 59779dba9f..b8948d707b 100644 --- a/plugins/DBQueue/DBQueuePlugin.php +++ b/plugins/DBQueue/DBQueuePlugin.php @@ -27,7 +27,7 @@ defined('GNUSOCIAL') || die(); class DBQueuePlugin extends Plugin { - const PLUGIN_VERSION = '0.0.1'; + const PLUGIN_VERSION = '0.1.0'; public function onStartNewQueueManager(?QueueManager &$qm) { @@ -38,12 +38,15 @@ class DBQueuePlugin extends Plugin public function onPluginVersion(array &$versions): bool { - $versions[] = array('name' => 'DBQueue', - 'version' => self::PLUGIN_VERSION, - 'author' => 'Miguel Dantas', - 'description' => - // TRANS: Plugin description. - _m('Plugin using the database as a backend for GNU social queues')); + $versions[] = [ + 'name' => 'DBQueue', + 'version' => self::PLUGIN_VERSION, + 'author' => 'Miguel Dantas', + 'homepage' => GNUSOCIAL_ENGINE_URL, + 'description' => + // TRANS: Plugin description. + _m('Plugin using the database as a backend for GNU social queues') + ]; return true; } }; diff --git a/plugins/DBQueue/README b/plugins/DBQueue/README.md similarity index 54% rename from plugins/DBQueue/README rename to plugins/DBQueue/README.md index 10913a8907..9de96587da 100644 --- a/plugins/DBQueue/README +++ b/plugins/DBQueue/README.md @@ -4,9 +4,7 @@ that uses the database as it's backing storage. Installation ============ -This plugin is replaces other queue manager plugins, such as UnQueue, -which enabled by default and which should, but is not required to be -disabled. +This plugin is enabled by default and replaces other queue manager plugins, such as UnQueue. addPlugin('DBQueue'); @@ -15,4 +13,4 @@ Example In config.php -addPlugin('DBQueue'); \ No newline at end of file +addPlugin('DBQueue'); diff --git a/plugins/RedisCache/RedisCachePlugin.php b/plugins/RedisCache/RedisCachePlugin.php index 072295a2f6..19abf7f255 100644 --- a/plugins/RedisCache/RedisCachePlugin.php +++ b/plugins/RedisCache/RedisCachePlugin.php @@ -34,7 +34,7 @@ use Predis\PredisException; class RedisCachePlugin extends Plugin { - const PLUGIN_VERSION = '0.0.1'; + const PLUGIN_VERSION = '0.1.0'; // settings which can be set in config.php with addPlugin('Embed', ['param'=>'value', ...]); public $server = null; @@ -133,13 +133,15 @@ class RedisCachePlugin extends Plugin public function onPluginVersion(array &$versions): bool { - $versions[] = array('name' => 'RedisCache', - 'version' => self::VERSION, - 'author' => 'chimo', - 'homepage' => 'https://github.com/chimo/gs-rediscache', - 'description' => - // TRANS: Plugin description. - _m('Plugin implementing Redis as a backend for GNU social caching')); + $versions[] = [ + 'name' => 'RedisCache', + 'version' => self::VERSION, + 'author' => 'Stéphane Bérubé (chimo)', + 'homepage' => 'https://github.com/chimo/gs-rediscache', + 'description' => + // TRANS: Plugin description. + _m('Plugin implementing Redis as a backend for GNU social caching') + ]; return true; } } diff --git a/plugins/RedisQueue/README b/plugins/RedisQueue/README.md similarity index 51% rename from plugins/RedisQueue/README rename to plugins/RedisQueue/README.md index 655b393044..f26f5c0913 100644 --- a/plugins/RedisQueue/README +++ b/plugins/RedisQueue/README.md @@ -4,9 +4,9 @@ that uses Redis as it's backing storage. Installation ============ -This plugin is replaces other queue manager plugins, such as UnQueue, -which enabled by default and which should, but is not required to be -disabled. +This plugin replaces other queue manager plugins, such as UnQueue and DBQueue. +You don't have to disable them but it is recommended to only use a QueueManager +at a time. addPlugin('RedisQueue', ['server' => 'your-redis-instance-and-port']); @@ -15,4 +15,4 @@ Example In config.php -addPlugin('RedisQueue', ['server' => 'tcp://localhost:6379']); \ No newline at end of file +addPlugin('RedisQueue', ['server' => 'tcp://localhost:6379']); diff --git a/plugins/RedisQueue/RedisQueuePlugin.php b/plugins/RedisQueue/RedisQueuePlugin.php index 6437a08eb6..5e1e9bac67 100644 --- a/plugins/RedisQueue/RedisQueuePlugin.php +++ b/plugins/RedisQueue/RedisQueuePlugin.php @@ -27,7 +27,7 @@ defined('GNUSOCIAL') || die(); class RedisQueuePlugin extends Plugin { - const PLUGIN_VERSION = '0.0.1'; + const PLUGIN_VERSION = '0.1.0'; // settings which can be set in config.php with addPlugin('RedisQueue', ['param'=>'value', ...]); public $server = null; @@ -40,12 +40,15 @@ class RedisQueuePlugin extends Plugin public function onPluginVersion(array &$versions): bool { - $versions[] = array('name' => 'RedisQueue', - 'version' => self::PLUGIN_VERSION, - 'author' => 'Miguel Dantas', - 'description' => - // TRANS: Plugin description. - _m('Plugin implementing Redis as a backend for GNU social queues')); + $versions[] = [ + 'name' => 'RedisQueue', + 'version' => self::PLUGIN_VERSION, + 'author' => 'Miguel Dantas', + 'homepage' => GNUSOCIAL_ENGINE_URL, + 'description' => + // TRANS: Plugin description. + _m('Plugin implementing Redis as a backend for GNU social queues') + ]; return true; } }; diff --git a/plugins/StompQueue/README b/plugins/StompQueue/README.md similarity index 96% rename from plugins/StompQueue/README rename to plugins/StompQueue/README.md index 9685272ad3..c5b43f548d 100644 --- a/plugins/StompQueue/README +++ b/plugins/StompQueue/README.md @@ -8,7 +8,7 @@ This plugin is replaces other queue manager plugins, such as UnQueue, which enabled by default and which should, but is not required to be disabled. -addPlugin('StompQueue', ['servers' => ['your-redis-instance-and-port'], +addPlugin('StompQueue', ['servers' => ['your-stomp-instance-and-port'], 'vhost' => 'your-vhost', 'username' => 'your-username', 'password' => 'your-password']); @@ -39,4 +39,4 @@ In config.php addPlugin('StompQueue', ['servers' => 'tcp://localhost:61613', 'vhost' => '/', // Please don't actually use the default credentials - 'username' => 'guest', 'password' => 'guest']); \ No newline at end of file + 'username' => 'guest', 'password' => 'guest']); diff --git a/plugins/StompQueue/StompQueuePlugin.php b/plugins/StompQueue/StompQueuePlugin.php index 4038e223e8..5464e52433 100644 --- a/plugins/StompQueue/StompQueuePlugin.php +++ b/plugins/StompQueue/StompQueuePlugin.php @@ -27,7 +27,7 @@ defined('GNUSOCIAL') || die(); class StompQueuePlugin extends Plugin { - const PLUGIN_VERSION = '0.0.1'; + const PLUGIN_VERSION = '0.1.0'; // settings which can be set in config.php with addPlugin('StompQueue', ['param'=>'value', ...]); public $servers = null; @@ -61,12 +61,15 @@ class StompQueuePlugin extends Plugin public function onPluginVersion(array &$versions): bool { - $versions[] = array('name' => 'StompQueue', - 'version' => self::PLUGIN_VERSION, - 'author' => 'Miguel Dantas', - 'description' => - // TRANS: Plugin description. - _m('Plugin implementing STOMP as a backend for GNU social queues')); + $versions[] = [ + 'name' => 'StompQueue', + 'version' => self::PLUGIN_VERSION, + 'author' => 'Miguel Dantas', + 'homepage' => GNUSOCIAL_ENGINE_URL, + 'description' => + // TRANS: Plugin description. + _m('Plugin implementing STOMP as a backend for GNU social queues') + ]; return true; } }; diff --git a/plugins/UnQueue/README b/plugins/UnQueue/README deleted file mode 100644 index ed90e921cd..0000000000 --- a/plugins/UnQueue/README +++ /dev/null @@ -1,14 +0,0 @@ -UnQueuePlugin wraps the UnQueueManager class which is a queue manager that does all work immediately. - -Installation -============ - -This plugin is enabled by default and cannot be disabled unless another queue manager is in use. -Disabling is not necessary but recommended in such cases. - -Example -======= - -In config.php - -addPlugin('UnQueue'); \ No newline at end of file diff --git a/plugins/UnQueue/README.md b/plugins/UnQueue/README.md new file mode 100644 index 0000000000..b22079ec58 --- /dev/null +++ b/plugins/UnQueue/README.md @@ -0,0 +1,10 @@ +UnQueuePlugin wraps the UnQueueManager class which is a queue manager that does all the work immediately. + +INSTALL +======= + +In config.php + +addPlugin('UnQueue'); + +Be sure to disable other queues plugins. diff --git a/plugins/UnQueue/UnQueuePlugin.php b/plugins/UnQueue/UnQueuePlugin.php index 1c6822a075..1448a0664e 100644 --- a/plugins/UnQueue/UnQueuePlugin.php +++ b/plugins/UnQueue/UnQueuePlugin.php @@ -37,12 +37,14 @@ class UnQueuePlugin extends Plugin public function onPluginVersion(array &$versions): bool { - $versions[] = array('name' => 'UnQueue', - 'version' => self::PLUGIN_VERSION, - 'author' => 'Miguel Dantas', - 'description' => - // TRANS: Plugin description. - _m('Plugin using the database as a backend for GNU social queues')); + $versions[] = ['name' => 'UnQueue', + 'version' => self::PLUGIN_VERSION, + 'author' => 'Miguel Dantas', + 'homepage' => GNUSOCIAL_ENGINE_URL, + 'description' => + // TRANS: Plugin description. + _m('Plugin using the database as a backend for GNU social queues') + ]; return true; } };