2017 © Pedro Peláez
 

symfony-bundle adback-sdk-php-symfony

A bundle to use the AdBack ApiClient

image

adback/adback-sdk-php-symfony

A bundle to use the AdBack ApiClient

  • Monday, July 16, 2018
  • by gignonje
  • Repository
  • 2 Watchers
  • 0 Stars
  • 4,928 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 22 Versions
  • 19 % Grown

The README.md

Adback/ApiClientBundle

Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License, (*1)

This bundle will use the library to call the AdBack api., (*2)

See the AdBack website for more informations., (*3)

Installation

Launch the composer command :, (*4)

    composer require adback/adback-sdk-php-symfony

If you are using a version of symfony >= 4, it should automatically activate the bundle., (*5)

If you are using a version of symfony < 4, you have to add the bundle to your AppKernel.php file :, (*6)

    new Adback\ApiClientBundle\Adback\ApiClientBundle(),

Configuration

Symfony 4

In your .env file, the following lines should have been added :, (*7)

    ADBACK_API_CLIENT_ACCESS_TOKEN=adback-access-token

Modify it with the token provided by the AdBack team., (*8)

Then follow the paragraph linked to the type of cache you have choosen :, (*9)

Redis

In the config/packages/adback_sdk_php.yaml you should add the following configuration :, (*10)

    cache_type: redis
    cache_service: redis_service

redis_service is the name of the redis connection you are using to store the data., (*11)

Doctrine

In the config/packages/adback_sdk_php.yaml you should add the following configuration :, (*12)

    cache_type: doctrine
    entity_manager: doctrine.orm.entity_manager

doctrine.orm.entity_manager is the name of the doctrine connection you are using to store the data., (*13)

Do not forget to create the table linked to the AdBack sdk., (*14)

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., (*15)

In the config/packages/adback_sdk_php.yaml you should add the following configuration :, (*16)

    cache_type: custom

If the service is missing, an error will be issued by the Symfony DIC when the service is being used., (*17)

Symfony < 4

In your app/config/config.yml file, you should add the following lines :, (*18)

    adback_api_client:
        access_token: "your-access-token"

Modify it with the token provided by the AdBack team., (*19)

Then follow the paragraph linked to the type of cache you have choosen :, (*20)

Redis

In the app/config/config.yml you should add the following configuration :, (*21)

    adback_api_client:
        cache_type: redis
        cache_service: redis_service

redis_service is the name of the redis connection you are using to store the data., (*22)

Doctrine

In the app/config/config.yml you should add the following configuration :, (*23)

    adback_api_client:
        cache_type: doctrine
        entity_manager: doctrine.orm.entity_manager

doctrine.orm.entity_manager is the name of the doctrine connection you are using to store the data., (*24)

Do not forget to create the table linked to the AdBack sdk., (*25)

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., (*26)

In the app/config/config.yml you should add the following configuration :, (*27)

    adback_api_client:
        cache_type: custom

If the service is missing, an error will be issued by the Symfony DIC when the service is being used, (*28)

Script Type

There is two possibilities for the script you could get., (*29)

Small scripts

This configuration will only load the AdBack script from an external url., (*30)

This usage is good for a quick start., (*31)

Full scripts

This configuration will load our full script or bootscrap script., (*32)

This will allow us to deliver a script which is more flexible when the blocking in place are harder., (*33)

This solution is recommanded for an advanced usage., (*34)

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)., (*35)

This command will call our api and store the response in the cache type you have chosen, (*36)

Add the script to your pages

At the bottom of your webpages, you should add the script twig generation function :, (*37)

    {{ adback_generate_scripts() }}

Full configuration description

    adback_api_client:
        access_token:         ~ # Required, Your personnal access token
        api_url:              'https://adback.co/api' # The base url for the api
        script_url:           script/me # The api url used to get the script
        cache_type:           redis # The cache type you are using
        generator_type:       script # The type of script you are generating
        cache_service:        redis # The service used for the caching
        entity_manager:       doctrine.orm.entity_manager # The entity manager used (only if you use the doctrine cache

        # This key is used if multiple website access the same database
        key_prefix:           ''

The Versions

16/07 2018

dev-master

9999999-dev

A bundle to use the AdBack ApiClient

  Sources   Download

MIT Apache-2.0

The Requires

 

The Development Requires

by Nicolas Thal

16/07 2018

v2.8.0

2.8.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

28/06 2018

v2.7.0

2.7.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

25/06 2018

v2.6.2

2.6.2.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

15/06 2018

v2.6.1

2.6.1.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

03/05 2018

v2.6.0

2.6.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

01/02 2018

v2.5.0

2.5.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

05/12 2017

v2.4.2

2.4.2.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

05/12 2017

v2.4.1

2.4.1.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

29/11 2017

v2.3.1

2.3.1.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

29/11 2017

v2.4.0

2.4.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

29/11 2017

v2.3.0

2.3.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

MIT

The Requires

 

The Development Requires

by Nicolas Thal

11/09 2017

v2.2.0

2.2.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Nicolas Thal

21/07 2017

v2.1.0

2.1.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Nicolas Thal

17/07 2017

v2.0.0

2.0.0.0

A bundle to use the AdBack ApiClient

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Nicolas Thal

30/05 2017

v1.6.0

1.6.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Nicolas Thal

18/05 2017

v1.5.0

1.5.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

by Nicolas Thal

23/03 2017

v1.4.0

1.4.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

by Nicolas Thal

14/03 2017

v1.3.0

1.3.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

by Nicolas Thal

13/03 2017

v1.2.0

1.2.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

by Nicolas Thal

19/01 2017

v1.1.0

1.1.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

by Nicolas Thal

10/01 2017

v1.0.0

1.0.0.0

A bundle to use the AdBack Analytics lib

  Sources   Download

Apache-2.0

The Requires

 

by Nicolas Thal