2021-04-14 17:58:40 +02:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 11:52:11 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-08-23 13:05:16 +02:00
|
|
|
namespace Modules\Analytics\Config;
|
2021-04-14 17:58:40 +02:00
|
|
|
|
2021-08-23 13:05:16 +02:00
|
|
|
use CodeIgniter\Config\BaseConfig;
|
2021-04-14 17:58:40 +02:00
|
|
|
|
2021-08-23 13:05:16 +02:00
|
|
|
class Analytics extends BaseConfig
|
2021-04-14 17:58:40 +02:00
|
|
|
{
|
2021-08-23 13:05:16 +02:00
|
|
|
/**
|
|
|
|
* Gateway to analytic routes. By default, all analytics routes will be under `/analytics` path
|
|
|
|
*/
|
|
|
|
public string $gateway = 'analytics';
|
|
|
|
|
2021-04-14 17:58:40 +02:00
|
|
|
/**
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
* Route filters options
|
|
|
|
* --------------------------------------------------------------------
|
2021-08-23 13:05:16 +02:00
|
|
|
* @var array<string, string>
|
2021-04-14 17:58:40 +02:00
|
|
|
*/
|
2021-05-18 19:16:36 +02:00
|
|
|
public array $routeFilters = [
|
2021-04-14 17:58:40 +02:00
|
|
|
'analytics-full-data' => 'permission:podcasts-view,podcast-view',
|
|
|
|
'analytics-data' => 'permission:podcasts-view,podcast-view',
|
|
|
|
'analytics-filtered-data' => 'permission:podcasts-view,podcast-view',
|
|
|
|
];
|
|
|
|
|
2022-03-30 18:09:06 +02:00
|
|
|
/**
|
|
|
|
* --------------------------------------------------------------------------
|
|
|
|
* Secret Salt
|
|
|
|
* --------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* The secret salt is a string of random characters that is used when hashing data.
|
|
|
|
* Each Castopod instance has its own secret salt so keys will never be the same.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* Z&|qECKBrwgaaD>~;U/tXG1U%tSe_oi5Tzy)h>}5NC2npSrjvM0w_Q>cs=0o=H]*
|
|
|
|
*/
|
|
|
|
public string $salt = '';
|
|
|
|
|
2021-05-06 16:00:48 +02:00
|
|
|
/**
|
|
|
|
* get the full audio file url
|
2021-05-12 16:00:25 +02:00
|
|
|
*
|
2022-01-21 09:52:28 +01:00
|
|
|
* @param string|string[] $audioPath
|
2021-05-06 16:00:48 +02:00
|
|
|
*/
|
2022-01-21 09:52:28 +01:00
|
|
|
public function getAudioUrl(string | array $audioPath): string
|
2021-04-14 17:58:40 +02:00
|
|
|
{
|
|
|
|
helper('media');
|
|
|
|
|
2022-01-21 09:52:28 +01:00
|
|
|
return media_base_url($audioPath);
|
2021-04-14 17:58:40 +02:00
|
|
|
}
|
|
|
|
}
|