ts3phpframework
Loading...
Searching...
No Matches
PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert Class Reference

Helper class for data conversion. More...

Static Public Member Functions

static bytes (int $bytes, int $precision=10)
static seconds (int $seconds, bool $is_ms=false, string $format="%aD %H:%I:%S")
static codec (int $codec)
static groupType (int $type)
static permissionType (int $type)
static permissionCategory (int $pcat)
static logLevel (mixed $level)
static logEntry (string $entry)
static iconId (int $unsigned)
static password (string $plain)
static version (string $version, string $format="Y-m-d h:i:s")
static versionShort (string $version)
static imageMimeType (string $binary)

Detailed Description

Helper class for data conversion.

Definition at line 14 of file Convert.php.

Member Function Documentation

◆ bytes()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::bytes ( int $bytes,
int $precision = 10 )
static

Converts bytes to a human-readable value.

Parameters
integer$bytes
Returns
string

Definition at line 22 of file Convert.php.

◆ codec()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::codec ( int $codec)
static

Converts a given codec ID to a human-readable name.

Parameters
integer$codec
Returns
string

Definition at line 85 of file Convert.php.

◆ groupType()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::groupType ( int $type)
static

Converts a given group type ID to a human-readable name.

Parameters
integer$type
Returns
string

Definition at line 115 of file Convert.php.

◆ iconId()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::iconId ( int $unsigned)
static

Converts a specified 32-bit unsigned integer value to a signed 32-bit integer value.

Parameters
integer$unsigned
Returns
integer

Definition at line 335 of file Convert.php.

◆ imageMimeType()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::imageMimeType ( string $binary)
static

Tries to detect the type of image by a given string and returns it.

Parameters
string$binary
Returns
string

Definition at line 398 of file Convert.php.

◆ logEntry()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::logEntry ( string $entry)
static

Converts a specified log entry string into an array containing the data.

Parameters
string$entry
Returns
array

Definition at line 303 of file Convert.php.

◆ logLevel()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::logLevel ( mixed $level)
static

Converts a given log level ID to a human readable name and vice versa.

Parameters
mixed$level
Returns
string

Definition at line 256 of file Convert.php.

◆ password()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::password ( string $plain)
static

Converts a given string to a ServerQuery password hash.

Parameters
string$plain
Returns
string

Definition at line 354 of file Convert.php.

◆ permissionCategory()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::permissionCategory ( int $pcat)
static

Converts a given permission category value to a human-readable name.

Parameters
integer$pcat
Returns
string

Definition at line 163 of file Convert.php.

◆ permissionType()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::permissionType ( int $type)
static

Converts a given permission type ID to a human-readable name.

Parameters
integer$type
Returns
string

Definition at line 136 of file Convert.php.

◆ seconds()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::seconds ( int $seconds,
bool $is_ms = false,
string $format = "%aD %H:%I:%S" )
static

Converts seconds/milliseconds to a human-readable value.

Note: Assumes non-negative integer, but no validation

Parameters
integer$seconds
boolean$is_ms
string$format
Returns
string
Todo
: Handle negative integer $seconds, or invalidate

Definition at line 67 of file Convert.php.

◆ version()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::version ( string $version,
string $format = "Y-m-d h:i:s" )
static

Returns a client-like formatted version of the TeamSpeak 3 version string.

Parameters
string$version
string$format
Returns
string|StringHelper

Definition at line 366 of file Convert.php.

◆ versionShort()

PlanetTeamSpeak\TeamSpeak3Framework\Helper\Convert::versionShort ( string $version)
static

Returns a client-like short-formatted version of the TeamSpeak 3 version string.

Parameters
string$version
Returns
StringHelper

Definition at line 383 of file Convert.php.


The documentation for this class was generated from the following file: