mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-05 08:52:00 +00:00
fix: remove exit function from podcast:import command to allow for episodes:compute-downloads to run
- update CI4 to v4.5.7 - update php and js dependencies to latest - reconfigure lint-staged
This commit is contained in:
parent
4b0c0d7531
commit
3359abf3fc
@ -1,18 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2020": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 11,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {}
|
||||
}
|
@ -69,10 +69,9 @@ lint-php:
|
||||
lint-js:
|
||||
stage: quality
|
||||
script:
|
||||
- pnpm run prettier
|
||||
- pnpm run format
|
||||
- pnpm run typecheck
|
||||
- pnpm run lint
|
||||
- pnpm run lint:css
|
||||
dependencies:
|
||||
- js-dependencies
|
||||
|
||||
|
@ -37,7 +37,7 @@ if (! function_exists('view')) {
|
||||
$renderer = single_service('renderer', $path);
|
||||
|
||||
$saveData = config('View')
|
||||
->saveData;
|
||||
->saveData;
|
||||
|
||||
if (array_key_exists('saveData', $options)) {
|
||||
$saveData = (bool) $options['saveData'];
|
||||
|
@ -50,11 +50,12 @@ Events::on('pre_system', static function (): void {
|
||||
*/
|
||||
if (CI_DEBUG && ! is_cli()) {
|
||||
Events::on('DBQuery', Database::class . '::collect');
|
||||
Services::toolbar()->respond();
|
||||
service('toolbar')
|
||||
->respond();
|
||||
|
||||
// Hot Reload route - for framework use on the hot reloader.
|
||||
if (ENVIRONMENT === 'development') {
|
||||
Services::routes()->get('__hot-reload', static function (): void {
|
||||
service('routes')->get('__hot-reload', static function (): void {
|
||||
(new HotReloader())->run();
|
||||
});
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class Filters extends BaseConfig
|
||||
/**
|
||||
* List of filter aliases that are always applied before and after every request.
|
||||
*
|
||||
* @var array<string, array<string, array<string, string|array<string>>>>>|array<string, list<string>>
|
||||
* @var array<string, array<string, array<string, string|array<string>>>>|array<string, list<string>>
|
||||
*/
|
||||
public array $globals = [
|
||||
'before' => [
|
||||
|
@ -74,6 +74,6 @@ class Format extends BaseConfig
|
||||
*/
|
||||
public function getFormatter(string $mime): FormatterInterface
|
||||
{
|
||||
return Services::format()->getFormatter($mime);
|
||||
return service('format')->getFormatter($mime);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class Generators extends BaseConfig
|
||||
*
|
||||
* YOU HAVE BEEN WARNED!
|
||||
*
|
||||
* @var array<string, string>
|
||||
* @var array<string, array<string, string>|string>
|
||||
*/
|
||||
public array $views = [
|
||||
'make:cell' => [
|
||||
|
@ -70,7 +70,7 @@ class Paths
|
||||
* This variable must contain the name of the directory that
|
||||
* contains the view files used by your application. By
|
||||
* default this is in `app/Views`. This value
|
||||
* is used when no value is provided to `Services::renderer()`.
|
||||
* is used when no value is provided to `service('renderer')`.
|
||||
*/
|
||||
public string $viewDirectory = __DIR__ . '/../Views';
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Config;
|
||||
|
||||
use CodeIgniter\Config\BaseConfig;
|
||||
use CodeIgniter\Tasks\Config\Tasks as BaseTasks;
|
||||
use CodeIgniter\Tasks\Scheduler;
|
||||
|
||||
class Tasks extends BaseConfig
|
||||
class Tasks extends BaseTasks
|
||||
{
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
@ -17,7 +17,7 @@ class Tasks extends BaseConfig
|
||||
* If true, will log the time it takes for each task to run.
|
||||
* Requires the settings table to have been created previously.
|
||||
*/
|
||||
public bool $logPerformance = false;
|
||||
public bool $logPerformance = true;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
|
@ -21,7 +21,6 @@ use CodeIgniter\HTTP\RedirectResponse;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
use Config\Services;
|
||||
use Modules\Analytics\Config\Analytics;
|
||||
use Modules\PremiumPodcasts\Entities\Subscription;
|
||||
use Modules\PremiumPodcasts\Models\SubscriptionModel;
|
||||
@ -130,7 +129,7 @@ class EpisodeAudioController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$serviceName = '';
|
||||
if ($this->request->getGet('_from')) {
|
||||
|
@ -21,7 +21,6 @@ use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\Response;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Config\Embed;
|
||||
use Config\Services;
|
||||
use Modules\Analytics\AnalyticsTrait;
|
||||
use Modules\Fediverse\Objects\OrderedCollectionObject;
|
||||
use Modules\Fediverse\Objects\OrderedCollectionPage;
|
||||
@ -293,7 +292,7 @@ class EpisodeController extends BaseController
|
||||
$this->registerPodcastWebpageHit($this->episode->podcast_id);
|
||||
}
|
||||
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (service('superglobals')->server('HTTP_REFERER') !== null) {
|
||||
$session->set('embed_domain', parse_url(service('superglobals')->server('HTTP_REFERER'), PHP_URL_HOST));
|
||||
|
@ -52,16 +52,21 @@ class PostController extends FediversePostController
|
||||
$this->podcast = $podcast;
|
||||
$this->actor = $this->podcast->actor;
|
||||
|
||||
if (
|
||||
count($params) > 1 &&
|
||||
($post = (new PostModel())->getPostById($params[1])) instanceof CastopodPost
|
||||
) {
|
||||
$this->post = $post;
|
||||
|
||||
unset($params[0]);
|
||||
unset($params[1]);
|
||||
if (count($params) <= 1) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
if (
|
||||
! ($post = (new PostModel())->getPostById($params[1])) instanceof CastopodPost
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$this->post = $post;
|
||||
|
||||
unset($params[0]);
|
||||
unset($params[1]);
|
||||
|
||||
return $this->{$method}(...$params);
|
||||
}
|
||||
|
||||
@ -72,10 +77,6 @@ class PostController extends FediversePostController
|
||||
$this->registerPodcastWebpageHit($this->podcast->id);
|
||||
}
|
||||
|
||||
if (! $this->post instanceof CastopodPost) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
$cacheName = implode(
|
||||
'_',
|
||||
array_filter([
|
||||
|
@ -36,7 +36,7 @@ use Modules\Media\Models\MediaModel;
|
||||
* @property string $type
|
||||
* @property int|null $media_id
|
||||
* @property Video|Audio|null $media
|
||||
* @property array|null $metadata
|
||||
* @property array<mixed>|null $metadata
|
||||
* @property string $status
|
||||
* @property string $logs
|
||||
* @property User $user
|
||||
@ -136,7 +136,7 @@ class BaseClip extends Entity
|
||||
$media = new Audio([
|
||||
'file_key' => $fileKey,
|
||||
'language_code' => $this->getPodcast()
|
||||
->language_code,
|
||||
->language_code,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
|
@ -15,7 +15,7 @@ use Modules\Media\Entities\Video;
|
||||
use Modules\Media\Models\MediaModel;
|
||||
|
||||
/**
|
||||
* @property array $theme
|
||||
* @property array{name:string,preview:string} $theme
|
||||
* @property string $format
|
||||
*/
|
||||
class VideoClip extends BaseClip
|
||||
@ -73,7 +73,7 @@ class VideoClip extends BaseClip
|
||||
$video = new Video([
|
||||
'file_key' => $fileKey,
|
||||
'language_code' => $this->getPodcast()
|
||||
->language_code,
|
||||
->language_code,
|
||||
'uploaded_by' => $this->attributes['created_by'],
|
||||
'updated_by' => $this->attributes['created_by'],
|
||||
]);
|
||||
|
@ -73,7 +73,7 @@ use SimpleXMLElement;
|
||||
* @property string|null $location_name
|
||||
* @property string|null $location_geo
|
||||
* @property string|null $location_osm
|
||||
* @property array|null $custom_rss
|
||||
* @property array<string|int,mixed>|null $custom_rss
|
||||
* @property string $custom_rss_string
|
||||
* @property bool $is_published_on_hubs
|
||||
* @property int $downloads_count
|
||||
@ -200,7 +200,7 @@ class Episode extends Entity
|
||||
$cover = new Image([
|
||||
'file_key' => 'podcasts/' . $this->getPodcast()->handle . '/' . $this->attributes['slug'] . '.' . $file->getExtension(),
|
||||
'sizes' => config('Images')
|
||||
->podcastCoverSizes,
|
||||
->podcastCoverSizes,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
@ -283,7 +283,7 @@ class Episode extends Entity
|
||||
$transcript = new Transcript([
|
||||
'file_key' => 'podcasts/' . $this->getPodcast()->handle . '/' . $this->attributes['slug'] . '-transcript.' . $file->getExtension(),
|
||||
'language_code' => $this->getPodcast()
|
||||
->language_code,
|
||||
->language_code,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
@ -320,7 +320,7 @@ class Episode extends Entity
|
||||
$chapters = new Chapters([
|
||||
'file_key' => 'podcasts/' . $this->getPodcast()->handle . '/' . $this->attributes['slug'] . '-chapters' . '.' . $file->getExtension(),
|
||||
'language_code' => $this->getPodcast()
|
||||
->language_code,
|
||||
->language_code,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
@ -346,10 +346,10 @@ class Episode extends Entity
|
||||
$audioURL = url_to(
|
||||
'episode-audio',
|
||||
$this->getPodcast()
|
||||
->handle,
|
||||
->handle,
|
||||
$this->slug,
|
||||
$this->getAudio()
|
||||
->file_extension
|
||||
->file_extension
|
||||
);
|
||||
|
||||
// Wrap episode url with OP3 if episode is public and OP3 is enabled on this podcast
|
||||
@ -534,7 +534,7 @@ class Episode extends Entity
|
||||
|
||||
if ($this->getPodcast()->episode_description_footer_html) {
|
||||
$descriptionHtml .= "<footer>{$this->getPodcast()
|
||||
->episode_description_footer_html}</footer>";
|
||||
->episode_description_footer_html}</footer>";
|
||||
}
|
||||
|
||||
return $descriptionHtml;
|
||||
|
@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
namespace App\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use Config\Services;
|
||||
|
||||
/**
|
||||
* @property string $url
|
||||
@ -85,7 +84,7 @@ class Location extends Entity
|
||||
*/
|
||||
public function fetchOsmLocation(): static
|
||||
{
|
||||
$client = Services::curlrequest();
|
||||
$client = service('curlrequest');
|
||||
|
||||
$response = $client->request(
|
||||
'GET',
|
||||
|
@ -72,7 +72,7 @@ class Person extends Entity
|
||||
$avatar = new Image([
|
||||
'file_key' => 'persons/' . $this->attributes['unique_name'] . '.' . $file->getExtension(),
|
||||
'sizes' => config('Images')
|
||||
->personAvatarSizes,
|
||||
->personAvatarSizes,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
|
@ -78,7 +78,7 @@ use RuntimeException;
|
||||
* @property string|null $location_geo
|
||||
* @property string|null $location_osm
|
||||
* @property string|null $payment_pointer
|
||||
* @property array|null $custom_rss
|
||||
* @property array<string|int,mixed>|null $custom_rss
|
||||
* @property bool $is_op3_enabled
|
||||
* @property string $op3_url
|
||||
* @property string $custom_rss_string
|
||||
@ -255,7 +255,7 @@ class Podcast extends Entity
|
||||
$cover = new Image([
|
||||
'file_key' => 'podcasts/' . $this->attributes['handle'] . '/cover.' . $file->getExtension(),
|
||||
'sizes' => config('Images')
|
||||
->podcastCoverSizes,
|
||||
->podcastCoverSizes,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
@ -298,7 +298,7 @@ class Podcast extends Entity
|
||||
$banner = new Image([
|
||||
'file_key' => 'podcasts/' . $this->attributes['handle'] . '/banner.' . $file->getExtension(),
|
||||
'sizes' => config('Images')
|
||||
->podcastBannerSizes,
|
||||
->podcastBannerSizes,
|
||||
'uploaded_by' => $this->attributes['updated_by'],
|
||||
'updated_by' => $this->attributes['updated_by'],
|
||||
]);
|
||||
|
@ -8,8 +8,6 @@ declare(strict_types=1);
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
use Config\Services;
|
||||
|
||||
if (! function_exists('render_breadcrumb')) {
|
||||
/**
|
||||
* Renders the breadcrumb navigation through the Breadcrumb service
|
||||
@ -19,7 +17,7 @@ if (! function_exists('render_breadcrumb')) {
|
||||
*/
|
||||
function render_breadcrumb(string $class = null): string
|
||||
{
|
||||
$breadcrumb = Services::breadcrumb();
|
||||
$breadcrumb = service('breadcrumb');
|
||||
return $breadcrumb->render($class);
|
||||
}
|
||||
}
|
||||
@ -30,7 +28,7 @@ if (! function_exists('replace_breadcrumb_params')) {
|
||||
*/
|
||||
function replace_breadcrumb_params(array $newParams): void
|
||||
{
|
||||
$breadcrumb = Services::breadcrumb();
|
||||
$breadcrumb = service('breadcrumb');
|
||||
$breadcrumb->replaceParams(esc($newParams));
|
||||
}
|
||||
}
|
||||
|
@ -158,20 +158,20 @@ if (! function_exists('publication_button')) {
|
||||
$label = lang('Episode.publish');
|
||||
$route = route_to('episode-publish', $podcastId, $episodeId);
|
||||
$variant = 'primary';
|
||||
$iconLeft = 'upload-cloud-fill'; // @icon('upload-cloud-fill')
|
||||
$iconLeft = 'upload-cloud-fill'; // @icon("upload-cloud-fill")
|
||||
break;
|
||||
case 'with_podcast':
|
||||
case 'scheduled':
|
||||
$label = lang('Episode.publish_edit');
|
||||
$route = route_to('episode-publish_edit', $podcastId, $episodeId);
|
||||
$variant = 'warning';
|
||||
$iconLeft = 'upload-cloud-fill'; // @icon('upload-cloud-fill')
|
||||
$iconLeft = 'upload-cloud-fill'; // @icon("upload-cloud-fill")
|
||||
break;
|
||||
case 'published':
|
||||
$label = lang('Episode.unpublish');
|
||||
$route = route_to('episode-unpublish', $podcastId, $episodeId);
|
||||
$variant = 'danger';
|
||||
$iconLeft = 'cloud-off-fill'; // @icon('cloud-off-fill')
|
||||
$iconLeft = 'cloud-off-fill'; // @icon("cloud-off-fill")
|
||||
break;
|
||||
default:
|
||||
$label = '';
|
||||
|
@ -210,7 +210,7 @@ if (! function_exists('get_podcast_banner')) {
|
||||
)->podcastBannerDefaultPaths['default'];
|
||||
|
||||
$sizes = config('Images')
|
||||
->podcastBannerSizes;
|
||||
->podcastBannerSizes;
|
||||
|
||||
$sizeConfig = $sizes[$size];
|
||||
helper('filesystem');
|
||||
@ -231,7 +231,7 @@ if (! function_exists('get_podcast_banner_mimetype')) {
|
||||
{
|
||||
if (! $podcast->banner instanceof Image) {
|
||||
$sizes = config('Images')
|
||||
->podcastBannerSizes;
|
||||
->podcastBannerSizes;
|
||||
|
||||
$sizeConfig = $sizes[$size];
|
||||
helper('filesystem');
|
||||
@ -252,10 +252,10 @@ if (! function_exists('get_avatar_url')) {
|
||||
{
|
||||
if (! $person->avatar instanceof Image) {
|
||||
$defaultAvatarPath = config('Images')
|
||||
->avatarDefaultPath;
|
||||
->avatarDefaultPath;
|
||||
|
||||
$sizes = config('Images')
|
||||
->personAvatarSizes;
|
||||
->personAvatarSizes;
|
||||
|
||||
$sizeConfig = $sizes[$size];
|
||||
|
||||
|
@ -18,7 +18,6 @@ use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\Router\Exceptions\RedirectException;
|
||||
use CodeIgniter\Router\Exceptions\RouterException;
|
||||
use CodeIgniter\Router\Router as CodeIgniterRouter;
|
||||
use Config\Services;
|
||||
|
||||
class Router extends CodeIgniterRouter
|
||||
{
|
||||
@ -115,8 +114,8 @@ class Router extends CodeIgniterRouter
|
||||
array_key_exists('alternate-content', $this->matchedRouteOptions) &&
|
||||
is_array($this->matchedRouteOptions['alternate-content'])
|
||||
) {
|
||||
$request = Services::request();
|
||||
$negotiate = Services::negotiator();
|
||||
$request = service('request');
|
||||
$negotiate = service('negotiator');
|
||||
|
||||
// Accept header is mandatory
|
||||
if ($request->header('Accept') === null) {
|
||||
|
@ -229,8 +229,6 @@ class EpisodeCommentModel extends UuidModel
|
||||
$episodeComments . ' UNION ' . $episodePostsReplies . ' ORDER BY created_at ASC'
|
||||
);
|
||||
|
||||
// FIXME:?
|
||||
// @phpstan-ignore-next-line
|
||||
return $this->convertUuidFieldsToStrings(
|
||||
$allEpisodeComments->getCustomResultObject($this->tempReturnType),
|
||||
$this->tempReturnType
|
||||
|
@ -3,17 +3,17 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @icon('funding:buymeacoffee')
|
||||
* @icon('funding:donorbox')
|
||||
* @icon('funding:gofundme')
|
||||
* @icon('funding:helloasso')
|
||||
* @icon('funding:indiegogo')
|
||||
* @icon('funding:kickstarter')
|
||||
* @icon('funding:kisskissbankbank')
|
||||
* @icon('funding:kofi')
|
||||
* @icon('funding:liberapay')
|
||||
* @icon('funding:patreon')
|
||||
* @icon('funding:paypal')
|
||||
* @icon('funding:tipeee')
|
||||
* @icon('funding:ulule')
|
||||
* @icon("funding:buymeacoffee")
|
||||
* @icon("funding:donorbox")
|
||||
* @icon("funding:gofundme")
|
||||
* @icon("funding:helloasso")
|
||||
* @icon("funding:indiegogo")
|
||||
* @icon("funding:kickstarter")
|
||||
* @icon("funding:kisskissbankbank")
|
||||
* @icon("funding:kofi")
|
||||
* @icon("funding:liberapay")
|
||||
* @icon("funding:patreon")
|
||||
* @icon("funding:paypal")
|
||||
* @icon("funding:tipeee")
|
||||
* @icon("funding:ulule")
|
||||
*/
|
||||
|
@ -3,46 +3,46 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @icon('podcasting:amazon')
|
||||
* @icon('podcasting:antennapod')
|
||||
* @icon('podcasting:anytime')
|
||||
* @icon('podcasting:apple')
|
||||
* @icon('podcasting:blubrry')
|
||||
* @icon('podcasting:breez')
|
||||
* @icon('podcasting:castamatic')
|
||||
* @icon('podcasting:castbox')
|
||||
* @icon('podcasting:castopod')
|
||||
* @icon('podcasting:castro')
|
||||
* @icon('podcasting:deezer')
|
||||
* @icon('podcasting:episodes-fm')
|
||||
* @icon('podcasting:fountain')
|
||||
* @icon('podcasting:fyyd')
|
||||
* @icon('podcasting:gpodder')
|
||||
* @icon('podcasting:ivoox')
|
||||
* @icon('podcasting:listennotes')
|
||||
* @icon('podcasting:overcast')
|
||||
* @icon('podcasting:playerfm')
|
||||
* @icon('podcasting:plink')
|
||||
* @icon('podcasting:pocketcasts')
|
||||
* @icon('podcasting:podbean')
|
||||
* @icon('podcasting:podcastaddict')
|
||||
* @icon('podcasting:podcastguru')
|
||||
* @icon('podcasting:podcastindex')
|
||||
* @icon('podcasting:podchaser')
|
||||
* @icon('podcasting:podcloud')
|
||||
* @icon('podcasting:podfriend')
|
||||
* @icon('podcasting:podinstall')
|
||||
* @icon('podcasting:podlink')
|
||||
* @icon('podcasting:podlp')
|
||||
* @icon('podcasting:podnews')
|
||||
* @icon('podcasting:podtail')
|
||||
* @icon('podcasting:podverse')
|
||||
* @icon('podcasting:radiopublic')
|
||||
* @icon('podcasting:sphinxchat')
|
||||
* @icon('podcasting:spotify')
|
||||
* @icon('podcasting:spreaker')
|
||||
* @icon('podcasting:truefans')
|
||||
* @icon('podcasting:tsacdop')
|
||||
* @icon('podcasting:tunein')
|
||||
* @icon('podcasting:youtube-music')
|
||||
* @icon("podcasting:amazon")
|
||||
* @icon("podcasting:antennapod")
|
||||
* @icon("podcasting:anytime")
|
||||
* @icon("podcasting:apple")
|
||||
* @icon("podcasting:blubrry")
|
||||
* @icon("podcasting:breez")
|
||||
* @icon("podcasting:castamatic")
|
||||
* @icon("podcasting:castbox")
|
||||
* @icon("podcasting:castopod")
|
||||
* @icon("podcasting:castro")
|
||||
* @icon("podcasting:deezer")
|
||||
* @icon("podcasting:episodes-fm")
|
||||
* @icon("podcasting:fountain")
|
||||
* @icon("podcasting:fyyd")
|
||||
* @icon("podcasting:gpodder")
|
||||
* @icon("podcasting:ivoox")
|
||||
* @icon("podcasting:listennotes")
|
||||
* @icon("podcasting:overcast")
|
||||
* @icon("podcasting:playerfm")
|
||||
* @icon("podcasting:plink")
|
||||
* @icon("podcasting:pocketcasts")
|
||||
* @icon("podcasting:podbean")
|
||||
* @icon("podcasting:podcastaddict")
|
||||
* @icon("podcasting:podcastguru")
|
||||
* @icon("podcasting:podcastindex")
|
||||
* @icon("podcasting:podchaser")
|
||||
* @icon("podcasting:podcloud")
|
||||
* @icon("podcasting:podfriend")
|
||||
* @icon("podcasting:podinstall")
|
||||
* @icon("podcasting:podlink")
|
||||
* @icon("podcasting:podlp")
|
||||
* @icon("podcasting:podnews")
|
||||
* @icon("podcasting:podtail")
|
||||
* @icon("podcasting:podverse")
|
||||
* @icon("podcasting:radiopublic")
|
||||
* @icon("podcasting:sphinxchat")
|
||||
* @icon("podcasting:spotify")
|
||||
* @icon("podcasting:spreaker")
|
||||
* @icon("podcasting:truefans")
|
||||
* @icon("podcasting:tsacdop")
|
||||
* @icon("podcasting:tunein")
|
||||
* @icon("podcasting:youtube-music")
|
||||
*/
|
||||
|
@ -3,26 +3,26 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @icon('social:bluesky')
|
||||
* @icon('social:discord')
|
||||
* @icon('social:facebook')
|
||||
* @icon('social:funkwhale')
|
||||
* @icon('social:instagram')
|
||||
* @icon('social:linkedin')
|
||||
* @icon('social:mastodon')
|
||||
* @icon('social:matrix')
|
||||
* @icon('social:misskey')
|
||||
* @icon('social:mobilizon')
|
||||
* @icon('social:peertube')
|
||||
* @icon('social:pixelfed')
|
||||
* @icon('social:pleroma')
|
||||
* @icon('social:plume')
|
||||
* @icon('social:slack')
|
||||
* @icon('social:telegram')
|
||||
* @icon('social:threads')
|
||||
* @icon('social:tiktok')
|
||||
* @icon('social:twitch')
|
||||
* @icon('social:writefreely')
|
||||
* @icon('social:x')
|
||||
* @icon('social:youtube')
|
||||
* @icon("social:bluesky")
|
||||
* @icon("social:discord")
|
||||
* @icon("social:facebook")
|
||||
* @icon("social:funkwhale")
|
||||
* @icon("social:instagram")
|
||||
* @icon("social:linkedin")
|
||||
* @icon("social:mastodon")
|
||||
* @icon("social:matrix")
|
||||
* @icon("social:misskey")
|
||||
* @icon("social:mobilizon")
|
||||
* @icon("social:peertube")
|
||||
* @icon("social:pixelfed")
|
||||
* @icon("social:pleroma")
|
||||
* @icon("social:plume")
|
||||
* @icon("social:slack")
|
||||
* @icon("social:telegram")
|
||||
* @icon("social:threads")
|
||||
* @icon("social:tiktok")
|
||||
* @icon("social:twitch")
|
||||
* @icon("social:writefreely")
|
||||
* @icon("social:x")
|
||||
* @icon("social:youtube")
|
||||
*/
|
||||
|
@ -22,19 +22,19 @@ class Alert extends Component
|
||||
$variants = [
|
||||
'success' => [
|
||||
'class' => 'text-pine-900 bg-pine-100 border-pine-300',
|
||||
'glyph' => 'check-fill', // @icon('check-fill')
|
||||
'glyph' => 'check-fill', // @icon("check-fill")
|
||||
],
|
||||
'danger' => [
|
||||
'class' => 'text-red-900 bg-red-100 border-red-300',
|
||||
'glyph' => 'close-fill', // @icon('close-fill')
|
||||
'glyph' => 'close-fill', // @icon("close-fill")
|
||||
],
|
||||
'warning' => [
|
||||
'class' => 'text-yellow-900 bg-yellow-100 border-yellow-300',
|
||||
'glyph' => 'alert-fill', // @icon('alert-fill')
|
||||
'glyph' => 'alert-fill', // @icon("alert-fill")
|
||||
],
|
||||
'default' => [
|
||||
'class' => 'text-blue-900 bg-blue-100 border-blue-300',
|
||||
'glyph' => 'error-warning-fill', // @icon('error-warning-fill')
|
||||
'glyph' => 'error-warning-fill', // @icon("error-warning-fill")
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -54,7 +54,7 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
|
||||
|
||||
$args = implode(', ', array_map(static fn ($value) => match (true) {
|
||||
is_object($value) => 'Object(' . $value::class . ')',
|
||||
is_array($value) => count($value) ? '[...]' : '[]',
|
||||
is_array($value) => $value !== [] ? '[...]' : '[]',
|
||||
$value === null => 'null', // return the lowercased version
|
||||
default => var_export($value, true),
|
||||
}, array_values($error['args'] ?? [])));
|
||||
|
@ -5,6 +5,7 @@
|
||||
var tabLinks = [];
|
||||
var contentDivs = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
function init() {
|
||||
// Grab the tab links and content divs from the page
|
||||
var tabListItems = document.getElementById("tabs").childNodes;
|
||||
@ -85,6 +86,7 @@ function getHash(url) {
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
function toggle(elem) {
|
||||
elem = document.getElementById(elem);
|
||||
|
||||
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
use CodeIgniter\CodeIgniter;
|
||||
use CodeIgniter\HTTP\Header;
|
||||
use Config\Services;
|
||||
|
||||
$errorId = uniqid('error', true);
|
||||
?>
|
||||
@ -228,7 +227,7 @@ while ($prevException = $last->getPrevious()) {
|
||||
|
||||
<!-- Request -->
|
||||
<div class="content" id="request">
|
||||
<?php $request = Services::request(); ?>
|
||||
<?php $request = service('request'); ?>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
@ -346,7 +345,7 @@ while ($prevException = $last->getPrevious()) {
|
||||
|
||||
<!-- Response -->
|
||||
<?php
|
||||
$response = Services::response();
|
||||
$response = service('response');
|
||||
$response->setStatusCode(http_response_code());
|
||||
?>
|
||||
<div class="content" id="response">
|
||||
|
@ -1,3 +1 @@
|
||||
/* eslint-disable */
|
||||
|
||||
module.exports = { extends: ["@commitlint/config-conventional"] };
|
||||
|
@ -9,37 +9,37 @@
|
||||
"php": "^8.1",
|
||||
"adaures/ipcat-php": "^v1.0.0",
|
||||
"adaures/podcast-persons-taxonomy": "^v1.0.1",
|
||||
"aws/aws-sdk-php": "^3.325.2",
|
||||
"aws/aws-sdk-php": "^3.336.10",
|
||||
"chrisjean/php-ico": "^1.0.4",
|
||||
"cocur/slugify": "^v4.6.0",
|
||||
"codeigniter4/framework": "v4.5.5",
|
||||
"codeigniter4/framework": "v4.5.7",
|
||||
"codeigniter4/settings": "v2.2.0",
|
||||
"codeigniter4/shield": "v1.1.0",
|
||||
"codeigniter4/tasks": "dev-develop",
|
||||
"geoip2/geoip2": "v3.0.0",
|
||||
"geoip2/geoip2": "v3.1.0",
|
||||
"james-heinrich/getid3": "^2.0.0-beta6",
|
||||
"league/commonmark": "^2.5.3",
|
||||
"league/commonmark": "^2.6.1",
|
||||
"league/html-to-markdown": "5.1.1",
|
||||
"melbahja/seo": "^v2.1.1",
|
||||
"michalsn/codeigniter4-uuid": "v1.1.0",
|
||||
"mpratt/embera": "^2.0.41",
|
||||
"mpratt/embera": "^2.0.42",
|
||||
"opawg/user-agents-v2-php": "dev-main",
|
||||
"phpseclib/phpseclib": "~2.0.47",
|
||||
"phpseclib/phpseclib": "~2.0.48",
|
||||
"vlucas/phpdotenv": "v5.6.1",
|
||||
"whichbrowser/parser": "^v2.1.8",
|
||||
"yassinedoghri/php-icons": "^v1.2.0",
|
||||
"yassinedoghri/podcast-feed": "dev-main"
|
||||
},
|
||||
"require-dev": {
|
||||
"captainhook/captainhook": "^5.23.6",
|
||||
"codeigniter/phpstan-codeigniter": "v1.4.3",
|
||||
"mikey179/vfsstream": "^v1.6.12",
|
||||
"captainhook/captainhook": "^5.24.1",
|
||||
"codeigniter/phpstan-codeigniter": "v1.5.1",
|
||||
"mikey179/vfsstream": "v1.6.12",
|
||||
"phpstan/extension-installer": "^1.4.3",
|
||||
"phpstan/phpstan": "^1.12.7",
|
||||
"phpunit/phpunit": "^10.5.38",
|
||||
"rector/rector": "^1.2.9",
|
||||
"phpstan/phpstan": "^2.1.1",
|
||||
"phpunit/phpunit": "^10.5.40",
|
||||
"rector/rector": "^2.0.6",
|
||||
"symplify/coding-standard": "^12.2.3",
|
||||
"symplify/easy-coding-standard": "^12.3.6"
|
||||
"symplify/easy-coding-standard": "^12.5.5"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
613
composer.lock
generated
613
composer.lock
generated
File diff suppressed because it is too large
Load Diff
23
eslint.config.js
Normal file
23
eslint.config.js
Normal file
@ -0,0 +1,23 @@
|
||||
import globals from "globals";
|
||||
import eslint from "@eslint/js";
|
||||
import tseslint from "typescript-eslint";
|
||||
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
||||
|
||||
export default [
|
||||
...tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.strict,
|
||||
eslintPluginPrettierRecommended
|
||||
),
|
||||
{
|
||||
ignores: ["public/*", "docs/*", "vendor/*", "castopod/*"],
|
||||
},
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
@ -16,7 +16,7 @@ $routes->add('scheduled-video-clips', 'SchedulerController::generateVideoClips',
|
||||
// Admin area routes
|
||||
$routes->group(
|
||||
config('Admin')
|
||||
->gateway,
|
||||
->gateway,
|
||||
[
|
||||
'namespace' => 'Modules\Admin\Controllers',
|
||||
],
|
||||
|
@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
namespace Modules\Admin\Controllers;
|
||||
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use Config\Services;
|
||||
|
||||
class AboutController extends BaseController
|
||||
{
|
||||
@ -42,7 +41,7 @@ class AboutController extends BaseController
|
||||
|
||||
public function migrateDatabase(): RedirectResponse
|
||||
{
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
@ -10,8 +10,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Modules\Analytics;
|
||||
|
||||
use Config\Services;
|
||||
|
||||
trait AnalyticsTrait
|
||||
{
|
||||
protected function registerPodcastWebpageHit(int $podcastId): void
|
||||
@ -23,7 +21,7 @@ trait AnalyticsTrait
|
||||
set_user_session_referer();
|
||||
set_user_session_entry_page();
|
||||
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->get('denyListIp')) {
|
||||
$db = db_connect();
|
||||
|
@ -2,15 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use CodeIgniter\Router\RouteCollection;
|
||||
|
||||
/**
|
||||
* @copyright 2021 Ad Aures
|
||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
/** @var RouteCollection $routes */
|
||||
/** @var \CodeIgniter\Router\RouteCollection $routes */
|
||||
|
||||
/**
|
||||
* Analytics routes file
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Opawg\UserAgentsV2Php\UserAgentsRSS;
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
||||
namespace Modules\Analytics\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
/**
|
||||
* @property int $podcast_id
|
||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
||||
*/
|
||||
|
||||
use AdAures\Ipcat\IpDb;
|
||||
use Config\Services;
|
||||
use GeoIp2\Database\Reader;
|
||||
use Opawg\UserAgentsV2Php\UserAgents;
|
||||
use WhichBrowser\Parser;
|
||||
@ -55,7 +54,7 @@ if (! function_exists('set_user_session_deny_list_ip')) {
|
||||
*/
|
||||
function set_user_session_deny_list_ip(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->has('denyListIp')) {
|
||||
$session->set('denyListIp', IpDb::find(client_ip()) !== null);
|
||||
@ -69,7 +68,7 @@ if (! function_exists('set_user_session_location')) {
|
||||
*/
|
||||
function set_user_session_location(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$location = [
|
||||
'countryCode' => 'N/A',
|
||||
@ -105,7 +104,7 @@ if (! function_exists('set_user_session_player')) {
|
||||
*/
|
||||
function set_user_session_player(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->has('player')) {
|
||||
$playerFound = null;
|
||||
@ -148,7 +147,7 @@ if (! function_exists('set_user_session_browser')) {
|
||||
*/
|
||||
function set_user_session_browser(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->has('browser')) {
|
||||
$browserName = '- Other -';
|
||||
@ -174,7 +173,7 @@ if (! function_exists('set_user_session_referer')) {
|
||||
*/
|
||||
function set_user_session_referer(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$newreferer = service('superglobals')
|
||||
->server('HTTP_REFERER') ?? '- Direct -';
|
||||
@ -195,7 +194,7 @@ if (! function_exists('set_user_session_entry_page')) {
|
||||
*/
|
||||
function set_user_session_entry_page(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$entryPage = service('superglobals')
|
||||
->server('REQUEST_URI');
|
||||
@ -235,7 +234,7 @@ if (! function_exists('podcast_hit')) {
|
||||
string $serviceName,
|
||||
?int $subscriptionId,
|
||||
): void {
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$clientIp = client_ip();
|
||||
|
||||
@ -286,8 +285,7 @@ if (! function_exists('podcast_hit')) {
|
||||
$parts = explode('-', $range);
|
||||
$downloadedBytes += array_key_exists(1, $parts)
|
||||
? $fileSize
|
||||
: (int) $parts[1] -
|
||||
(array_key_exists(0, $parts) ? 0 : (int) $parts[0]);
|
||||
: (int) $parts[1] - (int) $parts[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@ use CodeIgniter\API\ResponseTrait;
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Modules\Api\Rest\V1\Config\Services;
|
||||
use Modules\Auth\Models\UserModel;
|
||||
|
||||
class EpisodeController extends Controller
|
||||
@ -24,7 +23,7 @@ class EpisodeController extends Controller
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Services::restApiExceptions()->initialize();
|
||||
service('restApiExceptions')->initialize();
|
||||
}
|
||||
|
||||
public function list(): ResponseInterface
|
||||
@ -296,7 +295,7 @@ class EpisodeController extends Controller
|
||||
protected static function mapEpisode(Episode $episode): Episode
|
||||
{
|
||||
$episode->cover_url = $episode->getCover()
|
||||
->file_url;
|
||||
->file_url;
|
||||
$episode->audio_url = $episode->getAudioUrl();
|
||||
$episode->duration = round($episode->audio->duration);
|
||||
|
||||
|
@ -9,7 +9,6 @@ use App\Models\PodcastModel;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Modules\Api\Rest\V1\Config\Services;
|
||||
|
||||
class PodcastController extends Controller
|
||||
{
|
||||
@ -17,7 +16,7 @@ class PodcastController extends Controller
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Services::restApiExceptions()->initialize();
|
||||
service('restApiExceptions')->initialize();
|
||||
}
|
||||
|
||||
public function list(): ResponseInterface
|
||||
@ -44,9 +43,9 @@ class PodcastController extends Controller
|
||||
{
|
||||
$podcast->feed_url = $podcast->getFeedUrl();
|
||||
$podcast->actor_display_name = $podcast->getActor()
|
||||
->display_name;
|
||||
->display_name;
|
||||
$podcast->cover_url = $podcast->getCover()
|
||||
->file_url;
|
||||
->file_url;
|
||||
|
||||
$categories = [$podcast->getCategory(), ...$podcast->getOtherCategories()];
|
||||
|
||||
|
@ -8,7 +8,6 @@ use Closure;
|
||||
use CodeIgniter\CLI\BaseCommand;
|
||||
use CodeIgniter\CLI\CLI;
|
||||
use CodeIgniter\View\Table;
|
||||
use Config\Services;
|
||||
use League\HTMLToMarkdown\Converter\TableConverter;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
use Modules\Auth\Config\AuthGroups;
|
||||
@ -57,7 +56,7 @@ class RolesDoc extends BaseCommand
|
||||
|
||||
foreach ($files as $file) {
|
||||
$locale = $this->detectLocaleFromPath($file);
|
||||
$language = Services::language();
|
||||
$language = service('language');
|
||||
$language->setLocale($locale);
|
||||
|
||||
$authGroups = new AuthGroups();
|
||||
|
@ -9,7 +9,6 @@ use App\Models\PodcastModel;
|
||||
use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Config\Services;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
@ -59,7 +58,7 @@ class PermissionFilter implements FilterInterface
|
||||
foreach ($arguments as $permission) {
|
||||
// is permission specific to a podcast?
|
||||
if (str_contains($permission, '#')) {
|
||||
$router = Services::router();
|
||||
$router = service('router');
|
||||
$routerParams = $router->params();
|
||||
|
||||
// get podcast id
|
||||
|
@ -14,7 +14,6 @@ use CodeIgniter\HTTP\CURLRequest;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Config\Services;
|
||||
use Modules\Fediverse\Core\Activity;
|
||||
use phpseclib\Crypt\RSA;
|
||||
|
||||
@ -33,7 +32,7 @@ class ActivityRequest
|
||||
|
||||
public function __construct(string $uri, ?string $activityPayload = null)
|
||||
{
|
||||
$this->request = Services::curlrequest();
|
||||
$this->request = service('curlrequest');
|
||||
|
||||
if ($activityPayload !== null) {
|
||||
$this->request->setBody($activityPayload);
|
||||
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Modules\Fediverse\Entities;
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Michalsn\Uuid\UuidEntity;
|
||||
use RuntimeException;
|
||||
|
||||
|
@ -9,7 +9,6 @@ use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
use Config\Services;
|
||||
use Exception;
|
||||
use Modules\Fediverse\HttpSignature;
|
||||
|
||||
@ -31,7 +30,7 @@ class FediverseFilter implements FilterInterface
|
||||
}
|
||||
|
||||
if (in_array('verify-activitystream', $params, true)) {
|
||||
$negotiate = Services::negotiator();
|
||||
$negotiate = service('negotiator');
|
||||
|
||||
$allowedContentTypes = [
|
||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams',
|
||||
|
@ -41,7 +41,7 @@ if (! function_exists('split_handle')) {
|
||||
/**
|
||||
* Splits handle into its parts (username, host and port)
|
||||
*
|
||||
* @return array<string, string>|false
|
||||
* @return array{0:string,username:non-empty-string,1:non-empty-string,domain:non-empty-string,2:non-empty-string,port?:non-falsy-string,3?:non-falsy-string}
|
||||
*/
|
||||
function split_handle(string $handle): array | false
|
||||
{
|
||||
|
@ -16,7 +16,6 @@ namespace Modules\Fediverse;
|
||||
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Config\Services;
|
||||
use Exception;
|
||||
use phpseclib\Crypt\RSA;
|
||||
|
||||
@ -40,7 +39,7 @@ class HttpSignature
|
||||
public function __construct(IncomingRequest $request = null)
|
||||
{
|
||||
if (! $request instanceof IncomingRequest) {
|
||||
$request = Services::request();
|
||||
$request = service('request');
|
||||
}
|
||||
|
||||
$this->request = $request;
|
||||
|
@ -101,7 +101,7 @@ class WebFinger
|
||||
/**
|
||||
* Split resource into its parts (username, domain)
|
||||
*
|
||||
* @return array<string, string>|false
|
||||
* @return array{0:string,username:non-empty-string,1:non-empty-string,2:non-empty-string,domain:non-falsy-string,3:non-falsy-string,4:non-falsy-string,5?:non-falsy-string}
|
||||
*/
|
||||
private function splitResource(string $resource): bool|array
|
||||
{
|
||||
|
@ -6,7 +6,6 @@ namespace Modules\Install\Commands;
|
||||
|
||||
use CodeIgniter\CLI\BaseCommand;
|
||||
use Config\Database;
|
||||
use Config\Services;
|
||||
|
||||
class InitDatabase extends BaseCommand
|
||||
{
|
||||
@ -28,7 +27,7 @@ class InitDatabase extends BaseCommand
|
||||
public function run(array $params): void
|
||||
{
|
||||
// Run all migrations
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
||||
|
@ -19,7 +19,6 @@ use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\Shield\Entities\User;
|
||||
use CodeIgniter\Shield\Exceptions\ValidationException as ShieldValidationException;
|
||||
use Config\Database;
|
||||
use Config\Services;
|
||||
use Dotenv\Dotenv;
|
||||
use Dotenv\Exception\ValidationException;
|
||||
use Modules\Auth\Models\UserModel;
|
||||
@ -245,7 +244,7 @@ class InstallController extends Controller
|
||||
*/
|
||||
public function migrate(): void
|
||||
{
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
@ -24,7 +24,7 @@ use RuntimeException;
|
||||
* @property string $file_extension
|
||||
* @property int $file_size
|
||||
* @property string $file_mimetype
|
||||
* @property array|null $file_metadata
|
||||
* @property array<mixed>|null $file_metadata
|
||||
* @property 'image'|'audio'|'video'|'document' $type
|
||||
* @property string|null $description
|
||||
* @property string|null $language_code
|
||||
|
@ -11,11 +11,10 @@ declare(strict_types=1);
|
||||
namespace Modules\Media\Entities;
|
||||
|
||||
use CodeIgniter\Files\File;
|
||||
use Config\Services;
|
||||
use GdImage;
|
||||
|
||||
/**
|
||||
* @property array $sizes
|
||||
* @property array<string, array<string, int|string>> $sizes
|
||||
*/
|
||||
class Image extends BaseMedia
|
||||
{
|
||||
@ -130,7 +129,7 @@ class Image extends BaseMedia
|
||||
}
|
||||
|
||||
// save derived sizes
|
||||
$imageService = Services::image();
|
||||
$imageService = service('image');
|
||||
|
||||
foreach ($this->sizes as $name => $size) {
|
||||
$tempFilePath = tempnam(WRITEPATH . 'temp', 'img_');
|
||||
|
@ -13,7 +13,6 @@ class FS implements FileManagerInterface
|
||||
public function __construct(
|
||||
protected MediaConfig $config
|
||||
) {
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ if (! function_exists('download_file')) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, ['User-Agent: Castopod/' . CP_VERSION]);
|
||||
|
||||
// follow redirects up to 20, like Apple Podcasts
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 20);
|
||||
|
||||
curl_exec($ch);
|
||||
|
@ -14,7 +14,6 @@ use App\Entities\Podcast;
|
||||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use Config\Services;
|
||||
use Modules\Admin\Controllers\BaseController;
|
||||
use Modules\Platforms\Models\PlatformModel;
|
||||
|
||||
@ -65,7 +64,7 @@ class PlatformController extends BaseController
|
||||
public function attemptPlatformsUpdate(string $platformType): RedirectResponse
|
||||
{
|
||||
$platformModel = new PlatformModel();
|
||||
$validation = Services::validation();
|
||||
$validation = service('validation');
|
||||
|
||||
$platformsData = [];
|
||||
foreach (
|
||||
|
@ -127,7 +127,7 @@ class PlatformModel extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<array<string, string|int>> $data
|
||||
* @param array<array<string, bool|int|string|null>> $data
|
||||
*
|
||||
* @return int|false Number of rows inserted or FALSE on failure
|
||||
*/
|
||||
|
@ -458,7 +458,7 @@ class Platforms
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|array{label:string,home_url:string,submit_url:?string}>
|
||||
* @return null|array{label:string,home_url:string,submit_url:?string}
|
||||
*/
|
||||
public function findPlatformBySlug(string $type, string $slug): ?array
|
||||
{
|
||||
|
@ -16,7 +16,6 @@ use CodeIgniter\CLI\BaseCommand;
|
||||
use CodeIgniter\CLI\CLI;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use CodeIgniter\Shield\Entities\User;
|
||||
use Config\Services;
|
||||
use Exception;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
use Modules\Auth\Models\UserModel;
|
||||
@ -44,7 +43,7 @@ class PodcastImport extends BaseCommand
|
||||
|
||||
protected ?Podcast $podcast = null;
|
||||
|
||||
public function init(): void
|
||||
public function init(): bool
|
||||
{
|
||||
helper('podcast_import');
|
||||
|
||||
@ -70,8 +69,8 @@ class PodcastImport extends BaseCommand
|
||||
$nextImport = end($queuedImports);
|
||||
|
||||
if (! $nextImport instanceof PodcastImportTask) {
|
||||
// no queued import task, stop process.
|
||||
exit(0);
|
||||
// no queued import task, nothing to init
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->importTask = $nextImport;
|
||||
@ -89,15 +88,20 @@ class PodcastImport extends BaseCommand
|
||||
|
||||
ini_set('user_agent', 'Castopod/' . CP_VERSION);
|
||||
$this->podcastFeed = new PodcastFeed($this->importTask->feed_url);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function run(array $params): void
|
||||
{
|
||||
// FIXME: getting named routes doesn't work from v4.3 anymore, so loading all routes before importing
|
||||
Services::routes()->loadRoutes();
|
||||
service('routes')
|
||||
->loadRoutes();
|
||||
|
||||
try {
|
||||
$this->init();
|
||||
if (! $this->init()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CLI::write('All good! Feed was parsed successfully!');
|
||||
|
||||
@ -158,7 +162,7 @@ class PodcastImport extends BaseCommand
|
||||
|
||||
$podcastModel = new PodcastModel();
|
||||
if (! $podcastModel->update($this->podcast->id, $this->podcast)) {
|
||||
throw new Exception((string) print_r($podcastModel->errors()));
|
||||
throw new Exception(print_r($podcastModel->errors(), true));
|
||||
}
|
||||
|
||||
CLI::showProgress(false);
|
||||
@ -258,7 +262,7 @@ class PodcastImport extends BaseCommand
|
||||
$podcastModel = new PodcastModel();
|
||||
if (! ($podcastId = $podcastModel->insert($podcast, true))) {
|
||||
$db->transRollback();
|
||||
throw new Exception((string) print_r($podcastModel->errors()));
|
||||
throw new Exception(print_r($podcastModel->errors(), true));
|
||||
}
|
||||
|
||||
$podcast->id = $podcastId;
|
||||
@ -324,7 +328,7 @@ class PodcastImport extends BaseCommand
|
||||
]);
|
||||
|
||||
if (! $newPersonId = $personModel->insert($newPodcastPerson)) {
|
||||
throw new Exception((string) print_r($personModel->errors()));
|
||||
throw new Exception(print_r($personModel->errors(), true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,7 +355,7 @@ class PodcastImport extends BaseCommand
|
||||
$personGroupSlug,
|
||||
$personRoleSlug
|
||||
)) {
|
||||
throw new Exception((string) print_r($podcastPersonModel->errors()));
|
||||
throw new Exception(print_r($podcastPersonModel->errors(), true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -496,7 +500,7 @@ class PodcastImport extends BaseCommand
|
||||
|
||||
if (! ($episodeId = $episodeModel->insert($episode, true))) {
|
||||
$db->transRollback();
|
||||
throw new Exception((string) print_r($episodeModel->errors()));
|
||||
throw new Exception(print_r($episodeModel->errors(), true));
|
||||
}
|
||||
|
||||
$this->importEpisodePersons($episodeId, $item->podcast_persons);
|
||||
@ -544,7 +548,7 @@ class PodcastImport extends BaseCommand
|
||||
]);
|
||||
|
||||
if (! ($newPersonId = $personModel->insert($newPerson))) {
|
||||
throw new Exception((string) print_r($personModel->errors()));
|
||||
throw new Exception(print_r($personModel->errors(), true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -572,7 +576,7 @@ class PodcastImport extends BaseCommand
|
||||
$personGroupSlug,
|
||||
$personRoleSlug
|
||||
)) {
|
||||
throw new Exception((string) print_r($episodePersonModel->errors()));
|
||||
throw new Exception(print_r($episodePersonModel->errors(), true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ if (! function_exists('get_import_tasks')) {
|
||||
$podcastImportsQueue = service('settings')
|
||||
->get('Import.queue') ?? [];
|
||||
|
||||
if (! is_array($podcastImportsQueue)) {
|
||||
if ($podcastImportsQueue === []) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -48,6 +48,6 @@ if (! function_exists('get_import_tasks')) {
|
||||
return $a->created_at->isAfter($b->created_at) ? -1 : 1;
|
||||
});
|
||||
|
||||
return array_values($podcastImportsQueue);
|
||||
return $podcastImportsQueue;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ use RuntimeException;
|
||||
* @property string $token
|
||||
* @property string $status
|
||||
* @property string|null $status_message
|
||||
* @property Time $expires_at
|
||||
* @property Time|null $expires_at
|
||||
* @property int $downloads_last_3_months
|
||||
*
|
||||
* @property int $created_by
|
||||
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||
namespace Modules\Update\Commands;
|
||||
|
||||
use CodeIgniter\CLI\BaseCommand;
|
||||
use Config\Services;
|
||||
|
||||
class DatabaseUpdate extends BaseCommand
|
||||
{
|
||||
@ -26,7 +25,7 @@ class DatabaseUpdate extends BaseCommand
|
||||
|
||||
public function run(array $params): void
|
||||
{
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
102
package.json
102
package.json
@ -11,17 +11,15 @@
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"build": "tsc && vite build && pnpm run build:static",
|
||||
"serve": "vite preview",
|
||||
"build:static": "pnpm run build:icons && pnpm run build:svg",
|
||||
"build:icons": "svgo -f app/Resources/icons -o app/Resources/icons -r --config=./.svgo.icons.cjs",
|
||||
"build:svg": "svgo -f app/Resources/images -o public/assets/images -r --config=./.svgo.cjs",
|
||||
"lint": "eslint --ext js,ts app/Resources",
|
||||
"lint:fix": "eslint --ext js,ts app/Resources --fix",
|
||||
"lint:css": "stylelint -f verbose \"app/Resources/**/*.css\"",
|
||||
"lint:css:fix": "stylelint -f verbose --fix \"app/Resources/**/*.css\"",
|
||||
"prettier": "prettier --check .",
|
||||
"prettier:fix": "prettier --write .",
|
||||
"lint": "stylelint -f verbose --fix \"app/Resources/**/*.css\" && eslint",
|
||||
"lint:fix": "stylelint -f verbose --fix \"app/Resources/**/*.css\" && eslint --fix",
|
||||
"format": "prettier --check .",
|
||||
"format:fix": "prettier --write .",
|
||||
"typecheck": "tsc",
|
||||
"commit": "cz",
|
||||
"release": "semantic-release",
|
||||
@ -30,16 +28,16 @@
|
||||
"dependencies": {
|
||||
"@amcharts/amcharts4": "^4.10.39",
|
||||
"@amcharts/amcharts4-geodata": "^4.1.30",
|
||||
"@codemirror/commands": "^6.6.2",
|
||||
"@codemirror/commands": "^6.7.1",
|
||||
"@codemirror/lang-xml": "^6.1.0",
|
||||
"@codemirror/language": "^6.10.3",
|
||||
"@codemirror/state": "^6.4.1",
|
||||
"@codemirror/view": "^6.33.0",
|
||||
"@floating-ui/dom": "^1.6.11",
|
||||
"@codemirror/language": "^6.10.8",
|
||||
"@codemirror/state": "^6.5.0",
|
||||
"@codemirror/view": "^6.36.1",
|
||||
"@floating-ui/dom": "^1.6.13",
|
||||
"@github/clipboard-copy-element": "^1.3.0",
|
||||
"@github/hotkey": "^3.1.1",
|
||||
"@github/markdown-toolbar-element": "^2.2.3",
|
||||
"@github/relative-time-element": "^4.4.3",
|
||||
"@github/relative-time-element": "^4.4.4",
|
||||
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
|
||||
"@vime/core": "^5.4.1",
|
||||
"choices.js": "^10.2.0",
|
||||
@ -47,59 +45,69 @@
|
||||
"flatpickr": "^4.6.13",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet.markercluster": "^1.5.3",
|
||||
"lit": "^3.2.0",
|
||||
"marked": "^13.0.3",
|
||||
"wavesurfer.js": "^7.8.6",
|
||||
"lit": "^3.2.1",
|
||||
"marked": "^15.0.6",
|
||||
"wavesurfer.js": "^7.8.15",
|
||||
"xml-formatter": "^3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.5.0",
|
||||
"@commitlint/config-conventional": "^19.5.0",
|
||||
"@csstools/css-tokenizer": "^3.0.1",
|
||||
"@commitlint/cli": "^19.6.1",
|
||||
"@commitlint/config-conventional": "^19.6.0",
|
||||
"@csstools/css-tokenizer": "^3.0.3",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/gitlab": "^13.2.1",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"@types/leaflet": "^1.9.12",
|
||||
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
||||
"@typescript-eslint/parser": "^8.7.0",
|
||||
"@semantic-release/gitlab": "^13.2.3",
|
||||
"@tailwindcss/forms": "^0.5.10",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@types/leaflet": "^1.9.16",
|
||||
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
||||
"@typescript-eslint/parser": "^8.19.1",
|
||||
"all-contributors-cli": "^6.26.1",
|
||||
"commitizen": "^4.3.0",
|
||||
"commitizen": "^4.3.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"cssnano": "^7.0.6",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"husky": "^9.1.6",
|
||||
"is-ci": "^3.0.1",
|
||||
"lint-staged": "^15.2.10",
|
||||
"postcss": "^8.4.47",
|
||||
"globals": "^15.14.0",
|
||||
"husky": "^9.1.7",
|
||||
"is-ci": "^4.1.0",
|
||||
"lint-staged": "^15.3.0",
|
||||
"postcss": "^8.4.49",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-nesting": "^13.0.0",
|
||||
"postcss-preset-env": "^10.0.5",
|
||||
"postcss-nesting": "^13.0.1",
|
||||
"postcss-preset-env": "^10.1.3",
|
||||
"postcss-reporter": "^7.1.0",
|
||||
"prettier": "3.3.3",
|
||||
"prettier": "3.4.2",
|
||||
"prettier-plugin-organize-imports": "^4.1.0",
|
||||
"semantic-release": "^24.1.1",
|
||||
"stylelint": "^16.9.0",
|
||||
"semantic-release": "^24.2.1",
|
||||
"stylelint": "^16.12.0",
|
||||
"stylelint-config-standard": "^36.0.1",
|
||||
"svgo": "^3.3.2",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"typescript": "~5.5.4",
|
||||
"vite": "^5.4.7",
|
||||
"vite-plugin-pwa": "^0.20.5",
|
||||
"workbox-build": "^7.1.1",
|
||||
"workbox-core": "^7.1.0",
|
||||
"workbox-routing": "^7.1.0",
|
||||
"workbox-strategies": "^7.1.0"
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "~5.7.2",
|
||||
"typescript-eslint": "^8.19.1",
|
||||
"vite": "^6.0.7",
|
||||
"vite-plugin-pwa": "^0.21.1",
|
||||
"workbox-build": "^7.3.0",
|
||||
"workbox-core": "^7.3.0",
|
||||
"workbox-routing": "^7.3.0",
|
||||
"workbox-strategies": "^7.3.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,ts,css,md,json}": "prettier --write",
|
||||
"*.{ts,js}": "eslint --ext js,ts,tsx app/Resources --fix",
|
||||
"*.css": "stylelint --fix"
|
||||
"*.{ts,js}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.css": [
|
||||
"stylelint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"!(*.css|*.js|*.ts|*.php|*.neon|*.sh)": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
|
@ -45,6 +45,8 @@ parameters:
|
||||
- Modules\Media\Config\Services
|
||||
- Modules\Platforms\Config\Services
|
||||
- Modules\PremiumPodcasts\Config\Services
|
||||
- Modules\Api\Rest\V1\Config\Services
|
||||
ignoreErrors:
|
||||
- '#^Call to an undefined method CodeIgniter\\Cache\\CacheInterface\:\:deleteMatching\(\)#'
|
||||
- identifier: missingType.generics
|
||||
- identifier: missingType.generics
|
||||
- identifier: property.readOnlyByPhpDocDefaultValue
|
||||
|
3339
pnpm-lock.yaml
generated
3339
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -6,4 +6,3 @@ composer install --no-dev --prefer-dist --no-ansi --no-interaction --no-progress
|
||||
|
||||
# build all production static assets (css, js, images, icons, fonts, etc.)
|
||||
pnpm run build
|
||||
pnpm run build:static
|
||||
|
@ -45,6 +45,7 @@ class ExampleDatabaseTest extends CIUnitTestCase
|
||||
$model->delete($object->id);
|
||||
|
||||
// The model should no longer find it
|
||||
// @phpstan-ignore-next-line
|
||||
$this->assertNull($model->find($object->id));
|
||||
|
||||
// ... but it should still be in the database
|
||||
|
@ -5,13 +5,12 @@ declare(strict_types=1);
|
||||
namespace Tests\Session;
|
||||
|
||||
use CodeIgniter\Test\CIUnitTestCase;
|
||||
use Config\Services;
|
||||
|
||||
class ExampleSessionTest extends CIUnitTestCase
|
||||
{
|
||||
public function testSessionSimple(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$session->set('logged_in', 123);
|
||||
$this->assertSame(123, $session->get('logged_in'));
|
||||
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
use CodeIgniter\Test\CIUnitTestCase;
|
||||
use Config\App;
|
||||
use Config\Services;
|
||||
use Tests\Support\Libraries\ConfigReader;
|
||||
|
||||
/**
|
||||
@ -19,7 +18,7 @@ final class HealthTest extends CIUnitTestCase
|
||||
|
||||
public function testBaseUrlHasBeenSet(): void
|
||||
{
|
||||
$validation = Services::validation();
|
||||
$validation = service('validation');
|
||||
|
||||
$env = false;
|
||||
|
||||
|
@ -39,7 +39,7 @@ $isEpisodeArea = isset($podcast) && isset($episode);
|
||||
<div class="flex flex-wrap items-center truncate">
|
||||
<?php if (($isEpisodeArea && $episode->is_premium) || ($isPodcastArea && $podcast->is_premium)): ?>
|
||||
<div class="inline-flex items-center">
|
||||
<?php // @icon('exchange-dollar-fill')?>
|
||||
<?php // @icon("exchange-dollar-fill")?>
|
||||
<IconButton uri="<?= route_to('subscription-list', $podcast->id) ?>" glyph="exchange-dollar-fill" variant="secondary" size="large" class="p-0 mr-2 border-0"><?= ($isEpisodeArea && $episode->is_premium) ? lang('PremiumPodcasts.episode_is_premium') : lang('PremiumPodcasts.podcast_is_premium') ?></IconButton>
|
||||
<Heading tagName="h1" size="large" class="truncate"><?= $this->renderSection('pageTitle') ?></Heading>
|
||||
</div>
|
||||
|
@ -7,11 +7,11 @@ use Modules\Auth\Models\UserModel;
|
||||
|
||||
$navigation = [
|
||||
'dashboard' => [
|
||||
'icon' => 'dashboard-fill', // @icon('dashboard-fill')
|
||||
'icon' => 'dashboard-fill', // @icon("dashboard-fill")
|
||||
'items' => ['admin'],
|
||||
],
|
||||
'podcasts' => [
|
||||
'icon' => 'mic-fill', // @icon('mic-fill')
|
||||
'icon' => 'mic-fill', // @icon("mic-fill")
|
||||
'items' => ['podcast-list', 'podcast-create', 'all-podcast-imports', 'podcast-imports-add'],
|
||||
'items-permissions' => [
|
||||
'podcast-create' => 'podcasts.create',
|
||||
@ -22,7 +22,7 @@ $navigation = [
|
||||
'count-route' => 'podcast-list',
|
||||
],
|
||||
'persons' => [
|
||||
'icon' => 'folder-user-fill', // @icon('folder-user-fill')
|
||||
'icon' => 'folder-user-fill', // @icon("folder-user-fill")
|
||||
'items' => ['person-list', 'person-create'],
|
||||
'items-permissions' => [
|
||||
'person-list' => 'persons.manage',
|
||||
@ -33,7 +33,7 @@ $navigation = [
|
||||
'count-route' => 'person-list',
|
||||
],
|
||||
'fediverse' => [
|
||||
'icon' => 'rocket-2-fill', // @icon('rocket-2-fill')
|
||||
'icon' => 'rocket-2-fill', // @icon("rocket-2-fill")
|
||||
'items' => ['fediverse-blocked-actors', 'fediverse-blocked-domains'],
|
||||
'items-permissions' => [
|
||||
'fediverse-blocked-actors' => 'fediverse.manage-blocks',
|
||||
@ -41,7 +41,7 @@ $navigation = [
|
||||
],
|
||||
],
|
||||
'users' => [
|
||||
'icon' => 'group-fill', // @icon('group-fill')
|
||||
'icon' => 'group-fill', // @icon("group-fill")
|
||||
'items' => ['user-list', 'user-create'],
|
||||
'items-permissions' => [
|
||||
'user-list' => 'users.manage',
|
||||
@ -52,7 +52,7 @@ $navigation = [
|
||||
'count-route' => 'user-list',
|
||||
],
|
||||
'pages' => [
|
||||
'icon' => 'pages-fill', // @icon('pages-fill')
|
||||
'icon' => 'pages-fill', // @icon("pages-fill")
|
||||
'items' => ['page-list', 'page-create'],
|
||||
'items-permissions' => [
|
||||
'page-list' => 'pages.manage',
|
||||
@ -63,7 +63,7 @@ $navigation = [
|
||||
'count-route' => 'page-list',
|
||||
],
|
||||
'settings' => [
|
||||
'icon' => 'settings-3-fill', // @icon('settings-3-fill')
|
||||
'icon' => 'settings-3-fill', // @icon("settings-3-fill")
|
||||
'items' => ['settings-general', 'settings-theme', 'admin-about'],
|
||||
'items-permissions' => [
|
||||
'settings-general' => 'admin.settings',
|
||||
|
@ -9,7 +9,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button uri="<?= route_to('contributor-add', $podcast->id) ?>" variant="primary" iconLeft="add-fill"><?= lang('Contributor.add') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -39,8 +39,8 @@
|
||||
[
|
||||
'header' => lang('Common.actions'),
|
||||
'cell' => function ($contributor, $podcast) {
|
||||
// @icon('pencil-fill')
|
||||
// @icon('delete-bin-fill')
|
||||
// @icon("pencil-fill")
|
||||
// @icon("delete-bin-fill")
|
||||
return '<Button uri="' . route_to('contributor-edit', $podcast->id, $contributor->id) . '" variant="secondary" iconLeft="pencil-fill" size="small">' . lang('Contributor.edit') . '</Button>' .
|
||||
'<Button uri="' . route_to('contributor-remove', $podcast->id, $contributor->id) . '" variant="danger" iconLeft="delete-bin-fill" size="small">' . lang('Contributor.remove') . '</Button>';
|
||||
},
|
||||
|
@ -12,15 +12,15 @@
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<div class="flex flex-col items-stretch gap-4 lg:flex-row">
|
||||
<?php // @icon('mic-fill')?>
|
||||
<?php // @icon("mic-fill")?>
|
||||
<DashboardCard href="<?= $onlyPodcastId === null ? route_to('podcast-list') : route_to('podcast-view', $onlyPodcastId) ?>" glyph="mic-fill" title="<?= lang('Dashboard.podcasts.title') ?>" subtitle="<?= $podcastsData['last_published_at'] ? esc(lang('Dashboard.podcasts.last_published', [
|
||||
'lastPublicationDate' => local_date($podcastsData['last_published_at']),
|
||||
], null, false)) : lang('Dashboard.podcasts.not_found') ?>"><?= $podcastsData['number_of_podcasts'] ?></DashboardCard>
|
||||
<?php // @icon('play-fill')?>
|
||||
<?php // @icon("play-fill")?>
|
||||
<DashboardCard href="<?= $onlyPodcastId === null ? '' : route_to('episode-list', $onlyPodcastId) ?>" glyph="play-fill" title="<?= lang('Dashboard.episodes.title') ?>" subtitle="<?= $episodesData['last_published_at'] ? esc(lang('Dashboard.episodes.last_published', [
|
||||
'lastPublicationDate' => local_date($episodesData['last_published_at']),
|
||||
], null, false)) : lang('Dashboard.episodes.not_found') ?>"><?= $episodesData['number_of_episodes'] ?></DashboardCard>
|
||||
<?php // @icon('database-2-fill')?>
|
||||
<?php // @icon("database-2-fill")?>
|
||||
<DashboardCard glyph="database-2-fill" title="<?= lang('Dashboard.storage.title') ?>" subtitle="<?= lang('Dashboard.storage.subtitle', [
|
||||
'totalUploaded' => $storageData['total_uploaded'],
|
||||
'totalStorage' => $storageData['limit'],
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
$episodeNavigation = [
|
||||
'dashboard' => [
|
||||
'icon' => 'dashboard-fill', // @icon('dashboard-fill')
|
||||
'icon' => 'dashboard-fill', // @icon("dashboard-fill")
|
||||
'items' => ['episode-view', 'episode-edit', 'episode-persons-manage', 'embed-add'],
|
||||
'items-permissions' => [
|
||||
'episode-view' => 'episodes.view',
|
||||
@ -12,7 +12,7 @@ $episodeNavigation = [
|
||||
],
|
||||
],
|
||||
'clips' => [
|
||||
'icon' => 'clapperboard-fill', // @icon('clapperboard-fill')
|
||||
'icon' => 'clapperboard-fill', // @icon("clapperboard-fill")
|
||||
'items' => ['video-clips-list', 'video-clips-create', 'soundbites-list', 'soundbites-create'],
|
||||
'items-permissions' => [
|
||||
'video-clips-list' => 'episodes.manage-clips',
|
||||
|
@ -288,10 +288,10 @@
|
||||
</form>
|
||||
|
||||
<?php if ($episode->published_at === null): ?>
|
||||
<?php // @icon('delete-bin-fill')?>
|
||||
<?php // @icon("delete-bin-fill")?>
|
||||
<Button class="mt-8" variant="danger" uri="<?= route_to('episode-delete', $podcast->id, $episode->id) ?>" iconLeft="delete-bin-fill"><?= lang('Episode.delete') ?></Button>
|
||||
<?php else: ?>
|
||||
<?php // @icon('forbid-fill')?>
|
||||
<?php // @icon("forbid-fill")?>
|
||||
<Button class="mt-8" variant="disabled" iconLeft="forbid-fill" data-tooltip="right" title="<?= lang('Episode.messages.unpublishBeforeDeleteTip') ?>"><?= lang('Episode.delete') ?></Button>
|
||||
<?php endif ?>
|
||||
|
||||
|
@ -34,13 +34,13 @@ $embedHeight = config('Embed')->height;
|
||||
|
||||
<div class="flex items-center mt-8 gap-x-2">
|
||||
<Forms.Textarea readonly="true" class="w-full max-w-xl" name="iframe" rows="2" value="<?= esc("<iframe width=\"100%\" height=\"{$embedHeight}\" frameborder=\"0\" scrolling=\"no\" style=\"width: 100%; height: {$embedHeight}px; overflow: hidden;\" src=\"{$episode->embed_url}\"></iframe>") ?>" />
|
||||
<?php // @icon('file-copy-fill')?>
|
||||
<?php // @icon("file-copy-fill")?>
|
||||
<IconButton glyph="file-copy-fill" data-type="clipboard-copy" data-clipboard-target="iframe"><?= lang('Episode.embed.clipboard_iframe') ?></IconButton>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mt-4 gap-x-2">
|
||||
<Forms.Input readonly="true" class="w-full max-w-xl" name="url" value="<?= esc($episode->embed_url) ?>" />
|
||||
<?php // @icon('file-copy-fill')?>
|
||||
<?php // @icon("file-copy-fill")?>
|
||||
<IconButton glyph="file-copy-fill" data-type="clipboard-copy" data-clipboard-target="url"><?= lang('Episode.embed.clipboard_url') ?></IconButton>
|
||||
</div>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button uri="<?= route_to('episode-create', $podcast->id) ?>" variant="primary" iconLeft="add-fill"><?= lang('Episode.create') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button variant="primary" uri="<?= route_to('person-create') ?>" iconLeft="add-fill"><?= lang('Person.create') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
[
|
||||
'header' => lang('Common.actions'),
|
||||
'cell' => function ($person): string {
|
||||
// @icon('delete-bin-fill')
|
||||
// @icon("delete-bin-fill")
|
||||
return '<Button uri="' . route_to('episode-person-remove', $person->podcast_id, $person->episode_id, $person->id) . '" variant="danger" size="small" iconLeft="delete-bin-fill">' . lang('Person.episode_form.remove') . '</Button>';
|
||||
},
|
||||
],
|
||||
|
@ -9,7 +9,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button uri="<?= route_to('soundbites-create', $podcast->id, $episode->id) ?>" variant="primary" iconLeft="add-fill"><?= lang('Soundbite.create') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
<input slot="duration" type="number" name="duration" placeholder="<?= lang('VideoClip.form.duration') ?>" step="0.001" />
|
||||
</audio-clipper>
|
||||
|
||||
<?php // @icon('arrow-right-fill')?>
|
||||
<?php // @icon("arrow-right-fill")?>
|
||||
<Button variant="primary" type="submit" class="self-end mt-4" iconRight="arrow-right-fill"><?= lang('Soundbite.form.submit') ?></Button>
|
||||
|
||||
</form>
|
||||
|
@ -15,7 +15,7 @@ use CodeIgniter\I18n\Time;
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button uri="<?= route_to('video-clips-create', $podcast->id, $episode->id) ?>" variant="primary" iconLeft="add-fill"><?= lang('VideoClip.create') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -35,12 +35,12 @@ use CodeIgniter\I18n\Time;
|
||||
];
|
||||
|
||||
$pillIconMap = [
|
||||
'queued' => 'timer-fill', // @icon('timer-fill')
|
||||
'pending' => 'pause-fill', // @icon('pause-fill')
|
||||
'running' => 'loader-fill', // @icon('loader-fill')
|
||||
'canceled' => 'forbid-fill', // @icon('forbid-fill')
|
||||
'failed' => 'close-fill', // @icon('close-fill')
|
||||
'passed' => 'check-fill', // @icon('check-fill')
|
||||
'queued' => 'timer-fill', // @icon("timer-fill")
|
||||
'pending' => 'pause-fill', // @icon("pause-fill")
|
||||
'running' => 'loader-fill', // @icon("loader-fill")
|
||||
'canceled' => 'forbid-fill', // @icon("forbid-fill")
|
||||
'failed' => 'close-fill', // @icon("close-fill")
|
||||
'passed' => 'check-fill', // @icon("check-fill")
|
||||
];
|
||||
|
||||
$pillIconClassMap = [
|
||||
@ -97,7 +97,7 @@ use CodeIgniter\I18n\Time;
|
||||
if ($videoClip->media) {
|
||||
helper('misc');
|
||||
$filename = 'clip-' . slugify($videoClip->title) . "-{$videoClip->start_time}-{$videoClip->end_time}";
|
||||
// @icon('import-fill')
|
||||
// @icon("import-fill")
|
||||
$downloadButton = '<IconButton glyph="import-fill" uri="' . $videoClip->media->file_url . '" download="' . $filename . '">' . lang('VideoClip.download_clip') . '</IconButton>';
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
</Forms.Section>
|
||||
<?php // @icon('arrow-right-fill')?>
|
||||
<?php // @icon("arrow-right-fill")?>
|
||||
<Button variant="primary" type="submit" iconRight="arrow-right-fill" class="self-end"><?= lang('VideoClip.form.submit') ?></Button>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php if ($episode->publication_status === 'published'): ?>
|
||||
<?php // @icon('history-fill')?>
|
||||
<?php // @icon("history-fill")?>
|
||||
<IconButton
|
||||
uri="<?= route_to('episode-publish_date_edit', $podcast->id, $episode->id) ?>"
|
||||
glyph="history-fill"
|
||||
|
@ -21,12 +21,12 @@ use Modules\PodcastImport\Entities\TaskStatus;
|
||||
];
|
||||
|
||||
$pillIconMap = [
|
||||
'queued' => 'timer-fill', // @icon('timer-fill')
|
||||
'pending' => 'pause-fill', // @icon('pause-fill')
|
||||
'running' => 'loader-fill', // @icon('loader-fill')
|
||||
'canceled' => 'forbid-fill', // @icon('forbid-fill')
|
||||
'failed' => 'close-fill', // @icon('close-fill')
|
||||
'passed' => 'check-fill', // @icon('check-fill')
|
||||
'queued' => 'timer-fill', // @icon("timer-fill")
|
||||
'pending' => 'pause-fill', // @icon("pause-fill")
|
||||
'running' => 'loader-fill', // @icon("loader-fill")
|
||||
'canceled' => 'forbid-fill', // @icon("forbid-fill")
|
||||
'failed' => 'close-fill', // @icon("close-fill")
|
||||
'passed' => 'check-fill', // @icon("check-fill")
|
||||
];
|
||||
|
||||
$pillIconClassMap = [
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
<Forms.Section
|
||||
title="<?= lang('PodcastImport.old_podcast_section_title') ?>">
|
||||
<?php // @icon('scales-3-fill')?>
|
||||
<?php // @icon("scales-3-fill")?>
|
||||
<Alert glyph="scales-3-fill" variant="info" title="<?= lang('PodcastImport.old_podcast_legal_disclaimer_title') ?>"><?= lang('PodcastImport.old_podcast_legal_disclaimer') ?></Alert>
|
||||
<Forms.Field
|
||||
name="imported_feed_url"
|
||||
|
@ -9,7 +9,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('loop-left-fill')?>
|
||||
<?php // @icon("loop-left-fill")?>
|
||||
<Button uri="<?= route_to('podcast-imports-sync', $podcast->id) ?>" variant="primary" iconLeft="loop-left-fill"><?= lang('PodcastImport.syncForm.title') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button uri="<?= route_to('podcast-imports-add') ?>" variant="primary" iconLeft="add-fill"><?= lang('Podcast.import') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('headerRight') ?>
|
||||
<?php // @icon('add-fill')?>
|
||||
<?php // @icon("add-fill")?>
|
||||
<Button uri="<?= route_to('page-create') ?>" variant="primary" iconLeft="add-fill"><?= lang('Page.create') ?></Button>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user