Download the PHP package mcmainiac/phpubg without Composer

On this page you can find all versions of the php package mcmainiac/phpubg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpubg

PHPUBG

Test Status

PHP wrapper for the PUBG Tracker API.

Installation

PHPUBG is available on packagist, so you can easily require it via composer:

composer require mcmainiac/phpubg

To use this as a standalone library (without composer), download the repository and extract it somewhere (preferably in your projects libraries folder) and set up an autoloader to load all files dynamically. The root namespace of this library is \PHPUBG.

Usage

To get your own api key, please visit pubgtracker.com/site-api.

Assuming you are at the root of your project (the vendor folder is within your current folder):

<?php

require __DIR__  . "/vendor/autoload.php";

use PHPUBG\Region;
use PHPUBG\PubgBuilder;

$statsEurope = PubgBuilder::setApiKey("your-api-key")
    ->getPlayer("MCMainiac")
    ->getStats(
        Region::get(Region::EUROPE)
    );

var_dump($statsEurope);

This should dump all stats available for the player "MCMainiac" in the region "Europe".

You can also use the Steam Id (a 64 bit number) instead of the username. PHPUBG will automatically resolve the username and get the stats:

<?php
$builder = PubgBuilder::setApiKey("your-api-key");

$playerByName = $builder->getPlayer("MCMainiac");
$playerBySteamId = $builder->getPlayer(76561198128415640); // steam id for "MCMainiac"

// At this point $playerByName and $playerBySteamId are equivalent entities.

$playerByName->getNickname() == $playerBySteamID->getNickname(); // will return true

If you want to apply another filter, just pass it to the getStats method:

$player->getStats($region, $season, $mode);

whereas:

If any variable of the above is null, then any value for this filter is accepted.

Example: You want to get all stats for the region "Europe" and the match mode "Solo":

$region = Region::get(Region::EUROPE);
$mode = MatchMode::get(MatchMode::SOLO);

$europeSoloStats = $player->getStats($region, null, $mode);

Development

Feel free to clone the repository, make your changes and open a pull request.

Please report issues right here on GitHub using the issues system.

Notes

When requesting stats, please keep the number of requests at ~1/sec.

Thanks to pubgtracker.com for their public api.

Thanks to all contributors!

Support on Beerpay

Hey dude! Help me out for a couple of :beers:!

Beerpay Beerpay


All versions of phpubg with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mcmainiac/phpubg contains the following files

Loading the files please wait ....