Developed with love by KnpLabs Hire us for your project!
25

RicbraDiscogsBundle

by ricbra

Symfony2 bundle around Discogs API

RicbraDiscogsBundle

Latest Stable Version Total Downloads Latest Unstable Version License

This bundle provides a simple integration of the "Discogs
library
" into Symfony2. You can find more
information about this library on its dedicated page at
http://www.discogs.com/developers/index.html.

<?php

$discogs = $this->container->get('discogs');

The bundle provides a new discogs service that returns an instance of
Discogs\Service.

Installation

$ composer require ricbra/discogs-bundle ~1.0.0

Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...

        new Ricbra\Bundle\DiscogsBundle\RicbraDiscogsBundle(),
    );
}

Configuration

To enable or disable the throttle:

ricbra_discogs:
    throttle:
        enabled: false # or true

To enable OAuth you've to also use some third party library for connecting and authorization. This bundle provides
support for HWIOAuthBundle. The token_provider_id is the service id which provider the token and token
secret. You get this after authenticating at Discogs.

ricbra_discogs:
    oauth:
        enabled: true
        consumer_key: _get_this_from_discogs_
        consumer_secret: _get_this_from_discogs_
        token_provider_id: ricbra_discogs.hwi_oauth_token_provider

Basic Usage

The only thing to do is to request the discogs service from the container to get
an instance of Discogs\Service and start issuing API calls:

<?php

$discogs = $this->container->get('discogs');

$artist = $discogs->getArtist([
    'id' => 120
]);

echo $artist['name'];
ricbra_discogs:
user_agent: RicBraDiscogsBundle/1.0 +https://github.com/ricbra/php-discogs-api
throttle:
enabled: true
microseconds: 1000000
oauth:
enabled: false
consumer_key: ~
consumer_secret: ~
token_provider_id: ~
  • Fixed deprecated factory syntax
    By ricbra, 3 years ago
  • Fixed version constraint for php-discogs-api
    By ricbra, 3 years ago
  • Update README.md
    By ricbra, 4 years ago
  • Merge pull request #6 from ricbra/guzzle
    By ricbra, 5 years ago
  • Rewrite to php-discogs-api 1.0.0
    By ricbra, 5 years ago
  • Add a Bitdeli badge to README
    By bitdeli-chef, 5 years ago
  • Merge pull request #5 from bitdeli-chef/master
    By ricbra, 5 years ago
  • Removed Buzz dependency, corrected php-discogs-api version
    By ricbra, 6 years ago
  • Merge pull request #4 from ualinker/master
    By Richard van den Brand, 6 years ago
  • Set buzz required version to be >=0.5 (conflicts with HWIOAuthBundle)
    By ualinker, 6 years ago
  • Merge pull request #1 from ricbra/master
    By ualinker, 6 years ago
  • bumped version of php-discogs-api to 0.4
    By Richard van den Brand, 6 years ago
  • Merge pull request #3 from ualinker/master
    By Richard van den Brand, 6 years ago
  • Update README.md
    By ualinker, 6 years ago
  • Merge pull request #2 from ualinker/master
    By Richard van den Brand, 6 years ago
  • Update README.MD
    By ualinker, 6 years ago
  • Implemented MongoDB cacher
    By ualinker, 6 years ago
  • Changed required version of "php-discogs-api" from "dev-master" to "0.3"
    By ualinker, 6 years ago
  • Changed required version of "php-discogs-api" from "0.1" to "dev-master"
    By ualinker, 6 years ago
  • Merge pull request #1 from ualinker/master
    By Richard van den Brand, 6 years ago
  • - Added boolean 'throttle' parameter: limit request to Discogs API to 1 per second
    By ualinker, 6 years ago
  • fixed null argument in config
    By ricbra, 7 years ago
  • Update README.md
    By Richard van den Brand, 7 years ago
  • fixed link in doc
    By ricbra, 7 years ago
  • added README.md
    By ricbra, 7 years ago
  • added composer.json
    By ricbra, 7 years ago
  • initial commit
    By ricbra, 7 years ago