English
Install v1.0.0
Composer, PHP, and environment variables for the MyShows client.
Requirements
- PHP 8.3 and newer
- Composer
- Access to
https://api.myshows.me
Install the package
composer require devcraftclub/myshows-api-phpEnvironment variables
Public methods need an application name and a language. Private methods need an OAuth2 application on the MyShows side.
MYSHOWS_ENDPOINT=https://api.myshows.me/v2/rpc/
MYSHOWS_USER_AGENT=MyApp/1.0
MYSHOWS_ACCEPT_LANGUAGE=ru
MYSHOWS_CACHE_TTL=86400
MYSHOWS_CACHE_DIR=/tmp/myshows_cache
MYSHOWS_RATE_LIMIT_ENABLED=true
MYSHOWS_RATE_LIMIT_RPS=5
MYSHOWS_RATE_LIMIT_RPM=90
MYSHOWS_OAUTH_CLIENT_ID=
MYSHOWS_OAUTH_CLIENT_SECRET=
MYSHOWS_OAUTH_REDIRECT_URI=https://your.app/callback
MYSHOWS_TOKEN_STORE_PATH=/tmp/myshows_tokens.jsonCheck
$client = \DevCraftClub\MyShows\MyShowsClient::fromEnv();
$show = $client->shows()->getById(showId: 1);A non-empty title means the request reached the API.