The mTxServ SDK for PHP enables PHP developers to easily integrate our API into your applications.
NOTE: This library is under heavy development and a lot of calls haven't been implemented yet. We're looking forward to any of your PR's.
We recommend Composer for managing dependencies. Installing is as easy as:
$ composer require mtxserv/mtxserv-php
<?php
$client = \Mtxserv\Client::factory(array(
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'api_key' => 'YOUR_API_KEY'
));
<?php
$client = \Mtxserv\Client::factory(array(
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'api_key' => 'YOUR_API_KEY'
));
$products = $client->getProducts();
var_dump($products);
<?php
$client = \Mtxserv\Client::factory(array(
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'api_key' => 'YOUR_API_KEY'
));
$product = $client->getProduct(array(
'id' => 1337 # required (productId)
));
var_dump($product);
<?php
$client = \Mtxserv\Client::factory(array(
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'api_key' => 'YOUR_API_KEY'
));
$viewer = $client->getGameViewer(array(
'type' => 'GAME_SERVER_TYPE', # ex: minecraft
'ip' => 'GAME_SERVER_IP',
'port' => GAME_SERVER_PORT
));
var_dump($viewer);
<?php
$client = \Mtxserv\Client::factory(array(
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'api_key' => 'YOUR_API_KEY'
));
$administrators = $client->getAdmins(array(
'id' => 1337 # required (productId)
));
var_dump($administrators);