32 Commits
1.0.1 ... 1.3.0

Author SHA1 Message Date
flarum-bot
4c7a5d377d Bundled output for commit 6545bfdffc
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2025-10-10 09:51:12 +00:00
IanM
6545bfdffc chore: migrate to fof/redis, repo maintenance (#4)
* chore: migrate to fof/redis, repo maintenance

* chore: newline

* chore: use new fof horizon initializer

* chore: revert initializer  change

Only changed for 2.x ..

* chore: remove unused secrets

Shouldn't have been added in the first place

---------

Co-authored-by: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com>
Co-authored-by: Davide Iadeluca <davide.iadeluca@glowingblue.com>
2025-10-10 10:50:31 +01:00
Davide Iadeluca
2f2cce1abe chore: remove sync workflow 2024-01-31 11:21:07 +01:00
flarum-bot
78082dc842 Bundled output for commit e02001333b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2024-01-31 09:45:51 +00:00
Davide Iadeluca
e02001333b Merge pull request #2 from glowingblue/di/update-deps
chore(deps): update dependencies
2024-01-31 10:45:12 +01:00
Davide Iadeluca
44fa68c278 chore: add custom repository 2024-01-31 10:37:20 +01:00
Davide Iadeluca
139d687e1b ci: update workflows 2024-01-31 10:25:04 +01:00
Davide Iadeluca
9061552db9 chore(deps): update dependencies 2024-01-30 13:59:01 +01:00
Rafael Horvat
eab24f9adc fix build workflow 2023-08-09 17:05:25 +02:00
Rafael Horvat
94049c5183 Refactoring and made some methods public static(to be able to reuse them) 2023-08-09 17:04:59 +02:00
Rafael Horvat
96af9b58f6 Added and/or updated config files 2023-01-25 14:50:01 +01:00
flarum-bot
69c73e2397 Bundled output for commit c2ddd30cd7
Includes transpiled JS/TS.

[skip ci]
2022-04-26 11:23:43 +00:00
Rafael Horvat
c2ddd30cd7 Infra updates & require flarum 1.2 2022-04-26 13:22:18 +02:00
flarum-bot
f3e8fc0243 Bundled output for commit 8f82fbe078
Includes transpiled JS/TS.

[skip ci]
2022-03-29 14:53:48 +00:00
Rafael Horvat
8f82fbe078 Added the ability to configure horizon 2022-03-29 16:51:03 +02:00
Rafael Horvat
4e668a4098 conventions 2022-03-29 16:31:44 +02:00
Rafael Horvat
68b5b8f871 Updated license and authors 2022-03-29 16:09:13 +02:00
flarum-bot
27601d7f61 Bundled output for commit 4d7828548b
Includes transpiled JS/TS.

[skip ci]
2022-03-29 12:17:48 +00:00
Rafael Horvat
4d7828548b fix package name, mistake 🙈 2022-03-29 14:16:20 +02:00
Rafael Horvat
9a0fe54c37 Conventions & best practices update 2022-03-29 14:08:12 +02:00
Rafael Horvat
b308a07d8d Added and/or updated config files 2021-12-29 12:02:32 +01:00
flarum-bot
c167010796 Bundled output for commit e94701d39c
Includes transpiled JS/TS.

[skip ci]
2021-12-21 17:35:48 +00:00
iPurpl3x
e94701d39c fixed build workflow 2021-12-21 18:34:33 +01:00
iPurpl3x
57f7647fc3 Prettier 2021-12-21 18:05:25 +01:00
iPurpl3x
8c976e3fc0 Added Discuss link for Extiverse 2021-12-21 18:03:54 +01:00
iPurpl3x
590d0084c5 Conventions & code formating 2021-12-21 17:44:27 +01:00
iPurpl3x
fcd833a248 Use yarn and updated dependencies 2021-12-21 17:44:07 +01:00
Ian Morland
3284a36926 Cleanup 2021-07-05 14:12:08 +01:00
Ian Morland
68af330669 Add optional prefix 2021-07-01 21:28:35 +01:00
Ian Morland
09a30f786d Update usage 2021-07-01 21:26:55 +01:00
Ian Morland
68a5cafdfc Address failure when only running selected redis services 2021-07-01 21:23:57 +01:00
Ian Morland
ed83a0123d Update blomstra/flarum-redis requirement 2021-06-25 09:36:15 +01:00
29 changed files with 3031 additions and 5232 deletions

16
.editorconfig Normal file
View File

@@ -0,0 +1,16 @@
root = true
[*]
charset = utf-8
end_of_line = lf
max_line_length = 100
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
indent_style = tab
indent_size = 4
[*.{json,yml,yaml}]
indent_style = space
indent_size = 2
insert_final_newline = false

11
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,11 @@
**Resolves**
<!-- include a link to the issue -->
**Changes proposed in this pull request:**
<!-- mention the pages and/or components which have been impacted -->
**Reviewers should focus on:**
<!-- ask for feedback on specific changes you are unsure about -->
**Screenshot**
<!-- include an image of the most relevant user-facing change, if any -->

13
.github/workflows/backend.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: GB Redis Setup PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@1.x
with:
enable_backend_testing: false
enable_phpstan: true
php_versions: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]'
backend_directory: .

View File

@@ -1,16 +0,0 @@
name: Build JavaScript assets
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: flarum/action-build@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

19
.github/workflows/frontend.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: GB Redis Setup JS
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@1.x
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
frontend_directory: ./js
backend_directory: .
js_package_manager: yarn
main_git_branch: master
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

156
.gitignore vendored
View File

@@ -1,5 +1,5 @@
# Created by https://www.toptal.com/developers/gitignore/api/vim,yarn,node,linux,macos,windows,visualstudiocode,composer
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,yarn,node,linux,macos,windows,visualstudiocode,composer
# Created by https://www.toptal.com/developers/gitignore/api/vim,yarn,node,macos,linux,windows,composer,visualstudiocode,jetbrains
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,yarn,node,macos,linux,windows,composer,visualstudiocode,jetbrains
### Composer ###
composer.phar
@@ -7,7 +7,110 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
composer.lock
### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/
# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml
# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/
# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
### Linux ###
*~
@@ -33,6 +136,7 @@ composer.phar
# Icon must end with two \r
Icon
# Thumbnails
._*
@@ -61,6 +165,9 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Lock file => as we don't use npm, but yarn.
package-lock.json
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@@ -108,6 +215,9 @@ typings/
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
@@ -126,16 +236,26 @@ typings/
# dotenv environment variables file
.env
.env.test
.env*.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
#dist
# dist
# Storybook build outputs
.out
.storybook-out
storybook-static
# rollup.js default build output
# dist/
# Gatsby files
.cache/
@@ -161,6 +281,10 @@ typings/
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# Temporary folders
tmp/
temp/
### Vim ###
# Swap
[._]*.s[a-v][a-z]
@@ -183,15 +307,14 @@ tags
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### Windows ###
# Windows thumbnail cache files
@@ -222,16 +345,17 @@ $RECYCLE.BIN/
### yarn ###
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
# .yarn/unplugged and .yarn/build-state.yml should likely always be ignored since
# they typically hold machine-specific build artifacts. Ignoring them might however
# prevent Zero-Installs from working (to prevent this, set enableScripts to false).
.yarn/unplugged
.yarn/build-state.yml
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
# .yarn/cache and .pnp.* may be safely ignored, but you'll need to run yarn install
# to regenerate them between each branch switch.
# Uncomment the following lines if you're not using Zero-Installs:
# .yarn/cache
# if you are NOT using Zero-installs, then:
# comment the following lines
!.yarn/cache
# and uncomment the following lines
# .pnp.*
# End of https://www.toptal.com/developers/gitignore/api/vim,yarn,node,linux,macos,windows,visualstudiocode,composer
# End of https://www.toptal.com/developers/gitignore/api/vim,yarn,node,macos,linux,windows,composer,visualstudiocode,jetbrains

19
.prettierrc Normal file
View File

@@ -0,0 +1,19 @@
bracketSameLine: true
jsxBracketSameLine: true
jsxSingleQuote: true
printWidth: 100
proseWrap: "always"
semi: true
singleQuote: true
tabWidth: 4
trailingComma: "all"
useTabs: true
overrides:
- files:
- "*.json"
- "*.yml"
- "*.yaml"
options:
useTabs: false
tabWidth: 2

11
.vscode/extension.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"recommendations": [
"bmewburn.vscode-intelephense-client",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"felixfbecker.php-debug",
"glowingblue.composer-package-name",
"firefox-devtools.vscode-firefox-debug"
]
}

17
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Flarum",
"type": "firefox",
"request": "attach",
"url": "http://localhost:8888",
"pathMappings": [
{
"url": "webpack://${command:glowingblue-composer-package-name.getName}/src/",
"path": "${workspaceFolder}/js/src/"
}
]
}
]
}

71
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,71 @@
{
"editor.insertSpaces": false,
"editor.wordWrapColumn": 100,
"files.insertFinalNewline": true,
"editor.detectIndentation": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.insertSpaces": false
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.insertFinalNewline": true
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"files.insertFinalNewline": true
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
"editor.insertSpaces": false
},
"files.associations": {
"*.html": "html",
"*.md": "markdown"
},
"prettier.bracketSameLine": true,
"prettier.jsxBracketSameLine": true,
"prettier.jsxSingleQuote": true,
"prettier.printWidth": 100,
"prettier.proseWrap": "always",
"prettier.semi": true,
"prettier.singleQuote": true,
"prettier.tabWidth": 4,
"prettier.trailingComma": "all",
"prettier.useTabs": true,
"js/ts.implicitProjectConfig.experimentalDecorators": true,
"eslint.packageManager": "yarn",
"remote.containers.workspaceMountConsistency": "consistent",
"remote.containers.defaultExtensions": [
"bmewburn.vscode-intelephense-client",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"xdebug.php-debug",
"firefox-devtools.vscode-firefox-debug"
]
}

View File

@@ -1,7 +1,16 @@
MIT License Copyright (c) 2021 Glowing Blue AG
MIT License Copyright (c) 2022 Glowing Blue AG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice (including the next paragraph) shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,24 +1,28 @@
# ⚡️ Redis Setup
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/glowingblue/flarum-ext-redis-setup/blob/master/LICENSE.md) [![Latest Stable Version](https://img.shields.io/packagist/v/glowingblue/redis-setup.svg)](https://packagist.org/packages/glowingblue/redis-setup) [![Total Downloads](https://img.shields.io/packagist/dt/glowingblue/redis-setup.svg)](https://packagist.org/packages/glowingblue/redis-setup)
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/glowingblue/flarum-ext-redis-setup/blob/master/LICENSE.md)
[![Latest Stable Version](https://img.shields.io/packagist/v/glowingblue/redis-setup.svg)](https://packagist.org/packages/glowingblue/redis-setup)
[![Total Downloads](https://img.shields.io/packagist/dt/glowingblue/redis-setup.svg)](https://packagist.org/packages/glowingblue/redis-setup)
A [Flarum](http://flarum.org) extension.
Makes it easy to enable/disable Redis features:
- Cache
- Queue
- Sessions
- Cache
- Queue
- Sessions
For this to work, environment variables have to be set on your host:
If you are using a local redis setup, you will likely be able to simply use the defaults provided.
Any of these can be overridden using environment variables as follows:
```ini
REDIS_HOST=null # Required
REDIS_HOST='127.0.0.1 # Optional, else uses default
REDIS_PORT=6379 # Optional, else uses default
REDIS_PASSWORD=null # Required, can be an empty string
REDIS_PASSWORD=null # Optional, otherwise null
REDIS_DATABASE_CACHE=1 # Optional, else uses default
REDIS_DATABASE_QUEUE=2 # Optional, else uses default
REDIS_DATABASE_SESSION=3 # Optional, else uses default
REDIS_PREFIX='flarum_' # Optional, else uses default
```
## 📥 Installation
@@ -36,7 +40,7 @@ php flarum cache:clear
## 🔗 Links
- [Flarum Discuss post](https://discuss.flarum.org/d/27455)
- [Source code on GitHub](https://github.com/glowingblue/flarum-ext-redis-setup)
- [Report an issue](https://github.com/glowingblue/flarum-ext-redis-setup/issues)
- [Download via Packagist](https://packagist.org/packages/glowingblue/redis-setup)
- [Flarum Discuss post](https://discuss.flarum.org/d/27455)
- [Source code on GitHub](https://github.com/glowingblue/flarum-ext-redis-setup)
- [Report an issue](https://github.com/glowingblue/flarum-ext-redis-setup/issues)
- [Download via Packagist](https://packagist.org/packages/glowingblue/redis-setup)

View File

@@ -1,43 +1,73 @@
{
"name": "glowingblue/redis-setup",
"description": "Makes it easy to enable/disable Redis features: Cache, Queue & Sessions",
"keywords": [
"flarum", "redis", "cache", "queue", "session"
],
"type": "flarum-extension",
"license": "MIT",
"support": {
"issues": "https://github.com/glowingblue/flarum-ext-redis-setup/issues",
"source": "https://github.com/glowingblue/flarum-ext-redis-setup",
"forum": "https://community.glowingblue.com/t/flarum-corner",
"email": "dev@glowingblue.com"
"name": "glowingblue/redis-setup",
"description": "Makes it easy to enable/disable Redis features: Cache, Queue & Sessions",
"keywords": [
"flarum",
"redis",
"cache",
"queue",
"session"
],
"type": "flarum-extension",
"license": "MIT",
"support": {
"issues": "https://github.com/glowingblue/flarum-ext-redis-setup/issues",
"source": "https://github.com/glowingblue/flarum-ext-redis-setup",
"forum": "https://community.glowingblue.com/t/flarum-corner",
"email": "dev@glowingblue.com"
},
"homepage": "https://glowingblue.com",
"require": {
"flarum/core": "^1.8.5",
"fof/redis": "^1.0"
},
"authors": [
{
"name": "IanM",
"homepage": "https://discuss.flarum.org/u/ianm",
"role": "Developer"
},
"homepage": "https://glowingblue.com",
"require": {
"flarum/core": "^1.0.0",
"blomstra/flarum-redis": "^0.4.0@beta"
{
"name": "Glowing Blue AG",
"homepage": "https://glowingblue.com",
"role": "Developer"
},
"authors": [
{
"name": "IanM",
"homepage": "https://discuss.flarum.org/u/ianm",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"GlowingBlue\\RedisSetup\\": "src/"
}
},
"extra": {
"flarum-extension": {
"title": "GB Redis Setup",
"category": "feature",
"icon": {
"name": "fas fa-tasks",
"backgroundColor": "#00a7e3",
"color": "#fff"
}
}
{
"name": "Rafael Horvat",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"GlowingBlue\\RedisSetup\\": "src/"
}
},
"extra": {
"flarum-extension": {
"title": "GB Redis Setup",
"category": "feature",
"icon": {
"name": "fas fa-tasks",
"backgroundColor": "#00a7e3",
"color": "#fff"
},
"optional-dependencies": [
"fof/horizon"
]
},
"extiverse": {
"discuss": "https://discuss.flarum.org/d/27455"
}
},
"require-dev": {
"flarum/phpstan": "*",
"fof/horizon": "^1.0"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
}

View File

@@ -3,7 +3,8 @@
/*
* This file is part of glowingblue/redis-setup.
*
* Copyright (c) 2021 Ian Morland.
* Copyright (c) 2022 Glowing Blue AG.
* Authors: Ian Morland, iPurpl3x, Rafael Horvat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
@@ -12,17 +13,18 @@
namespace GlowingBlue\RedisSetup;
use Flarum\Extend;
use GlowingBlue\RedisSetup\Extend\EnableRedis;
use GlowingBlue\RedisSetup\Extend as GBExtend;
use GlowingBlue\RedisSetup\Provider\QueueProvider;
return [
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
->js(__DIR__ . '/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/resources/locale'),
new Extend\Locales(__DIR__ . '/resources/locale'),
new GBExtend\ConfigureHorizon(),
new GBExtend\EnableRedis(),
(new Extend\ServiceProvider())
->register(QueueProvider::class),
new EnableRedis()
];

2
js/dist/admin.js vendored
View File

@@ -1,2 +1,2 @@
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){e.exports=flarum.core.compat["admin/app"]},function(e,t){e.exports=flarum.core.compat["common/extend"]},function(e,t){e.exports=flarum.core.compat["admin/components/StatusWidget"]},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(1),i=n(2),u=n.n(i);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}o.a.initializers.add("glowingblue-redis-setup",(function(){o.a.extensionData.for("glowingblue-redis-setup").registerSetting({setting:"glowingblue-redis.enableCache",type:"boolean",label:o.a.translator.trans("glowingblue-redis-setup.admin.settings.enable_cache")}).registerSetting({setting:"glowingblue-redis.redisSessions",type:"boolean",label:o.a.translator.trans("glowingblue-redis-setup.admin.settings.enable_redis_sessions")}).registerSetting({setting:"glowingblue-redis.enableQueue",type:"boolean",label:o.a.translator.trans("glowingblue-redis-setup.admin.settings.enable_queue")}),Object(a.extend)(u.a.prototype,"items",(function(e){var t=o.a.data.blomstraQueuesLoad;if(void 0!==t)for(var n,r=l(o.a.data.blomstraQueuesSeen);!(n=r()).done;){var a=n.value,i=t[a]||null;e.add("blomstra-queue-size-"+a,[m("strong",null,"Queue ",a),m("br",null),i||"0"])}}))}))}]);
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const r=flarum.core.compat["admin/app"];var n=e.n(r);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["admin/components/StatusWidget"];var i=e.n(a),l="glowingblue-redis-setup";function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var u=n().translator.trans.bind(n().translator),d=l+".admin.settings";n().initializers.add(l,(function(){n().extensionData.for(l).registerSetting({setting:"glowingblue-redis.enableCache",type:"boolean",label:u(d+".enable_cache")}).registerSetting({setting:"glowingblue-redis.redisSessions",type:"boolean",label:u(d+".enable_redis_sessions")}).registerSetting({setting:"glowingblue-redis.enableQueue",type:"boolean",label:u(d+".enable_queue")}),n().initializers.has("fof/horizon")&&n().extensionData.for(l).registerSetting({setting:"glowingblue-redis.horizonConfig",type:"textarea",label:u(d+".horizon_config"),help:u(d+".horizon_help_text")}),(0,o.extend)(i().prototype,"items",(function(e){var t=n().data.fofQueuesLoad;if(void 0!==t)for(var r,o=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n().data.fofQueuesSeen);!(r=o()).done;){var a=r.value,i=t[a]||null;e.add("fof-queue-size-"+a,[m("strong",null,"Queue ",a),m("br",null),i||"0"])}}))}))})(),module.exports=t})();
//# sourceMappingURL=admin.js.map

File diff suppressed because one or more lines are too long

4953
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,21 @@
{
"name": "@glowingblue/redis-setup",
"version": "0.0.0",
"private": true,
"dependencies": {
"flarum-webpack-config": "^0.1.0-beta.10",
"webpack": "^4.26.0",
"webpack-cli": "^3.0.7"
},
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production",
"lint": "prettier --single-quote --jsx-single-quote --trailing-comma es5 --print-width 100 --use-tabs --tab-width 4 --write src"
},
"devDependencies": {
"prettier": "^2.3.0"
}
"name": "@glowingblue/redis-setup",
"version": "0.0.0",
"private": true,
"prettier": "@glowingblue-dev/prettier-config",
"dependencies": {
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.72.0",
"webpack-cli": "^5.0"
},
"devDependencies": {
"@glowingblue-dev/prettier-config": "^1.0.0",
"prettier": "^3.5.1"
},
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production",
"format": "prettier --write src",
"format-check": "prettier --check src"
}
}

View File

@@ -1,42 +0,0 @@
import app from 'flarum/admin/app';
import { extend } from 'flarum/common/extend';
import StatusWidget from 'flarum/admin/components/StatusWidget';
app.initializers.add('glowingblue-redis-setup', () => {
app.extensionData
.for('glowingblue-redis-setup')
.registerSetting({
setting: 'glowingblue-redis.enableCache',
type: 'boolean',
label: app.translator.trans('glowingblue-redis-setup.admin.settings.enable_cache'),
})
.registerSetting({
setting: 'glowingblue-redis.redisSessions',
type: 'boolean',
label: app.translator.trans(
'glowingblue-redis-setup.admin.settings.enable_redis_sessions'
),
})
.registerSetting({
setting: 'glowingblue-redis.enableQueue',
type: 'boolean',
label: app.translator.trans('glowingblue-redis-setup.admin.settings.enable_queue'),
});
extend(StatusWidget.prototype, 'items', (items) => {
const loads = app.data.blomstraQueuesLoad;
if (loads === undefined) {
return;
}
for (let queue of app.data.blomstraQueuesSeen) {
const load = loads[queue] || null;
items.add('blomstra-queue-size-' + queue, [
<strong>Queue {queue}</strong>,
<br />,
load || '0',
]);
}
});
});

65
js/src/admin/index.tsx Normal file
View File

@@ -0,0 +1,65 @@
/*
* This file is part of glowingblue/redis-setup.
*
* Copyright (c) 2022 Glowing Blue AG.
* Authors: Ian Morland, iPurpl3x, Rafael Horvat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
import app from 'flarum/admin/app';
import { extend } from 'flarum/common/extend';
import StatusWidget from 'flarum/admin/components/StatusWidget';
import { slug } from '../common';
// Make translation calls shorter
const t = app.translator.trans.bind(app.translator);
const prfx = `${slug}.admin.settings`;
app.initializers.add(slug, () => {
app.extensionData
.for(slug)
.registerSetting({
setting: 'glowingblue-redis.enableCache',
type: 'boolean',
label: t(`${prfx}.enable_cache`),
})
.registerSetting({
setting: 'glowingblue-redis.redisSessions',
type: 'boolean',
label: t(`${prfx}.enable_redis_sessions`),
})
.registerSetting({
setting: 'glowingblue-redis.enableQueue',
type: 'boolean',
label: t(`${prfx}.enable_queue`),
});
if (app.initializers.has('fof/horizon')) {
app.extensionData.for(slug).registerSetting({
setting: 'glowingblue-redis.horizonConfig',
type: 'textarea',
label: t(`${prfx}.horizon_config`),
help: t(`${prfx}.horizon_help_text`),
});
}
extend(StatusWidget.prototype, 'items', (items) => {
const loads = app.data.fofQueuesLoad;
if (loads === undefined) {
return;
}
// @ts-ignore
for (let queue of app.data.fofQueuesSeen) {
const load = loads[queue] || null;
items.add('fof-queue-size-' + queue, [
<strong>Queue {queue}</strong>,
<br />,
load || '0',
]);
}
});
});

11
js/src/common/index.ts Normal file
View File

@@ -0,0 +1,11 @@
/*
* This file is part of glowingblue/redis-setup.
*
* Copyright (c) 2022 Glowing Blue AG.
* Authors: Rafael Horvat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
export const slug = 'glowingblue-redis-setup';

17
js/tsconfig.json Normal file
View File

@@ -0,0 +1,17 @@
{
// Use Flarum's tsconfig as a starting point
"extends": "flarum-tsconfig",
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
// and also tells your Typescript server to read core's global typings for
// access to `dayjs` and `$` in the global namespace.
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*"],
"compilerOptions": {
// This will output typings to `dist-typings`
"declarationDir": "./dist-typings",
"baseUrl": ".",
"paths": {
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"]
}
}
}

2291
js/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

13
phpstan.neon Normal file
View File

@@ -0,0 +1,13 @@
includes:
- vendor/flarum/phpstan/extension.neon
parameters:
# The level will be increased in Flarum 2.0
level: 5
paths:
- extend.php
- src
excludePaths:
- *.blade.php
checkMissingIterableValueType: false
databaseMigrationsPath: ['migrations']

View File

@@ -2,5 +2,8 @@ glowingblue-redis-setup:
admin:
settings:
enable_cache: Enable Redis cache
enable_redis_sessions: Enable Redis sessions (all users will be logged out after changing this setting)
enable_redis_sessions:
Enable Redis sessions (all users will be logged out after changing this setting)
enable_queue: Enable Redis queue
horizon_config: "Horizon config (format: JSON)."
horizon_help_text: This will be passed to <code>(new \Blomstra\Horizon\Extend\Horizon)->config(...))</code>

View File

@@ -0,0 +1,45 @@
<?php
/*
* This file is part of glowingblue/redis-setup.
*
* Copyright (c) 2022 Glowing Blue AG.
* Authors: Rafael Horvat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace GlowingBlue\RedisSetup\Extend;
use FoF\Horizon\Extend\Horizon;
use Flarum\Extend\ExtenderInterface;
use Flarum\Extension\Extension;
use Flarum\Extension\ExtensionManager;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
class ConfigureHorizon implements ExtenderInterface
{
public function extend(Container $container, Extension $extension = null)
{
$extensions = resolve(ExtensionManager::class);
if (!$extensions->isEnabled('fof-horizon') || !class_exists(Horizon::class)) {
return;
}
/** @var SettingsRepositoryInterface */
$settings = resolve(SettingsRepositoryInterface::class);
$config = json_decode($settings->get('glowingblue-redis.horizonConfig', '[]'), true);
if (!is_array($config) || empty($config)) {
return;
}
(new Horizon())
->config($config)
->extend($container, $extension);
}
}

View File

@@ -1,8 +1,18 @@
<?php
/*
* This file is part of glowingblue/redis-setup.
*
* Copyright (c) 2023 Glowing Blue AG.
* Authors: Ian Morland, iPurpl3x, Rafael Horvat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace GlowingBlue\RedisSetup\Extend;
use Blomstra\Redis\Extend\Redis;
use FoF\Redis\Extend\Redis;
use Flarum\Extend\ExtenderInterface;
use Flarum\Extension\Extension;
use Flarum\Settings\SettingsRepositoryInterface;
@@ -11,104 +21,100 @@ use Illuminate\Support\Arr;
class EnableRedis implements ExtenderInterface
{
const CACHE_KEY = 'connections.cache';
const QUEUE_KEY = 'connections.queue';
const SESSION_KEY = 'connections.session';
const CACHE_KEY = 'connections.cache';
const QUEUE_KEY = 'connections.queue';
const SESSION_KEY = 'connections.session';
public function extend(Container $container, Extension $extension = null)
{
$config = $this->buildConfig();
public function extend(Container $container, Extension $extension = null)
{
$config = $this->buildConfig();
if (Arr::hasAny($config, [self::CACHE_KEY, self::QUEUE_KEY, self::SESSION_KEY])) {
(new Redis($config))->disable($this->getDisabledServices())->extend($container, $extension);
}
}
(new Redis($config))
->disable($this->getDisabledServices());
}
private function getDisabledServices(): array
{
/** @var SettingsRepositoryInterface */
$settings = resolve(SettingsRepositoryInterface::class);
private function getDisabledServices(): array
{
/** @var SettingsRepositoryInterface */
$settings = resolve(SettingsRepositoryInterface::class);
$disabled = [];
$disabled = [];
if (!(bool) $settings->get('glowingblue-redis.enableCache', false)) {
$disabled[] = 'cache';
}
if (!(bool) $settings->get('glowingblue-redis.enableCache', false)) {
$disabled[] = 'cache';
}
if (!(bool) $settings->get('glowingblue-redis.enableQueue', false)) {
$disabled[] = 'queue';
}
if (!(bool) $settings->get('glowingblue-redis.enableQueue', false)) {
$disabled[] = 'queue';
}
if (!(bool) $settings->get('glowingblue-redis.redisSessions', false)) {
$disabled[] = 'session';
}
if (!(bool) $settings->get('glowingblue-redis.redisSessions', false)) {
$disabled[] = 'session';
}
return $disabled;
}
return $disabled;
}
private function buildConfig(): array
{
if ($this->getHost() === null) {
return [];
}
private function buildConfig($config = []): array
{
$base = [
'host' => $this->getHost(),
'password' => $this->getPassword(),
'port' => $this->getPort(),
'prefix' => $this->getPrefix(),
];
$config = [];
$cache = $base + [
'database' => static::getCacheDatabase(),
];
$cache = [
'host' => $this->getHost(),
'password' => $this->getPassword(),
'port' => $this->getPort(),
'database' => $this->getCacheDatabase(),
];
$queue = $base + [
'database' => static::getQueueDatabase(),
];
$queue = [
'host' => $this->getHost(),
'password' => $this->getPassword(),
'port' => $this->getPort(),
'database' => $this->getQueueDatabase(),
];
$session = $base + [
'database' => static::getSessionDatabase(),
];
$session = [
'host' => $this->getHost(),
'password' => $this->getPassword(),
'port' => $this->getPort(),
'database' => $this->getSessionDatabase(),
];
$config = Arr::add($config, self::CACHE_KEY, $cache);
$config = Arr::add($config, self::QUEUE_KEY, $queue);
$config = Arr::add($config, self::SESSION_KEY, $session);
$config = Arr::add($config, self::CACHE_KEY, $cache);
$config = Arr::add($config, self::QUEUE_KEY, $queue);
$config = Arr::add($config, self::SESSION_KEY, $session);
return $config;
}
return $config;
}
public static function getHost(): string
{
return getenv('REDIS_HOST') ? getenv('REDIS_HOST') : '127.0.0.1';
}
private function getHost(): ?string
{
return getenv('REDIS_HOST') ? getenv('REDIS_HOST') : null;
}
public static function getPassword(): ?string
{
return getenv('REDIS_PASSWORD') ? getenv('REDIS_PASSWORD') : null;
}
private function getPassword(): ?string
{
return getenv('REDIS_PASSWORD') ? getenv('REDIS_PASSWORD') : null;
}
public static function getPort(): string
{
return getenv('REDIS_PORT') ? getenv('REDIS_PORT') : '6379';
}
private function getPort(): string
{
return getenv('REDIS_PORT') ? getenv('REDIS_PORT') : '6379';
}
public static function getCacheDatabase(): int
{
return (int) getenv('REDIS_DATABASE_CACHE') ? getenv('REDIS_DATABASE_CACHE') : 1;
}
private function getCacheDatabase(): int
{
return (int) getenv('REDIS_DATABASE_CACHE') ? getenv('REDIS_DATABASE_CACHE') : 1;
}
public static function getQueueDatabase(): int
{
return (int) getenv('REDIS_DATABASE_QUEUE') ? getenv('REDIS_DATABASE_QUEUE') : 2;
}
private function getQueueDatabase(): int
{
return (int) getenv('REDIS_DATABASE_QUEUE') ? getenv('REDIS_DATABASE_QUEUE') : 2;
}
public static function getSessionDatabase(): int
{
return (int) getenv('REDIS_DATABASE_SESSION') ? getenv('REDIS_DATABASE_SESSION') : 3;
}
private function getSessionDatabase(): int
{
return (int) getenv('REDIS_DATABASE_SESSION') ? getenv('REDIS_DATABASE_SESSION') : 3;
}
public static function getPrefix(): string
{
return getenv('REDIS_PREFIX') ? getenv('REDIS_PREFIX') : 'flarum_';
}
}

View File

@@ -1,5 +1,15 @@
<?php
/*
* This file is part of glowingblue/redis-setup.
*
* Copyright (c) 2022 Glowing Blue AG.
* Authors: iPurpl3x, Ian Morland, Rafael Horvat.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace GlowingBlue\RedisSetup\Provider;
use Flarum\Extend\Frontend;
@@ -15,59 +25,59 @@ use Illuminate\Contracts\Queue\Queue as QueueContract;
class QueueProvider extends AbstractServiceProvider
{
private $connection = 'default';
private $connection = 'default';
public function boot()
{
/** @var SettingsRepositoryInterface */
$settings = resolve(SettingsRepositoryInterface::class);
public function boot()
{
/** @var SettingsRepositoryInterface */
$settings = resolve(SettingsRepositoryInterface::class);
if (!(bool) $settings->get('glowingblue-redis.enableQueue', false)) {
return;
}
if (!(bool) $settings->get('glowingblue-redis.enableQueue', false)) {
return;
}
/** @var ExtensionManager $extensions */
$extensions = resolve(ExtensionManager::class);
/** @var ExtensionManager $extensions */
$extensions = resolve(ExtensionManager::class);
(new Frontend('admin'))
->content([$this, 'adminWidgetAttributes'])
->extend($this->container, $extensions->getExtension('glowingblue-redis-setup'));
(new Frontend('admin'))
->content([$this, 'adminWidgetAttributes'])
->extend($this->container, $extensions->getExtension('glowingblue-redis-setup'));
/** @var Dispatcher $dispatcher */
$dispatcher = $this->container->make(Dispatcher::class);
$dispatcher->listen(Looping::class, [$this, 'trackQueues']);
}
/** @var Dispatcher $dispatcher */
$dispatcher = $this->container->make(Dispatcher::class);
$dispatcher->listen(Looping::class, [$this, 'trackQueues']);
}
public function adminWidgetAttributes(Document $document)
{
/** @var Store $cache */
$cache = resolve('cache.store');
/** @var QueueContract $queue */
$queue = resolve(QueueContract::class);
public function adminWidgetAttributes(Document $document)
{
/** @var Store $cache */
$cache = resolve('cache.store');
/** @var QueueContract $queue */
$queue = resolve(QueueContract::class);
$queues = $cache->get('blomstra.queue.queues-seen') ?? [];
$queues = $cache->get('fof.queue.queues-seen') ?? [];
if ($queue instanceof RedisQueue) {
$load = [];
if ($queue instanceof RedisQueue) {
$load = [];
foreach ($queues as $name) {
$load[$name] = $queue->getRedis()
->connection($this->connection)
->llen('queues:' . $name);
}
}
foreach ($queues as $name) {
$load[$name] = $queue->getRedis()
->connection($this->connection)
->llen('queues:' . $name);
}
}
$document->payload['blomstraQueuesSeen'] = $queues;
$document->payload['blomstraQueuesLoad'] = $load ?? null;
}
$document->payload['fofQueuesSeen'] = $queues;
$document->payload['fofQueuesLoad'] = $load ?? null;
}
public function trackQueues(Looping $event)
{
/** @var Store $cache */
$cache = resolve('cache.store');
public function trackQueues(Looping $event)
{
/** @var Store $cache */
$cache = resolve('cache.store');
$queues = $cache->get('blomstra.queue.queues-seen') ?? [];
$queues = array_merge($queues, (array) explode(',', $event->queue));
$cache->put('blomstra.queue.queues-seen', array_unique($queues), 60);
}
$queues = $cache->get('fof.queue.queues-seen') ?? [];
$queues = array_merge($queues, (array) explode(',', $event->queue));
$cache->put('fof.queue.queues-seen', array_unique($queues), 60);
}
}