Download the PHP package adback/adback-sdk-php-symfony without Composer
On this page you can find all versions of the php package adback/adback-sdk-php-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adback/adback-sdk-php-symfony
More information about adback/adback-sdk-php-symfony
Files in adback/adback-sdk-php-symfony
Package adback-sdk-php-symfony
Short Description A bundle to use the AdBack ApiClient
License MIT
Informations about the package adback-sdk-php-symfony
Adback/ApiClientBundle
This bundle will use the library to call the AdBack api.
See the AdBack website for more informations.
Installation
Launch the composer command :
If you are using a version of symfony >= 4, it should automatically activate the bundle.
If you are using a version of symfony < 4, you have to add the bundle to your AppKernel.php
file :
Configuration
Symfony 4
In your .env
file, the following lines should have been added :
Modify it with the token provided by the AdBack team.
Then follow the paragraph linked to the type of cache you have choosen :
Redis
In the config/packages/adback_sdk_php.yaml
you should add the following configuration :
redis_service
is the name of the redis connection you are using to store the data.
Doctrine
In the config/packages/adback_sdk_php.yaml
you should add the following configuration :
doctrine.orm.entity_manager
is the name of the doctrine connection you are using to store the data.
Do not forget to create the table linked to the AdBack sdk.
Custom
If you want to write your own cache driver, you should create a class that implements
Adback\ApiClient\Driver\ScriptCacheInterface
and name this service adback_api_client.script_cache
.
In the config/packages/adback_sdk_php.yaml
you should add the following configuration :
If the service is missing, an error will be issued by the Symfony DIC when the service is being used.
Symfony < 4
In your app/config/config.yml
file, you should add the following lines :
Modify it with the token provided by the AdBack team.
Then follow the paragraph linked to the type of cache you have choosen :
Redis
In the app/config/config.yml
you should add the following configuration :
redis_service
is the name of the redis connection you are using to store the data.
Doctrine
In the app/config/config.yml
you should add the following configuration :
doctrine.orm.entity_manager
is the name of the doctrine connection you are using to store the data.
Do not forget to create the table linked to the AdBack sdk.
Custom
If you want to write your own cache driver, you should create a class that implements
Adback\ApiClient\Driver\ScriptCacheInterface
and name this service adback_api_client.script_cache
.
In the app/config/config.yml
you should add the following configuration :
If the service is missing, an error will be issued by the Symfony DIC when the service is being used
Script Type
There is two possibilities for the script you could get.
Small scripts
This configuration will only load the AdBack script from an external url.
This usage is good for a quick start.
Full scripts
This configuration will load our full script or bootscrap script.
This will allow us to deliver a script which is more flexible when the blocking in place are harder.
This solution is recommanded for an advanced usage.
Usage
Refresh command
In order to have the AdBack script always up-to-date you should launch the command adback:api-client:refresh-tag
periodically (at least once a day).
This command will call our api and store the response in the cache type you have chosen
Add the script to your pages
At the bottom of your webpages, you should add the script twig generation function :
Full configuration description
All versions of adback-sdk-php-symfony with dependencies
adback/adback-sdk-php Version ~2.5
twig/twig Version *