2015-05-22 12:36:26 -04:00
|
|
|
<?php
|
2015-11-16 11:40:01 -05:00
|
|
|
/**
|
|
|
|
* Hummingbird Anime Client
|
|
|
|
*
|
|
|
|
* An API client for Hummingbird to manage anime and manga watch lists
|
|
|
|
*
|
|
|
|
* @package HummingbirdAnimeClient
|
|
|
|
* @author Timothy J. Warren
|
2016-01-04 16:58:33 -05:00
|
|
|
* @copyright Copyright (c) 2015 - 2016
|
2015-11-16 11:40:01 -05:00
|
|
|
* @link https://github.com/timw4mail/HummingBirdAnimeClient
|
|
|
|
* @license MIT
|
|
|
|
*/
|
2015-05-22 12:36:26 -04:00
|
|
|
|
2016-01-06 11:08:56 -05:00
|
|
|
use Aviat\AnimeClient\AnimeClient;
|
|
|
|
|
2015-05-22 12:36:26 -04:00
|
|
|
return [
|
2016-01-06 11:08:56 -05:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// Routing options
|
|
|
|
//
|
|
|
|
// Specify default paths and views
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
'route_config' => [
|
|
|
|
// Subfolder prefix for url, if in a subdirectory of the web root
|
|
|
|
'subfolder_prefix' => '',
|
|
|
|
|
|
|
|
// Path to public directory, where images/css/javascript are located,
|
|
|
|
// appended to the url
|
|
|
|
'asset_path' => '/public',
|
|
|
|
|
|
|
|
// Which list should be the default?
|
|
|
|
'default_list' => 'anime', // anime or manga
|
|
|
|
|
|
|
|
// Default pages for anime/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',
|
2015-09-16 12:25:35 -04:00
|
|
|
],
|
2016-01-06 11:08:56 -05:00
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// Routing Config
|
|
|
|
//
|
|
|
|
// Maps paths to controlers and methods
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
'routes' => [
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Anime List Routes
|
|
|
|
// ---------------------------------------------------------------------
|
2016-01-04 10:53:03 -05:00
|
|
|
'anime_add_form' => [
|
|
|
|
'path' => '/anime/add',
|
|
|
|
'action' => 'add_form',
|
|
|
|
'verb' => 'get'
|
2015-06-24 16:01:35 -04:00
|
|
|
],
|
2016-01-04 10:53:03 -05:00
|
|
|
'anime_add' => [
|
|
|
|
'path' => '/anime/add',
|
|
|
|
'action' => 'add',
|
|
|
|
'verb' => 'post'
|
2016-01-06 11:08:56 -05:00
|
|
|
],
|
2016-02-02 11:34:03 -05:00
|
|
|
'anime_detail' => [
|
|
|
|
'path' => '/anime/details/{id}',
|
|
|
|
'action' => 'details',
|
|
|
|
'tokens' => [
|
|
|
|
'id' => '[a-z0-9\-]+'
|
|
|
|
]
|
|
|
|
],
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Manga Routes
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
'manga_search' => [
|
|
|
|
'path' => '/manga/search',
|
|
|
|
'action' => 'search',
|
|
|
|
],
|
|
|
|
'manga_add_form' => [
|
|
|
|
'path' => '/manga/add',
|
|
|
|
'action' => 'add_form',
|
|
|
|
'verb' => 'get'
|
|
|
|
],
|
|
|
|
'manga_add' => [
|
|
|
|
'path' => '/manga/add',
|
|
|
|
'action' => 'add',
|
|
|
|
'verb' => 'post'
|
|
|
|
],
|
2016-01-06 11:08:56 -05:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Anime Collection Routes
|
|
|
|
// ---------------------------------------------------------------------
|
2015-12-08 14:52:59 -05:00
|
|
|
'collection_search' => [
|
|
|
|
'path' => '/collection/search',
|
|
|
|
'action' => 'search'
|
|
|
|
],
|
2015-09-14 10:54:50 -04:00
|
|
|
'collection_add_form' => [
|
|
|
|
'path' => '/collection/add',
|
2015-10-05 16:54:25 -04:00
|
|
|
'action' => 'form',
|
2015-09-14 10:54:50 -04:00
|
|
|
'params' => [],
|
|
|
|
],
|
|
|
|
'collection_edit_form' => [
|
|
|
|
'path' => '/collection/edit/{id}',
|
2015-10-05 16:54:25 -04:00
|
|
|
'action' => 'form',
|
2015-09-14 10:54:50 -04:00
|
|
|
'tokens' => [
|
|
|
|
'id' => '[0-9]+'
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'collection_add' => [
|
|
|
|
'path' => '/collection/add',
|
2015-10-05 16:54:25 -04:00
|
|
|
'action' => 'add',
|
2015-09-14 10:54:50 -04:00
|
|
|
'verb' => 'post'
|
|
|
|
],
|
|
|
|
'collection_edit' => [
|
|
|
|
'path' => '/collection/edit',
|
2015-10-05 16:54:25 -04:00
|
|
|
'action' => 'edit',
|
2015-09-14 10:54:50 -04:00
|
|
|
'verb' => 'post'
|
|
|
|
],
|
|
|
|
'collection' => [
|
|
|
|
'path' => '/collection/view{/view}',
|
2015-10-05 16:54:25 -04:00
|
|
|
'action' => 'index',
|
2015-09-14 10:54:50 -04:00
|
|
|
'params' => [],
|
|
|
|
'tokens' => [
|
|
|
|
'view' => '[a-z_]+'
|
|
|
|
]
|
|
|
|
],
|
2016-01-06 11:08:56 -05:00
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// Default / Shared routes
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
'login' => [
|
|
|
|
'path' => '/{controller}/login',
|
|
|
|
'action' => 'login',
|
|
|
|
],
|
|
|
|
'login_post' => [
|
|
|
|
'path' => '/{controller}/login',
|
|
|
|
'action' => 'login_action',
|
|
|
|
'verb' => 'post'
|
|
|
|
],
|
|
|
|
'logout' => [
|
|
|
|
'path' => '/{controller}/logout',
|
|
|
|
'action' => 'logout'
|
|
|
|
],
|
|
|
|
'update' => [
|
|
|
|
'path' => '/{controller}/update',
|
|
|
|
'action' => 'update',
|
2016-01-07 20:48:18 -05:00
|
|
|
'verb' => 'post',
|
2016-01-06 11:08:56 -05:00
|
|
|
'tokens' => [
|
|
|
|
'controller' => '[a-z_]+'
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'update_form' => [
|
|
|
|
'path' => '/{controller}/update_form',
|
|
|
|
'action' => 'form_update',
|
|
|
|
'verb' => 'post',
|
|
|
|
'tokens' => [
|
|
|
|
'controller' => '[a-z_]+'
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'edit' => [
|
|
|
|
'path' => '/{controller}/edit/{id}/{status}',
|
|
|
|
'action' => 'edit',
|
|
|
|
'tokens' => [
|
|
|
|
'id' => '[0-9a-z_]+',
|
2016-02-02 14:13:49 -05:00
|
|
|
'status' => '([a-zA-Z\- ]|%20)+',
|
2016-01-06 11:08:56 -05:00
|
|
|
]
|
|
|
|
],
|
|
|
|
'list' => [
|
|
|
|
'path' => '/{controller}/{type}{/view}',
|
|
|
|
'action' => AnimeClient::DEFAULT_CONTROLLER_METHOD,
|
|
|
|
'tokens' => [
|
|
|
|
'type' => '[a-z_]+',
|
|
|
|
'view' => '[a-z_]+'
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'index_redirect' => [
|
|
|
|
'path' => '/',
|
|
|
|
'controller' => AnimeClient::DEFAULT_CONTROLLER_NAMESPACE,
|
|
|
|
'action' => 'redirect_to_default'
|
|
|
|
],
|
|
|
|
]
|
|
|
|
];
|