2018-08-24 14:36:58 -04:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
/**
|
|
|
|
* Hummingbird Anime List Client
|
|
|
|
*
|
|
|
|
* An API client for Kitsu to manage anime and manga watch lists
|
|
|
|
*
|
2023-07-13 11:08:05 -04:00
|
|
|
* PHP version 8.1
|
2018-08-24 14:36:58 -04:00
|
|
|
*
|
2023-07-13 11:08:05 -04:00
|
|
|
* @copyright 2015 - 2023 Timothy J. Warren <tim@timshome.page>
|
2018-08-24 14:36:58 -04:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
2020-12-10 17:06:50 -05:00
|
|
|
* @version 5.2
|
2023-07-13 11:08:05 -04:00
|
|
|
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
|
2018-08-24 14:36:58 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient\Types;
|
|
|
|
|
2022-03-03 17:26:09 -05:00
|
|
|
class Config extends AbstractType
|
|
|
|
{
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
2018-08-24 14:36:58 -04:00
|
|
|
// Config files/namespaces
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
2020-04-28 12:24:12 -04:00
|
|
|
public ?Config\Anilist $anilist;
|
|
|
|
public ?Config\Cache $cache;
|
|
|
|
public ?Config\Database $database;
|
2018-08-24 14:36:58 -04:00
|
|
|
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
2018-08-24 14:36:58 -04:00
|
|
|
// Settings in config.toml
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
2021-02-23 15:38:29 -05:00
|
|
|
public string $root; // Path to app root
|
2020-04-28 12:24:12 -04:00
|
|
|
public ?string $asset_path; // Path to public folder for urls
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
2020-12-11 14:26:54 -05:00
|
|
|
* The PHP timezone
|
2020-04-22 11:39:44 -04:00
|
|
|
*/
|
|
|
|
public string $timezone = '';
|
|
|
|
|
2019-12-09 13:13:31 -05:00
|
|
|
/**
|
|
|
|
* Default Anime list status page, values are listed in
|
|
|
|
* Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Title
|
|
|
|
*/
|
2022-03-03 13:52:06 -05:00
|
|
|
public ?string $default_anime_list_path;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The list to redirect to from the root url
|
2021-02-10 17:17:51 -05:00
|
|
|
* 'anime' or 'manga'
|
2019-12-09 13:13:31 -05:00
|
|
|
*/
|
2022-03-03 13:52:06 -05:00
|
|
|
public ?string $default_list;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default Manga list status page, values are listed in
|
|
|
|
* Aviat\AnimeClient\API\Enum\MangaReadingStatus\Title
|
|
|
|
*/
|
2022-03-03 13:52:06 -05:00
|
|
|
public ?string $default_manga_list_path;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
2021-02-10 17:17:51 -05:00
|
|
|
* Default list view type
|
|
|
|
* 'cover_view' or 'list_view'
|
2019-12-09 13:13:31 -05:00
|
|
|
*/
|
2022-03-03 13:52:06 -05:00
|
|
|
public ?string $default_view_type;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
2022-03-03 13:52:06 -05:00
|
|
|
public ?string $kitsu_username;
|
2020-04-28 12:24:12 -04:00
|
|
|
public bool $secure_urls = TRUE;
|
2021-02-10 17:17:51 -05:00
|
|
|
public string|bool $show_anime_collection = FALSE;
|
|
|
|
public string|bool $show_manga_collection = FALSE;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CSS theme: light, dark, or auto-switching
|
2021-02-10 17:17:51 -05:00
|
|
|
* 'auto', 'light', or 'dark'
|
2019-12-09 13:13:31 -05:00
|
|
|
*/
|
2020-12-11 14:26:54 -05:00
|
|
|
public ?string $theme = 'auto';
|
2019-12-09 13:13:31 -05:00
|
|
|
|
2020-04-28 12:24:12 -04:00
|
|
|
public ?string $whose_list;
|
2022-03-03 14:20:10 -05:00
|
|
|
public array $menus = [];
|
|
|
|
public array $routes = [];
|
2018-08-24 14:36:58 -04:00
|
|
|
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
2018-08-24 14:36:58 -04:00
|
|
|
// Generated config values
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
2020-04-28 12:24:12 -04:00
|
|
|
public ?string $asset_dir; // Path to public folder for local files
|
|
|
|
public ?string $base_config_dir;
|
|
|
|
public ?string $config_dir;
|
|
|
|
public ?string $data_cache_path;
|
|
|
|
public ?string $img_cache_path;
|
|
|
|
public ?string $view_path;
|
2018-08-24 14:36:58 -04:00
|
|
|
|
2022-03-03 17:26:09 -05:00
|
|
|
public function setAnilist(mixed $data): void
|
2018-08-24 14:36:58 -04:00
|
|
|
{
|
2020-04-22 07:53:52 -04:00
|
|
|
$this->anilist = Config\Anilist::from($data);
|
2018-08-24 14:36:58 -04:00
|
|
|
}
|
|
|
|
|
2022-03-03 17:26:09 -05:00
|
|
|
public function setCache(mixed $data): void
|
2018-08-24 14:36:58 -04:00
|
|
|
{
|
2020-04-22 07:53:52 -04:00
|
|
|
$this->cache = Config\Cache::from($data);
|
2018-08-24 14:36:58 -04:00
|
|
|
}
|
|
|
|
|
2022-03-03 17:26:09 -05:00
|
|
|
public function setDatabase(mixed $data): void
|
2018-08-24 14:36:58 -04:00
|
|
|
{
|
2020-04-22 07:53:52 -04:00
|
|
|
$this->database = Config\Database::from($data);
|
2018-08-24 14:36:58 -04:00
|
|
|
}
|
2022-03-03 17:26:09 -05:00
|
|
|
}
|