caseysoftware / marvel-helper
A PHP wrapper for the Marvel Comics API
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- mockery/mockery: >=0.7.2
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2024-12-12 05:24:18 UTC
README
The Unofficial Marvel PHP Library
This is a helper library for the Marvel Comics API - http://developer.marvel.com/
This isn't official but should generally work except for the incomplete items in the TODO list below.
All characters - no matter how awesome they are - are owned by Marvel Comics. Also, if you use this library, make sure you follow their attribution rules: http://developer.marvel.com/documentation/attribution
Installing via Composer
The recommended way to install the Marvel library is through Composer.
# Install Composer
curl -sS https://getcomposer.org/installer | php
# Add the library as a dependency
php composer.phar require caseysoftware/marvel-helper ~2.0
or alternatively, you can add it directly to your composer.json
file.
{
"require": {
"caseysoftware/marvel-helper": "~2.0"
}
}
Then install via Composer:
composer install
Finally, require Composer's autoloader in your PHP script:
require __DIR__.'/vendor/autoload.php';
To use any of the examples, rename credentials-dist.php to credentials.php and add your API key from here: https://developer.marvel.com/account
TODO
Refactor to use Guzzle instead of curl, etc directlyImplement Character List and paginationImplement the optional parameters for the Character ListImplement Character LoadImplement Character's comic lookup, events lookup, stories lookupImplement Comic List and paginationImplement the optional parameters for the Comic ListImplement Comic LoadImplement Comic's character lookup, creators lookup, events lookup, stories lookupImplement Creators List and paginationImplement the optional parameters for the Creator ListImplement Creator LoadImplement Creator's comic lookup, events lookup, stories lookupImplement Event List and paginationImplement the optional parameters for the Event ListImplement Event LoadImplement Event's character lookup, comic lookup, creator lookup, stories lookupImplement Series List and paginationImplement the optional parameters for the Series ListImplement Series LoadImplement Series' character lookup, comic lookup, creator lookup, event lookup, stories lookupImplement Stories List and paginationImplement the optional parameters for the Story ListImplement Story LoadImplement Stories' character lookup, comic lookup, creator lookup, event lookup
Notes
- The character name search doesn't support wildcards but you can use terms like 'nameStartsWith' to perform more interesting searches like finding every instance of 'Spider-Man' by just using 'Spider'.
- So far the optional parameters have no validation in this library... I'm not sure if it should occur here as it may break later versions of the API as those requirements change.