Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • adaures/castopod
  • mkljczk/castopod-host
  • spaetz/castopod-host
  • PatrykMis/castopod
  • jonas/castopod
  • ajeremias/castopod
  • misuzu/castopod
  • KrzysztofDomanczyk/castopod
  • Behel/castopod
  • nebulon/castopod
  • ewen/castopod
  • NeoluxConsulting/castopod
  • nateritter/castopod-og
  • prcutler/castopod
14 results
Show changes
Commits on Source (61)
Showing with 746 additions and 378 deletions
FROM php:7.3-fpm
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get update && \
apt-get install -y nodejs
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git vim
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/docker-existing-dockerfile // https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/docker-existing-dockerfile
{ {
"name": "Existing Dockerfile", "name": "Castopod Host dev",
"dockerFile": "./Dockerfile", "dockerComposeFile": ["../docker-compose.yml", "./docker-compose.yml"],
"service": "app",
"workspaceFolder": "/castopod-host",
"postCreateCommand": "composer install && npm install && npm run build:dev",
"postStartCommand": "crontab ./crontab && cron && php spark serve --host 0.0.0.0",
"postAttachCommand": "crontab ./crontab && service cron reload",
"shutdownAction": "stopCompose",
"settings": { "settings": {
"terminal.integrated.shell.linux": "/bin/bash", "terminal.integrated.defaultProfile.linux": "/bin/bash",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"[php]": { "[php]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "bmewburn.vscode-intelephense-client",
"editor.formatOnSave": false
}, },
"phpSniffer.autoDetect": true, "color-highlight.markerType": "dot-before",
"color-highlight.markerType": "dot-before" "files.associations": {
"*.xml.dist": "xml",
"spark": "php"
}
}, },
"extensions": [ "extensions": [
"mikestead.dotenv", "mikestead.dotenv",
"bmewburn.vscode-intelephense-client", "bmewburn.vscode-intelephense-client",
"streetsidesoftware.code-spell-checker", "streetsidesoftware.code-spell-checker",
"naumovs.color-highlight", "naumovs.color-highlight",
"heybourn.headwind", "heybourn.headwind",
"wayou.vscode-todo-highlight", "wayou.vscode-todo-highlight",
"esbenp.prettier-vscode", "esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss", "bradlc.vscode-tailwindcss",
"jamesbirtles.svelte-vscode", "jamesbirtles.svelte-vscode",
"dbaeumer.vscode-eslint", "dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint", "stylelint.vscode-stylelint",
"wongjn.php-sniffer", "eamodio.gitlens",
"eamodio.gitlens" "breezelin.phpstan",
] "kasik96.latte"
]
} }
version: "3"
services:
app:
volumes:
# Mounts the project folder to '/workspace'. While this file is in .devcontainer,
# mounts are relative to the first file in the list, which is a level up.
- .:/castopod-host:cached
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended" "plugin:prettier/recommended"
], ],
"parserOptions": { "parserOptions": {
......
image: php:7.3-fpm image: code.podlibre.org:5050/podlibre/castopod-host:latest
stages: stages:
- prepare
- quality
- bundle - bundle
- release - release
cache: php-dependencies:
paths: stage: prepare
- vendor/ script:
- node_modules/ # Install all php dependencies
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --ignore-platform-reqs
before_script: artifacts:
- apt-get update -y paths:
- vendor/
# Install git (the php image doesn't have it) which is required by composer expire_in: 30 mins
- apt-get install git -y
# install rsync for file transfers
- apt-get install rsync -y
# install wget to download archives
- apt-get install wget
# Install composer
- apt-get install zip unzip
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
# Install NodeJS for NPM
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt-get update && apt-get install -y nodejs
# Install php and js dependencies js-dependencies:
- php composer.phar install --no-dev --ignore-platform-reqs stage: prepare
- npm install script:
# Install all npm dependencies
- npm ci
artifacts:
paths:
- node_modules/
expire_in: 30 mins
# build all UI assets lint-commit-msg:
- npm run build stage: quality
script:
- chmod +x ./scripts/lint-commit-msg.sh
# lint commit message
- ./scripts/lint-commit-msg.sh
dependencies:
- js-dependencies
lint-php:
stage: quality
script:
# check php code style
- vendor/bin/ecs check --ansi
# phpstan - increase memory limit to 1GB to prevent script failure
- php -d memory_limit=1G vendor/bin/phpstan analyse --ansi
# run rector to check for php errors
- vendor/bin/rector process --dry-run --ansi
dependencies:
- php-dependencies
lint-js:
stage: quality
script:
- npm run prettier
- npm run typecheck
- npm run lint
- npm run lint:css
dependencies:
- js-dependencies
tests:
stage: quality
script:
# run phpunit without code coverage
# TODO: add code coverage
- vendor/bin/phpunit --no-coverage
dependencies:
- php-dependencies
bundle_app: bundle:
stage: bundle stage: bundle
before_script:
# prepare dependencies before bundling
- chmod +x ./scripts/bundle-prepare.sh
- ./scripts/bundle-prepare.sh
script: script:
# download GeoLite2-City archive and extract it to writable/uploads # make scripts/bundle.sh executable
- wget -c "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENCE_KEY&suffix=tar.gz" -O - | tar -xz -C ./writable/uploads/ - chmod +x ./scripts/bundle.sh
# rename extracted archives' folders # bundle castopod-host with commit ref as version
- mv ./writable/uploads/GeoLite2-City* ./writable/uploads/GeoLite2-City - ./scripts/bundle.sh ${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}
dependencies:
# create bundle folder: uses .rsync-filter (-F) file to copy only needed files - php-dependencies
- rsync -aF --progress . ./castopod-host - js-dependencies
artifacts: artifacts:
name: "castopod-host-${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}" name: "castopod-host-${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
paths: paths:
...@@ -58,24 +90,25 @@ bundle_app: ...@@ -58,24 +90,25 @@ bundle_app:
- beta - beta
- alpha - alpha
release_app: release:
stage: release stage: release
script: before_script:
# install required packages for prepare-release.sh script
- apt-get install jq -y
- apt-get install zip -y
# make prepare-release.sh executable
- chmod +x ./prepare-release.sh
# IMPORTANT: delete local git tags before release to prevent eventual script failure (ie. tag already exists) # IMPORTANT: delete local git tags before release to prevent eventual script failure (ie. tag already exists)
- git tag | xargs git tag -d - git tag | xargs git tag -d
# IMPORTANT: no need to run git hooks, just remove them # prepare dependencies before release, both bundle and package scripts will be run by semantic-release
- rm -rf ./.git/hooks - chmod +x ./scripts/bundle-prepare.sh
- ./scripts/bundle-prepare.sh
script:
# make release scripts executable
- chmod +x ./scripts/bundle.sh
- chmod +x ./scripts/package.sh
# run semantic-release script (configured in `.releaserc.json` file) # run semantic-release script (configured in `.releaserc.json` file)
- npm run release - npm run release
dependencies:
- php-dependencies
- js-dependencies
only: only:
- main - main
- alpha - alpha
......
_
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --verbose --edit "$1"
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# CaptainHook 5.10.0
INTERACTIVE="--no-interaction"
vendor/bin/captainhook $INTERACTIVE --configuration=captainhook.json --bootstrap=vendor/autoload.php hook:pre-commit "$@" <&0
npm run typecheck
npx lint-staged
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# CaptainHook 5.10.0
INTERACTIVE="--no-interaction"
vendor/bin/captainhook $INTERACTIVE --configuration=captainhook.json --bootstrap=vendor/autoload.php hook:pre-push "$@" <&0
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Castopod">
<description>Castopod Host's coding standard based on the PSR-1 standard.</description>
<!-- Include the whole PSR-1 standard -->
<rule ref="PSR1"/>
</ruleset>
\ No newline at end of file
{ {
"trailingComma": "es5", "trailingComma": "es5",
"overrides": [ "overrides": [
{
"files": "*.php",
"options": {
"phpVersion": "7.3",
"singleQuote": true
}
},
{ {
"files": "*.md", "files": "*.md",
"options": { "options": {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
[ [
"@semantic-release/exec", "@semantic-release/exec",
{ {
"prepareCmd": "./prepare-release.sh ${nextRelease.version}" "prepareCmd": "./scripts/bundle.sh ${nextRelease.version} && ./scripts/package.sh && npx prettier --write CHANGELOG.md"
} }
], ],
"@semantic-release/npm", "@semantic-release/npm",
......
...@@ -10,4 +10,5 @@ ...@@ -10,4 +10,5 @@
+ LICENSE.md + LICENSE.md
+ README.md + README.md
+ INSTALL.md + INSTALL.md
+ UPDATE.md
- ** - **
This diff is collapsed.
FROM php:7.3-fpm ####################################################
# Castopod Host development Docker file
####################################################
# ⚠️ NOT optimized for production
# should be used only for development purposes
#---------------------------------------------------
FROM php:8.0-fpm
LABEL maintainer="Yassine Doghri <yassine@doghri.fr>"
COPY . /castopod-host COPY . /castopod-host
WORKDIR /castopod-host WORKDIR /castopod-host
### Install CodeIgniter's server requirements # Install composer
#-- https://github.com/codeigniter4/appstarter#server-requirements COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Install intl extension using https://github.com/mlocati/docker-php-extension-installer # Install server requirements
RUN apt-get update && apt-get install -y \ RUN apt-get update \
# gnupg to sign commits with gpg
&& apt-get install --yes --no-install-recommends gnupg \
# npm through the nodejs package
&& curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get update \
&& apt-get install --yes --no-install-recommends nodejs \
# update npm
&& npm install --global npm@7 \
&& apt-get update \
&& apt-get install --yes --no-install-recommends \
git \
openssh-client \
vim \
# cron for scheduled tasks
cron \
# unzip used by composer
unzip \
# required libraries to install php extensions using
# https://github.com/mlocati/docker-php-extension-installer (included in php's docker image)
libicu-dev \ libicu-dev \
libpng-dev \ libpng-dev \
libjpeg-dev \ libjpeg-dev \
zlib1g-dev \ zlib1g-dev \
&& docker-php-ext-install intl libzip-dev \
# intl for Internationalization
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install intl \
&& docker-php-ext-install gd && docker-php-ext-install zip \
# gd for image processing
RUN pecl install -o -f redis \ && docker-php-ext-configure gd --with-jpeg \
&& rm -rf /tmp/pear \ && docker-php-ext-install gd \
&& docker-php-ext-enable redis # redis extension for cache
&& pecl install -o -f redis \
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli && rm -rf /tmp/pear \
&& docker-php-ext-enable redis \
RUN echo "file_uploads = On\n" \ # mysqli for database access
&& docker-php-ext-install mysqli \
&& docker-php-ext-enable mysqli \
# configure php
&& echo "file_uploads = On\n" \
"memory_limit = 512M\n" \ "memory_limit = 512M\n" \
"upload_max_filesize = 500M\n" \ "upload_max_filesize = 500M\n" \
"post_max_size = 512M\n" \ "post_max_size = 512M\n" \
"max_execution_time = 300\n" \ "max_execution_time = 300\n" \
> /usr/local/etc/php/conf.d/uploads.ini > /usr/local/etc/php/conf.d/uploads.ini \
# install cron
RUN apt-get update && \
apt-get install -y cron
RUN crontab /castopod-host/crontab
...@@ -7,10 +7,10 @@ or shared hosting, you can install it on most PHP-MySQL compatible web servers. ...@@ -7,10 +7,10 @@ or shared hosting, you can install it on most PHP-MySQL compatible web servers.
- [Install instructions](#install-instructions) - [Install instructions](#install-instructions)
- [0. Pre-requisites](#0-pre-requisites) - [0. Pre-requisites](#0-pre-requisites)
- [1. Install Wizard](#1-install-wizard) - [(recommended) Install Wizard](#recommended-install-wizard)
- [1-alt Manual configuration](#1-alt-manual-configuration) - [(alternative) Manual configuration](#alternative-manual-configuration)
- [Web Server Requirements](#web-server-requirements) - [Web Server Requirements](#web-server-requirements)
- [PHP v7.3 or higher](#php-v73-or-higher) - [PHP v8.0 or higher](#php-v80-or-higher)
- [MySQL compatible database](#mysql-compatible-database) - [MySQL compatible database](#mysql-compatible-database)
- [Privileges](#privileges) - [Privileges](#privileges)
- [(Optional) Other recommendations](#optional-other-recommendations) - [(Optional) Other recommendations](#optional-other-recommendations)
...@@ -39,17 +39,20 @@ or shared hosting, you can install it on most PHP-MySQL compatible web servers. ...@@ -39,17 +39,20 @@ or shared hosting, you can install it on most PHP-MySQL compatible web servers.
> ⚠️ Social features will not work properly if you do not set the task. It is > ⚠️ Social features will not work properly if you do not set the task. It is
> used to broadcast social activities to the fediverse. > used to broadcast social activities to the fediverse.
### 1. Install Wizard ### (recommended) Install Wizard
1. Run the Castopod Host install script by going to the install wizard page 1. Run the Castopod Host install script by going to the install wizard page
(`https://your_domain_name.com/cp-install`) in your favorite web browser. (`https://your_domain_name.com/cp-install`) in your favorite web browser.
2. Follow the instructions on your screen. 2. Follow the instructions on your screen.
3. Start podcasting! 3. Start podcasting!
### 1-alt Manual configuration > **Note:**
>
> The install script writes a `.env` file in the package root. If you cannot go
> through the install wizard, you can
> [create and update the `.env` file manually](#alternative-manual-configuration).
The install script writes a `.env` file in the package root. If you cannot go ### (alternative) Manual configuration
through the install wizard, you can create and update the `.env` file yourself:
1. Rename the `.env.example` file to `.env` and update the default values with 1. Rename the `.env.example` file to `.env` and update the default values with
your own. your own.
...@@ -59,9 +62,9 @@ through the install wizard, you can create and update the `.env` file yourself: ...@@ -59,9 +62,9 @@ through the install wizard, you can create and update the `.env` file yourself:
## Web Server Requirements ## Web Server Requirements
### PHP v7.3 or higher ### PHP v8.0 or higher
PHP version 7.3 or higher is required, with the following extensions installed: PHP version 8.0 or higher is required, with the following extensions installed:
- [intl](https://php.net/manual/en/intl.requirements.php) - [intl](https://php.net/manual/en/intl.requirements.php)
- [libcurl](https://php.net/manual/en/curl.requirements.php) - [libcurl](https://php.net/manual/en/curl.requirements.php)
......
# ![Castopod Host](https://podlibre.org/static/images/Castopod-Title.svg) <h1 style="text-align: center">
<img src="https://podlibre.org/static/images/Castopod-Title.svg" alt="Castopod Host" />
</h1>
> ⚠️ **Castopod Host is in alpha version**. It is still under heavy development
> and may not be 100% stable as new features are being worked on.
_Castopod Host_ is a free and open-source podcast hosting solution made for _Castopod Host_ is a free and open-source podcast hosting solution made for
podcasters who want engage and interact with their audience. podcasters who want engage and interact with their audience.
...@@ -9,20 +14,26 @@ audience measurements that respect your listeners privacy. ...@@ -9,20 +14,26 @@ audience measurements that respect your listeners privacy.
Whether you choose to install it on your own server or have it hosted by a Whether you choose to install it on your own server or have it hosted by a
professional, all your data and analytics belong to you and you only! professional, all your data and analytics belong to you and you only!
![Castopod Mascot](https://podlibre.org/static/images/Castopod-Mascot-Server.svg) <div style="text-align: center">
<img src="https://podlibre.org/static/images/Castopod-Mascot-Server.svg" alt="Castopod Mascot" />
</div>
You may find Castopod Host's source code on the You may find Castopod Host's source code on the
[original repository](https://code.podlibre.org/podlibre/castopod-host) or, [original repository](https://code.podlibre.org/podlibre/castopod-host) or,
alternatively, on the alternatively, on the
[github repository (mirror)](https://github.com/podlibre/castopod-host). [github repository (mirror)](https://github.com/podlibre/castopod-host).
## Installation ## Install / Update
To install Castopod Host on your PHP/MySQL server: To install or update Castopod Host on your PHP/MySQL server:
- Download - Download
[Castopod Host's latest Package (zip or tar.gz)](https://code.podlibre.org/podlibre/castopod-host/-/releases), [Castopod Host's latest Package (zip or tar.gz)](https://code.podlibre.org/podlibre/castopod-host/-/releases):
- Follow the procedure on “[How to install Castopod Host](./INSTALL.md)”.
- Follow one of the procedures on:
- [“How to **install** Castopod Host”](./INSTALL.md)
- or [“How to **update** Castopod Host”](./UPDATE.md)
## Documentation ## Documentation
......
# How to update Castopod Host <!-- omit in toc -->
After installing _Castopod Host_, you may want to update your instance to the
latest version in order to enjoy the latest features ✨, bug fixes 🐛 and
performance improvements ⚡.
## Table of contents <!-- omit in toc -->
- [Manual update instructions](#manual-update-instructions)
- [Automatic update instructions](#automatic-update-instructions)
- [Frequently asked questions (FAQ)](#frequently-asked-questions-faq)
- [Where can I find my _Castopod Host_ version?](#where-can-i-find-my-castopod-host-version)
- [I haven't updated my instance in a long time… What should I do?](#i-havent-updated-my-instance-in-a-long-time-what-should-i-do)
- [Should I make a backup before updating?](#should-i-make-a-backup-before-updating)
## Manual update instructions
1. Go to the
[releases page](https://code.podlibre.org/podlibre/castopod-host/-/releases)
and see if your instance is up to date with the latest _Castopod Host_
version
- cf.
[Where can I find my _Castopod Host_ version?](#where-can-i-find-my-castopod-host-version)
2. Download the latest release package named `Castopod Host Package`, you may
choose between the `zip` or `tar.gz` archives
- ⚠️ Make sure you download the Castopod Host Package and **NOT** the Source
Code
3. On your server:
- Remove all files except `.env` and `public/media`
- Copy the new files from the downloaded package into your server
4. Alpha releases may come with additional update instructions (see
[releases page](https://code.podlibre.org/podlibre/castopod-host/-/releases)).
They are usually database migration scripts in `.sql` format to update your
database schema.
- 👉 Make sure you run the scripts on your phpmyadmin panel or using command
line to update the database along with the package files!
- cf.
[I haven't updated my instance in a long time… What should I do?](#i-havent-updated-my-instance-in-a-long-time-what-should-i-do)
5. ✨ Enjoy your fresh instance, you're all done!
## Automatic update instructions
> Coming soon... 👀
## Frequently asked questions (FAQ)
### Where can I find my _Castopod Host_ version?
Go to your _Castopod Host_ admin panel, the version is displayed on the bottom
right corner.
Alternatively, you can find the version in the `app > Config > Constants.php`
file.
### I haven't updated my instance in a long time… What should I do?
No problem! Just get the latest release as described above. Only, when going
through the release instructions (4), perform them sequentially, from the oldest
to the newest.
> You may want to backup your instance depending on how long you haven't updated
> _Castopod Host_.
For example, if you're on `v1.0.0-alpha.42` and would like to upgrade to
`v1.0.0-alpha.58`:
0. (recommended) Make a backup of your files and database.
1. Download the latest release, overwrite your files whilst keeping `.env` and
`public/media`.
2. Go through each release update instructions sequentially (from oldest to
newest) starting with `v1.0.0-alpha.43`, `v1.0.0-alpha.44`,
`v1.0.0-alpha.45`, …, `v1.0.0-alpha.58`.
3. ✨ Enjoy your fresh instance, you're all done!
### Should I make a backup before updating?
We advise you do, so you don't lose everything if anything goes wrong!
More generally, we advise you make regular backups of your Castopod Host files
and database to prevent you from losing it all…
<?php <?php
declare(strict_types=1);
namespace App\Authorization; namespace App\Authorization;
class FlatAuthorization extends \Myth\Auth\Authorization\FlatAuthorization use Myth\Auth\Authorization\FlatAuthorization as MythAuthFlatAuthorization;
class FlatAuthorization extends MythAuthFlatAuthorization
{ {
//-------------------------------------------------------------------- /**
// Actions * The group model to use. Usually the class noted below (or an extension thereof) but can be any compatible
//-------------------------------------------------------------------- * CodeIgniter Model.
*
* @var PermissionModel
*/
protected $permissionModel;
/** /**
* Checks a group to see if they have the specified permission. * Checks a group to see if they have the specified permission.
*
* @param int|string $permission
* @param int $groupId
*
* @return mixed
*/ */
public function groupHasPermission($permission, int $groupId) public function groupHasPermission(int | string $permission, int $groupId): bool
{ {
if (
empty($permission) ||
(!is_string($permission) && !is_numeric($permission))
) {
return null;
}
if (empty($groupId) || !is_numeric($groupId)) {
return null;
}
// Get the Permission ID // Get the Permission ID
$permissionId = $this->getPermissionID($permission); $permissionId = $this->getPermissionID($permission);
if (!is_numeric($permissionId)) { if (! is_numeric($permissionId)) {
return false; return false;
} }
if ( return $this->permissionModel->doesGroupHavePermission($groupId, $permissionId);
$this->permissionModel->doesGroupHavePermission(
$groupId,
(int) $permissionId
)
) {
return true;
}
return false;
} }
/** /**
* Makes user part of given groups. * Makes user part of given groups.
* *
* @param $userId * @param array<string, string> $groups Either collection of ID or names
* @param array|null $groups // Either collection of ID or names
*
* @return bool
*/ */
public function setUserGroups(int $userId, $groups) public function setUserGroups(int $userId, array $groups = []): bool
{ {
if (empty($userId) || !is_numeric($userId)) {
return null;
}
// remove user from all groups before resetting it in new groups // remove user from all groups before resetting it in new groups
$this->groupModel->removeUserFromAllGroups($userId); $this->groupModel->removeUserFromAllGroups($userId);
if (empty($groups)) { if ($groups === []) {
return true; return true;
} }
......
<?php <?php
declare(strict_types=1);
namespace App\Authorization; namespace App\Authorization;
class GroupModel extends \Myth\Auth\Authorization\GroupModel use Myth\Auth\Authorization\GroupModel as MythAuthGroupModel;
class GroupModel extends MythAuthGroupModel
{ {
public function getContributorRoles() /**
* @return mixed[]
*/
public function getContributorRoles(): array
{ {
return $this->select('auth_groups.*') return $this->select('auth_groups.*')
->like('name', 'podcast_', 'after') ->like('name', 'podcast_', 'after')
->findAll(); ->findAll();
} }
public function getUserRoles() /**
* @return mixed[]
*/
public function getUserRoles(): array
{ {
return $this->select('auth_groups.*') return $this->select('auth_groups.*')
->notLike('name', 'podcast_', 'after') ->notLike('name', 'podcast_', 'after')
......