Cleanup config a bit
This commit is contained in:
parent
0cb09dc4b8
commit
45b545d32d
@ -43,7 +43,6 @@ Update your anime/manga list on Kitsu.io and MyAnimeList.net
|
||||
3. Configure settings in `app/config/config.toml` to your liking
|
||||
4. Create the following directories if they don't exist, and make sure they are world writable
|
||||
* app/logs
|
||||
* public/js/cache
|
||||
* public/images/avatars
|
||||
* public/images/anime
|
||||
* public/images/characters
|
||||
|
@ -28,6 +28,8 @@ $tomlConfig = loadToml(__DIR__);
|
||||
|
||||
return array_merge($tomlConfig, [
|
||||
'asset_dir' => "{$ROOT_DIR}/public",
|
||||
'base_config_dir' => __DIR__,
|
||||
'config_dir' => "{$APP_DIR}/config",
|
||||
|
||||
// Template file path
|
||||
'view_path' => "{$APP_DIR}/views",
|
||||
|
@ -215,6 +215,12 @@ return [
|
||||
'controller' => DEFAULT_CONTROLLER,
|
||||
'verb' => 'get',
|
||||
],
|
||||
'settings-post' => [
|
||||
'path' => '/settings',
|
||||
'action' => 'settings',
|
||||
'controller' => DEFAULT_CONTROLLER,
|
||||
'verb' => 'post',
|
||||
],
|
||||
'login' => [
|
||||
'path' => '/login',
|
||||
'action' => 'login',
|
||||
|
@ -15,5 +15,3 @@ default_list = "anime" # anime or manga
|
||||
default_anime_list_path = "watching" # watching|plan_to_watch|on_hold|dropped|completed|all
|
||||
default_manga_list_path = "reading" # reading|plan_to_read|on_hold|dropped|completed|all
|
||||
|
||||
# Default view type (cover_view/list_view)
|
||||
default_view_type = "cover_view"
|
@ -1,4 +1,4 @@
|
||||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
/**
|
||||
* Hummingbird Anime List Client
|
||||
*
|
||||
@ -51,6 +51,7 @@ use Amp\Socket\{
|
||||
use Amp\Uri\{
|
||||
InvalidUriException, Uri
|
||||
};
|
||||
use const Aviat\AnimeClient\USER_AGENT;
|
||||
use function Amp\{
|
||||
asyncCall, call
|
||||
};
|
||||
@ -63,7 +64,7 @@ use function Amp\{
|
||||
* @see Client
|
||||
*/
|
||||
final class HummingbirdClient implements Client {
|
||||
const DEFAULT_USER_AGENT = 'Hummingbird Anime Client/5.0';
|
||||
const DEFAULT_USER_AGENT = USER_AGENT;
|
||||
|
||||
private $cookieJar;
|
||||
private $socketPool;
|
||||
|
@ -19,7 +19,7 @@ namespace Aviat\AnimeClient\Types;
|
||||
use ArrayAccess;
|
||||
use LogicException;
|
||||
|
||||
class AbstractType implements ArrayAccess {
|
||||
abstract class AbstractType implements ArrayAccess {
|
||||
/**
|
||||
* Populate values for unserializing data
|
||||
*
|
||||
@ -154,4 +154,31 @@ class AbstractType implements ArrayAccess {
|
||||
unset($this->$offset);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively cast properties to an array
|
||||
*
|
||||
* @param null $parent
|
||||
* @return mixed
|
||||
*/
|
||||
public function toArray($parent = null)
|
||||
{
|
||||
$object = $parent ?? $this;
|
||||
|
||||
if (is_scalar($object))
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
|
||||
$output = [];
|
||||
|
||||
foreach ($object as $key => $value)
|
||||
{
|
||||
$output[$key] = is_scalar($value)
|
||||
? $value
|
||||
: $this->toArray((array) $value);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user