diff --git a/.travis.yml b/.travis.yml index 62f82e2c..d913cc55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ install: - composer install --ignore-platform-reqs php: - - 7.3 - 7.4 - nightly @@ -12,13 +11,6 @@ script: - mkdir -p build/logs - php vendor/bin/phpunit -c build -#after_script: -# - CODECLIMATE_REPO_TOKEN=2cbddcebcb9256b3402867282e119dbe61de0b31039325356af3c7d72ed6d058 vendor/bin/test-reporter - matrix: allow_failures: - php: nightly - -#addons: -# code_climate: -# repo_token: 2cbddcebcb9256b3402867282e119dbe61de0b31039325356af3c7d72ed6d058 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e18a7bc4..4d602057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ # Changelog +## Version 5 +* Updated PHP requirement to 7.4 +* Added anime watching history view +* Added manga reading history view +* Updated anime collection to have more media types + ## Version 4.2 * Updated dependencies * Updated PHP requirement to 7.3 +* Added option to automatically set dark mode based on the OS setting ## Version 4.1 * Added optional dark theme diff --git a/Jenkinsfile b/Jenkinsfile index 7fb02a70..c94da53f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,18 +10,6 @@ pipeline { sh 'php composer.phar install --ignore-platform-reqs' } } - stage('PHP 7.3') { - agent { - docker { - image 'php:7.3-alpine' - args '-u root --privileged' - } - } - steps { - sh 'apk add --no-cache git' - sh 'php ./vendor/bin/phpunit --colors=never' - } - } stage('PHP 7.4') { agent { docker { diff --git a/README.md b/README.md index a43e5faa..4bf489cf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Hummingbird Anime Client -Update your anime/manga list on Kitsu.io and MyAnimeList.net +Update your anime/manga list on Kitsu.io and Anilist -[![Build Status](https://travis-ci.org/timw4mail/HummingBirdAnimeClient.svg?branch=master)](https://travis-ci.org/timw4mail/HummingBirdAnimeClient) +[![Build Status](https://travis-ci.com/timw4mail/HummingBirdAnimeClient.svg?branch=master)](https://travis-ci.com/github/timw4mail/HummingBirdAnimeClient) [![Build Status](https://jenkins.timshomepage.net/buildStatus/icon?job=timw4mail/HummingBirdAnimeClient/develop)](https://jenkins.timshomepage.net/job/timw4mail/HummingBirdAnimeClient/develop) [[Hosted Example](https://list.timshomepage.net)] @@ -31,7 +31,7 @@ Update your anime/manga list on Kitsu.io and MyAnimeList.net ### Requirements -* PHP 7.3+ +* PHP 7.4+ * PDO SQLite or PDO PostgreSQL (For collection tab) * GD extension for caching images diff --git a/app/appConf/menus.toml b/app/appConf/menus.toml index fd1df9fa..0f7df3b6 100644 --- a/app/appConf/menus.toml +++ b/app/appConf/menus.toml @@ -1,19 +1,21 @@ [anime_list] - route_prefix = "/anime" + route_prefix = "" [anime_list.items] - watching = '/watching' - plan_to_watch = '/plan_to_watch' - on_hold = '/on_hold' - dropped = '/dropped' - completed = '/completed' - all = '/all' + watch_history = '/history/anime' + watching = '/anime/watching' + plan_to_watch = '/anime/plan_to_watch' + on_hold = '/anime/on_hold' + dropped = '/anime/dropped' + completed = '/anime/completed' + all = '/anime/all' [manga_list] - route_prefix = "/manga" + route_prefix = "" [manga_list.items] - reading = '/reading' - plan_to_read = '/plan_to_read' - on_hold = '/on_hold' - dropped = '/dropped' - completed = '/completed' - all = '/all' \ No newline at end of file + reading_history = '/history/manga' + reading = '/manga/reading' + plan_to_read = '/manga/plan_to_read' + on_hold = '/manga/on_hold' + dropped = '/manga/dropped' + completed = '/manga/completed' + all = '/manga/all' \ No newline at end of file diff --git a/app/appConf/routes.php b/app/appConf/routes.php index ba17aa55..3f7c62ab 100644 --- a/app/appConf/routes.php +++ b/app/appConf/routes.php @@ -279,6 +279,13 @@ $routes = [ 'view' => ALPHA_SLUG_PATTERN, ], ], + 'history' => [ + 'controller' => 'history', + 'path' => '/history/{type}', + 'tokens' => [ + 'type' => SLUG_PATTERN + ] + ], 'index_redirect' => [ 'path' => '/', 'action' => 'redirectToDefaultRoute', diff --git a/app/bootstrap.php b/app/bootstrap.php index f7638021..02dd99c7 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -4,13 +4,13 @@ * * An API client for Kitsu to manage anime and manga watch lists * - * PHP version 7.3 + * PHP version 7.4 * * @package HummingbirdAnimeClient * @author Timothy J. Warren * @copyright 2015 - 2020 Timothy J. Warren * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 4.2 + * @version 5 * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient */ @@ -28,14 +28,15 @@ use Aviat\AnimeClient\Model; use Aviat\Banker\Pool; use Aviat\Ion\Config; use Aviat\Ion\Di\Container; +use Aviat\Ion\Di\ContainerInterface; +use Laminas\Diactoros\{Response, ServerRequestFactory}; use Monolog\Handler\RotatingFileHandler; use Monolog\Logger; -use Zend\Diactoros\{Response, ServerRequestFactory}; // ----------------------------------------------------------------------------- // Setup DI container // ----------------------------------------------------------------------------- -return static function ($configArray = []) { +return static function (array $configArray = []): Container { $container = new Container(); // ------------------------------------------------------------------------- @@ -60,26 +61,20 @@ return static function ($configArray = []) { // ------------------------------------------------------------------------- // Create Config Object - $container->set('config', static function() use ($configArray) { - return new Config($configArray); - }); + $container->set('config', fn () => new Config($configArray)); // Create Cache Object - $container->set('cache', static function($container): Pool { + $container->set('cache', static function(ContainerInterface $container): Pool { $logger = $container->getLogger(); $config = $container->get('config')->get('cache'); return new Pool($config, $logger); }); - // Create List Cache - // Create Aura Router Object - $container->set('aura-router', static function() { - return new RouterContainer; - }); + $container->set('aura-router', fn() => new RouterContainer); // Create Html helper Object - $container->set('html-helper', static function($container) { + $container->set('html-helper', static function(ContainerInterface $container) { $htmlHelper = (new HelperLocatorFactory)->newInstance(); $htmlHelper->set('menu', static function() use ($container) { $menuHelper = new Helper\Menu(); @@ -101,31 +96,23 @@ return static function ($configArray = []) { }); // Create Request/Response Objects - $container->set('request', static function() { - return ServerRequestFactory::fromGlobals( - $_SERVER, - $_GET, - $_POST, - $_COOKIE, - $_FILES - ); - }); - $container->set('response', static function() { - return new Response; - }); + $container->set('request', fn () => ServerRequestFactory::fromGlobals( + $_SERVER, + $_GET, + $_POST, + $_COOKIE, + $_FILES + )); + $container->set('response', fn () => new Response); // Create session Object - $container->set('session', static function() { - return (new SessionFactory())->newInstance($_COOKIE); - }); + $container->set('session', fn () => (new SessionFactory())->newInstance($_COOKIE)); // Miscellaneous helper methods - $container->set('util', static function($container): Util { - return new Util($container); - }); + $container->set('util', fn ($container) => new Util($container)); // Models - $container->set('kitsu-model', static function($container): Kitsu\Model { + $container->set('kitsu-model', static function(ContainerInterface $container): Kitsu\Model { $requestBuilder = new KitsuRequestBuilder(); $requestBuilder->setLogger($container->getLogger('kitsu-request')); @@ -141,7 +128,7 @@ return static function ($configArray = []) { $model->setCache($cache); return $model; }); - $container->set('anilist-model', static function($container): Anilist\Model { + $container->set('anilist-model', static function(ContainerInterface $container): Anilist\Model { $requestBuilder = new Anilist\AnilistRequestBuilder(); $requestBuilder->setLogger($container->getLogger('anilist-request')); @@ -155,39 +142,24 @@ return static function ($configArray = []) { return $model; }); - - $container->set('anime-model', static function($container) { - return new Model\Anime($container); - }); - $container->set('manga-model', static function($container) { - return new Model\Manga($container); - }); - $container->set('anime-collection-model', static function($container) { - return new Model\AnimeCollection($container); - }); - $container->set('manga-collection-model', static function($container) { - return new Model\MangaCollection($container); - }); + $container->set('anime-model', fn ($container) => new Model\Anime($container)); + $container->set('manga-model', fn ($container) => new Model\Manga($container)); + $container->set('anime-collection-model', fn ($container) => new Model\AnimeCollection($container)); + $container->set('manga-collection-model', fn ($container) => new Model\MangaCollection($container)); $container->set('settings-model', static function($container) { - $model = new Model\Settings($container->get('config')); + $model = new Model\Settings($container->get('config')); $model->setContainer($container); return $model; }); // Miscellaneous Classes - $container->set('auth', static function($container) { - return new Kitsu\Auth($container); - }); - $container->set('url-generator', static function($container) { - return new UrlGenerator($container); - }); + $container->set('auth', fn ($container) => new Kitsu\Auth($container)); + $container->set('url-generator', fn ($container) => new UrlGenerator($container)); // ------------------------------------------------------------------------- // Dispatcher // ------------------------------------------------------------------------- - $container->set('dispatcher', static function($container) { - return new Dispatcher($container); - }); + $container->set('dispatcher', fn ($container) => new Dispatcher($container)); return $container; }; diff --git a/app/views/anime/add.php b/app/views/anime/add.php index c471026b..d378f00a 100644 --- a/app/views/anime/add.php +++ b/app/views/anime/add.php @@ -2,6 +2,7 @@

Add Anime to your List

+