PHP-wrapper for the spiget.org-api.
You can install the Spiget4PHP core using composer (View on packagist):
composer require th3shadowbroker/spiget4php
composer require th3shadowbroker/spiget4php-obj
require 'SpigetAPI.php'; use de\m4taiori\spiget4php\SpigetAPI as SpigetAPI; //Yes you can use 'new' but getInstance() is a better way because you don't have to create a ton of instances. $spiget = SpigetAPI::getInstance(); /* * Some functions use optional arguments/parameters. Use null if you want to use the default value * defined by the spiget-web-api. * * Nearly all functions in this lib throw SpigetExceptions if something's going horribly wrong or is just invalid. However * if you want to receive nulls instead of exceptions you can disable exceptions by using setThrowExceptions() * at any time. */ //Let's get a list of the categories $categories = $spiget->getCategoryList(); //All results will be returned as PHP assoc.-array var_dump($categories); //<-- Let's see the result as it is in PHP
If you have any suggestions or want to report an issue don't be afraid of using the issue-tracker. However most of the time I'm not able to work on my "freetime-projects" so feel free to submit pull-request even if you've only corrected a typo
I've already planned the implementation of the webhook-support provided by spiget. I haven't implemented webhook-support yet because I don't need it for my purposes at the moment.
If you want to learn more about Spiget4PHP visit the docs.
Follow or just message me on social-media: