2021-04-14 15:58:40 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
namespace Modules\Analytics\Config;
|
2021-04-14 15:58:40 +00:00
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
use CodeIgniter\Config\BaseConfig;
|
2021-04-14 15:58:40 +00:00
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
class Analytics extends BaseConfig
|
2021-04-14 15:58:40 +00:00
|
|
|
{
|
2021-08-23 11:05:16 +00:00
|
|
|
/**
|
|
|
|
* Gateway to analytic routes. By default, all analytics routes will be under `/analytics` path
|
|
|
|
*/
|
|
|
|
public string $gateway = 'analytics';
|
|
|
|
|
2021-04-14 15:58:40 +00:00
|
|
|
/**
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
* Route filters options
|
|
|
|
* --------------------------------------------------------------------
|
2021-08-23 11:05:16 +00:00
|
|
|
* @var array<string, string>
|
2021-04-14 15:58:40 +00:00
|
|
|
*/
|
2021-05-18 17:16:36 +00:00
|
|
|
public array $routeFilters = [
|
2021-04-14 15:58:40 +00:00
|
|
|
'analytics-full-data' => 'permission:podcasts-view,podcast-view',
|
|
|
|
'analytics-data' => 'permission:podcasts-view,podcast-view',
|
|
|
|
'analytics-filtered-data' => 'permission:podcasts-view,podcast-view',
|
|
|
|
];
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
/**
|
|
|
|
* get the full audio file url
|
2021-05-12 14:00:25 +00:00
|
|
|
*
|
|
|
|
* @param string|string[] $audioFilePath
|
2021-05-06 14:00:48 +00:00
|
|
|
*/
|
2021-08-11 15:47:23 +00:00
|
|
|
public function getAudioFileUrl(string|array $audioFilePath): string
|
2021-04-14 15:58:40 +00:00
|
|
|
{
|
|
|
|
helper('media');
|
|
|
|
|
2021-05-03 17:39:58 +00:00
|
|
|
return media_base_url($audioFilePath);
|
2021-04-14 15:58:40 +00:00
|
|
|
}
|
|
|
|
}
|