Download the PHP package php-tmdb/symfony without Composer
On this page you can find all versions of the php package php-tmdb/symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package symfony
A Symfony Bundle for use together with the php-tmdb/api TMDB API Wrapper.
Compatible with Symfony 5 and 6, PHP 7.4 and up.
Buy me a coffee, or a beer :-)
My stomach will appreciate your donation!
Installation
- Install Composer
- Install php-tmdb/api dependencies
- For development within Symfony we recommend making use of Symfony's PSR-18 HTTP Client
Symfony\Component\HttpClient\Psr18Client
, as when non-cached results pass your profiler will be filled with data.
- For development within Symfony we recommend making use of Symfony's PSR-18 HTTP Client
Then require the bundle:
Configuration
Register the bundle in app/bundles.php
:
Add to your app/config/config.yml
the following, or replace values with services of your choice ( PSR-18 Http Client / PSR-17 Factories ):
services.yaml
:
Configure caching
You can use any PSR-6 cache you wish to use, we will simply use symfony's cache.
When making use of caching, make sure to also include php-http/cache-plugin
in composer, this plugin handles the logic for us,
so we don't have to re-invent the wheel.
You are however also free to choose to implement your own cache listener, or add the caching logic inside the http client of your choice.
First off configure the cache pool in symfony config/cache.yaml
:
Then in your tmdb_symfony.yaml
configuration enable the cache and reference this cache pool:
Want to make use of logging?
Logging capabilities as of 4.0
allow you to make a fine-grained configuration.
You can use any PSR-3 logger you wish to use, we will simply use monolog.
First off configure the monolog and add a channel and handler:
Then in your tmdb_symfony.yaml
configuration:
Disable repositories :
Disable twig extension :
Disable https :
Disable legacy aliases :
_Set to true to remove all legacy alises ( e.g. tmdb.client
or tmdb.movie_repository
)._
Full configuration with defaults :
Usage
Obtaining the client
Obtaining repositories
An overview of all the repositories can be found in the services configuration repositories.xml.
There is also a Twig helper that makes use of the Tmdb\Helper\ImageHelper
to output urls and html.
For all all other interactions take a look at php-tmdb/api.
All versions of symfony with dependencies
php-tmdb/api Version ^4.0
symfony/config Version ^5.4 || ^6.0
symfony/dependency-injection Version ^5.4 || ^6.0
symfony/event-dispatcher Version ^5.4 || ^6.0
symfony/http-kernel Version ^5.4 || ^6.0
symfony/yaml Version ^5.4 || ^6.0
twig/twig Version ^3.0