-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,17 @@ | ||
# Hypixel PHP | ||
|
||
This is a PHP wrapper for the [Hypixel Public API](https://api.hypixel.net) | ||
You can find Documentation and a Java implementation here: https://github.com/HypixelDev/PublicAPI | ||
|
||
Note that this version is VERY outdated and a lot of things will not work as intended. | ||
|
||
## Requirements | ||
- PHP 7+ | ||
- Hypixel API key | ||
|
||
## Installation | ||
|
||
The preferred method of installing this library is with | ||
[Composer](https://getcomposer.org) by running the following from your project | ||
root: | ||
The preferred method of installing this library is with [Composer](https://getcomposer.org) by running the following from your project root: | ||
|
||
$ composer require "plancke/hypixel-php=^1.2.0" | ||
$ composer require "plancke/hypixel-php=^1.3.0" | ||
|
||
I don't push a new version for every minor resource update. You can use `$ composer require "plancke/hypixel-php=dev-master"` to always download latest. | ||
|
||
## TODO | ||
|
||
- Add examples | ||
|
||
## Usage | ||
|
||
To interact with the API you need an API key, you can get a key by doing "/api" on the Hypixel Network. | ||
|
||
```PHP | ||
$HypixelPHP = new HypixelPHP('API_KEY'); | ||
|
||
// you can override modules | ||
$HypixelPHP->setCacheHandler(...); | ||
$HypixelPHP->setLogger(...); | ||
$HypixelPHP->setFetcher(...); | ||
|
||
$player = $HypixelPHP->getPlayer([FetchParams::PLAYER_BY_NAME => 'Plancke']); | ||
if ($player instanceof Player) { | ||
echo $player->getName(); | ||
} | ||
``` | ||
To interact with the API you need an API key, you can get a key by doing "/api" on the Hypixel Network. |