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
|
|
|
|
*
|
2019-12-03 15:17:25 -05:00
|
|
|
* PHP version 7.2
|
2018-08-24 14:36:58 -04:00
|
|
|
*
|
|
|
|
* @package HummingbirdAnimeClient
|
|
|
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
2019-12-06 09:16:35 -05:00
|
|
|
* @copyright 2015 - 2019 Timothy J. Warren
|
2018-08-24 14:36:58 -04:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
2019-12-06 09:16:35 -05:00
|
|
|
* @version 4.2
|
2018-08-24 14:36:58 -04:00
|
|
|
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient\Types;
|
|
|
|
|
|
|
|
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
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Config\Anilist
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $anilist;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Config\Cache
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $cache;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Config\Database
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $database;
|
|
|
|
|
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
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-10-05 14:32:05 -04:00
|
|
|
public $asset_path; // Path to public folder for urls
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated Use 'theme' instead
|
|
|
|
* @var bool
|
|
|
|
*/
|
2019-07-12 15:56:24 -04:00
|
|
|
public $dark_theme; /* Deprecated */
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default Anime list status page, values are listed in
|
|
|
|
* Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\Title
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-10-05 14:32:05 -04:00
|
|
|
public $default_anime_list_path;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The list to redirect to from the root url
|
|
|
|
*
|
|
|
|
* @var 'anime' | 'manga'
|
|
|
|
*/
|
2018-10-05 14:32:05 -04:00
|
|
|
public $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
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-10-05 14:32:05 -04:00
|
|
|
public $default_manga_list_path;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var 'cover_view' | 'list_view'
|
|
|
|
*/
|
2018-10-05 14:32:05 -04:00
|
|
|
public $default_view_type;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $kitsu_username;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2018-10-11 09:53:14 -04:00
|
|
|
public $secure_urls = TRUE;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $show_anime_collection;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
public $show_manga_collection = FALSE;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CSS theme: light, dark, or auto-switching
|
|
|
|
*
|
|
|
|
* @var 'auto' | 'light' | 'dark'
|
|
|
|
*/
|
2019-07-12 15:56:24 -04:00
|
|
|
public $theme;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $whose_list;
|
|
|
|
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
2018-08-24 14:36:58 -04:00
|
|
|
// Application config
|
2019-12-09 13:13:31 -05:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $menus;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $routes;
|
|
|
|
|
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
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-10-05 14:32:05 -04:00
|
|
|
public $asset_dir; // Path to public folder for local files
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $base_config_dir;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $config_dir;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $data_cache_path;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $img_cache_path;
|
2019-12-09 13:13:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2018-08-24 14:36:58 -04:00
|
|
|
public $view_path;
|
|
|
|
|
|
|
|
public function setAnilist ($data): void
|
|
|
|
{
|
2018-10-05 14:32:05 -04:00
|
|
|
$this->anilist = new Config\Anilist($data);
|
2018-08-24 14:36:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setCache ($data): void
|
|
|
|
{
|
2018-10-05 14:32:05 -04:00
|
|
|
$this->cache = new Config\Cache($data);
|
2018-08-24 14:36:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setDatabase ($data): void
|
|
|
|
{
|
2018-10-05 14:32:05 -04:00
|
|
|
$this->database = new Config\Database($data);
|
2018-08-24 14:36:58 -04:00
|
|
|
}
|
|
|
|
}
|