HummingBirdAnimeClient/src/AnimeClient/Types/Config.php

133 lines
3.0 KiB
PHP
Raw Normal View History

<?php declare(strict_types=1);
/**
* Hummingbird Anime List Client
*
* An API client for Kitsu to manage anime and manga watch lists
*
* PHP version 7.4
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren <tim@timshomepage.net>
2020-01-08 15:39:49 -05:00
* @copyright 2015 - 2020 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
2020-08-04 09:30:21 -04:00
* @version 5.1
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
*/
namespace Aviat\AnimeClient\Types;
class Config extends AbstractType {
2019-12-09 13:13:31 -05:00
// ------------------------------------------------------------------------
// Config files/namespaces
2019-12-09 13:13:31 -05:00
// ------------------------------------------------------------------------
2020-04-28 12:24:12 -04:00
public ?Config\Anilist $anilist;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?Config\Cache $cache;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?Config\Database $database;
2019-12-09 13:13:31 -05:00
// ------------------------------------------------------------------------
// Settings in config.toml
2019-12-09 13:13:31 -05:00
// ------------------------------------------------------------------------
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
/**
* @deprecated Use 'theme' instead
* @var bool
*/
public $dark_theme; /* Deprecated */
2019-12-09 13:13:31 -05:00
/**
* @var string The PHP timezone
*/
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
*/
2020-04-28 12:24:12 -04:00
public ?string $default_anime_list_path;
2019-12-09 13:13:31 -05:00
/**
* The list to redirect to from the root url
*
* @var 'anime' | 'manga'
*/
2020-04-28 12:24:12 -04: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
*/
2020-04-28 12:24:12 -04:00
public ?string $default_manga_list_path;
2019-12-09 13:13:31 -05:00
/**
* @var 'cover_view' | 'list_view'
*/
2020-04-28 12:24:12 -04:00
public ?string $default_view_type;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $kitsu_username;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public bool $secure_urls = TRUE;
2019-12-09 13:13:31 -05:00
2020-12-10 15:59:37 -05:00
public bool $show_anime_collection = FALSE;
2019-12-09 13:13:31 -05:00
2020-12-10 15:59:37 -05:00
public bool $show_manga_collection = FALSE;
2019-12-09 13:13:31 -05:00
/**
* CSS theme: light, dark, or auto-switching
*
* @var 'auto' | 'light' | 'dark'
*/
2020-04-28 12:24:12 -04:00
public ?string $theme;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $whose_list;
2019-12-09 13:13:31 -05:00
// ------------------------------------------------------------------------
// Application config
2019-12-09 13:13:31 -05:00
// ------------------------------------------------------------------------
/**
* @var array
*/
2020-04-28 12:24:12 -04:00
public array $menus;
2019-12-09 13:13:31 -05:00
/**
* @var array
*/
2020-04-28 12:24:12 -04:00
public array $routes;
2019-12-09 13:13:31 -05: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
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $base_config_dir;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $config_dir;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $data_cache_path;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $img_cache_path;
2019-12-09 13:13:31 -05:00
2020-04-28 12:24:12 -04:00
public ?string $view_path;
public function setAnilist ($data): void
{
$this->anilist = Config\Anilist::from($data);
}
public function setCache ($data): void
{
$this->cache = Config\Cache::from($data);
}
public function setDatabase ($data): void
{
$this->database = Config\Database::from($data);
}
}