2017 © Pedro Peláez
 

library php-yggdrasil

PHP Library for interacting with Mojang authentication servers

image

publicuhc/php-yggdrasil

PHP Library for interacting with Mojang authentication servers

  • Wednesday, June 22, 2016
  • by Eluinhost
  • Repository
  • 3 Watchers
  • 3 Stars
  • 224 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

php-yggdrasil

SensioLabsInsight, (*1)

PHP Library for interacting with Mojang authentication servers., (*2)

Installation

Using composer add it to your requirements section:, (*3)

{
    "require-dev": {
        "publicuhc/php-yggdrasil": "dev-master"
    }
}

Usage

First you need to get hold of a Yggdrasil instance, the only choice right now is DefaultYggdrasil, (*4)

$yggdrasil = new DefaultYddrasil();

You can also pass the username/clientToken/accessToken in the constructor if needed, or alternatively use the setter methods., (*5)

You can then use the Yggdrasil instance to query against the server:, (*6)

//set the username
$yggdrasil->setUsername('joe@blogs.com');

//authenticate with the password, sets accessToken/clientToken on success
$yggdrasil->authenticate('joeisthebest');

$clientToken = $yggdrasil->getClientToken();
$accessToken = $yggdrasil->getAccessToken();

Error Checking

All API functions can throw the following:, (*7)

APIRequestException, (*8)

Thrown when the mojang servers returned errors for the request, the short error can be found at $ex->getShortMessage(), the full message can get found at $ex->getMessage(), and the cause (if set) can be found at $ex->getCause(), (*9)

InvalidParameterException, (*10)

Thrown when an API method was called and certain parameters were not set yet. e.g., (*11)

//username not set yet
$yg = new DefaultYggdrasil();

//will throw InvalidParameterException due to username not being set
$yg->authenticate('xxx');

$yg->setUsername('yyy');

//will run correctly
$yg->authenticate('xxx');

The Versions

22/06 2016

dev-master

9999999-dev

PHP Library for interacting with Mojang authentication servers

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Graham Howden

authentication auth minecraft mojang yggdrasil auth server

22/06 2016

1.0.2

1.0.2.0

PHP Library for interacting with Mojang authentication servers

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Graham Howden

authentication auth minecraft mojang yggdrasil auth server

22/07 2014

1.0.1

1.0.1.0

PHP Library for interacting with Mojang authentication servers

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

by Graham Howden

authentication auth minecraft mojang yggdrasil auth server

20/06 2014

dev-releases/1.0

dev-releases/1.0

PHP Library for interacting with Mojang authentication servers

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Graham Howden

authentication auth minecraft mojang yggdrasil auth server

20/06 2014

1.0.0

1.0.0.0

PHP Library for interacting with Mojang authentication servers

  Sources   Download

GPLv3

The Requires

 

The Development Requires

by Graham Howden

authentication auth minecraft mojang yggdrasil auth server