tcgdex / sdk
PHP SDK to communicate with the TCGdex API
Fund package maintenance!
tcgdex
2.2.0-beta.3
2024-06-26 20:51 UTC
Requires
- php: >=8.1
- psr/http-client: ^1.0
- psr/simple-cache: ^1 || ^2 || ^3
Requires (Dev)
Suggests
- kriswallsmith/buzz: Good PSR 18 implementation
- nyholm/psr7: Good PSR17 implementation
- symfony/cache: Good PSR16 implementation
This package is auto-updated.
Last update: 2024-12-12 12:39:36 UTC
README
TCGdex PHP SDK
This is the SDK used to communicate with the Open source TCGdex API using PHP
Full API/SDK documentation in progress here
Getting Started
install the SDK using:
composer require tcgdex/sdk # if you have no PSR 16/17/18 implementations add the following packages composer require symfony/cache nyholm/psr7 kriswallsmith/buzz # they will be automaticly setup for the project # symfony/cache === PSR16 # nyholm/psr7 === PSR17 # kriswallsmith/buzz === PSR18
Quick usage
use TCGdex\TCGdex; // Is you are using your own PSRs implementations add theses before loading the class TCGdex::$cache = /* PSR16 CacheInterface */; TCGdex::$requestFactory = /* PSR17 RequestFactoryInterface */; TCGdex::$responseFactory = /* PSR17 ResponseFactoryInterface */; TCGdex::$client = /* PSR18 ClientInterface */; // initialize the SDK with the language $tcgdex = new TCGdex("en"); // Fetch the cards ! $card = $tcgdex->fetchCard('1', 'Sword & Shield');