xyrotech / orin
Discog PHP Client
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.0
- illuminate/contracts: ^8.37
- spatie/guzzle-rate-limiter-middleware: ^2.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.5
- spatie/ray: ^1.10
- vimeo/psalm: ^4.3
README
Orin is a Discogs API PHP client library which utilizes GuzzleHttp.
Installation
You can install the package via composer:
composer require xyrotech/orin
Requirements
PHP >= 7.4
Usage
Copy the config file.
Plain PHP
cp vendor/xyrotech/orin/config/orin.php myconfig
Laravel
php artisan vendor:publish --provider="Xyrotech\OrinServiceProvider" --tag="orin-config"
$config = include('orin.php'); $discog = new Xyrotech\Orin($config); $artist = $discog->artist(45); echo $artist->name;
Output
'Aphex Twin'
This library follows the API Documentation heavily. All endpoints have a corresponding methods. i.e. All Label Release would have the equivalent method below
$config = include('orin_config.php'); $discog = new Xyrotech\Orin($config); $label = $discog->all_label_releases(1); var_dump($label->releases); // An array of label releases
Testing
Clone the repository and install dependencies:
git clone https://github.com/xyrotech/orin.git && composer install
Create your own config.php based on /tests/configs/config.test.php
with your own authentication. Be sure to change the username at the bottom of the config to match the account information.
composer test
Orders may not work properly as it would require you to create a listing and buy it using another account to push the order to the "SOLD" status.
composer format
composer psalm
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.