Download the PHP package xpaw/steamid without Composer

On this page you can find all versions of the php package xpaw/steamid. 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 steamid

SteamID.php Packagist Codecov

This 64bit structure is used for identifying various objects on the Steam network. This library provides an easy way to work with SteamIDs and makes conversions easy.

This library does not use subtraction hacks like described on Valve Developer Wiki, or used in many other functions.

SteamID.php requires modern PHP version, and GMP module to be installed to perform operations 64-bit math.

Brief overview

A SteamID is made up of four parts: its universe, its type, its instance, and its account ID.

Using this library

It's really easy to use it, as constructor automatically figures out given input and works its magic from there. If provided SteamID is not in a valid format, an InvalidArgumentException is thrown. You can call IsValid on given SteamID instance to perform various checks which make sure that given account type / universe / instance are correct. You can view test file for multiple examples on how to manipulate SteamIDs.

Example

Also see VanityURLs.php for parsing any user input including URLs. If you're going to process user input, SteamID::SetFromURL() is all you need to use.

SteamID normalization

If you run some website where users can enter their own SteamIDs, sometimes you might encounter SteamIDs which have wrong universe or instanceid set, which will result in a completely different, yet valid, SteamID. To avoid this, you can manipulate given SteamID and set universe to public and instance to desktop.

After doing these steps, you can call RenderSteam3, RenderSteam2 or ConvertToUInt64 to get normalized SteamID.

See Example.php for a fully fledged example.

Functions

Name Parameters Description
IsValid - Gets a value indicating whether this instance is valid.
RenderSteam2 - Renders this instance into it's Steam2 "STEAM_" representation.
RenderSteam3 - Renders this instance into it's Steam3 representation.
RenderSteamInvite - Encodes accountid as HEX which can be used in `http://s.team/p/` URL.
RenderCsgoFriendCode - Encodes accountid as CS:GO friend code.
ConvertToUInt64 - Converts this SteamID into it's 64bit integer form.
SetFromURL string, callback Parse any user input including URLs and just steam ids.
SetFromUInt64 string or int (e.g 765...) Sets the various components of this SteamID from a 64bit integer form.
SetFromCsgoFriendCode string Sets the accountid of this SteamID from a CS:GO friend code. Resets other components to default values.
GetAccountID - Gets the account id.
GetAccountInstance - Gets the account instance.
GetAccountType - Gets the account type.
GetAccountUniverse - Gets the account universe.
SetAccountID New account id Sets the account id.
SetAccountInstance New account instance Sets the account instance. (e.g. SteamID::DesktopInstance)
SetAccountType New account type Sets the account type. (e.g. SteamID::TypeAnonGameServer)
SetAccountUniverse New account universe Sets the account universe. (e.g. SteamID::UniversePublic)

New Steam invite URLs

Valve introduce a new way of sharing profile URLs (https://s.team/p/hjqp or https://steamcommunity.com/user/hjqp). The encoding is simply hex encoded account id and each letter being replaced with a custom alphabet. While HEX originally is 0-9a-f, in the converted version numbers and letters a or e are not included, but they still work in the URL because Valve does a single pass replacement.

This library natively supports parsing s.team/p/ or steamcommunity.com/user/ URLs in SetFromURL function.

Here's the mapping of replacements:

Hex Letter
0 b
1 c
2 d
3 f
4 g
5 h
6 j
7 k
8 m
9 n
a p
b q
c r
d t
e v
f w

License

MIT


All versions of steamid with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-gmp Version *
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 xpaw/steamid contains the following files

Loading the files please wait ....