PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\utils\Utils Class Reference
+ Collaboration diagram for pocketmine\utils\Utils:

Static Public Member Functions

static getCallableIdentifier (callable $variable)
 
static getUniqueID ($raw=false, $extra="")
 
static getIP ($force=false)
 
static getOS ()
 
static hexdump ($bin)
 
static printable ($str)
 
static getRandomBytes ($length=16, $secure=true, $raw=true, $startEntropy="", &$rounds=0, &$drop=0)
 
static getURL ($page, $timeout=10)
 
static postURL ($page, $args, $timeout=10)
 

Static Public Attributes

static $online = true
 
static $ip = false
 

Detailed Description

Big collection of functions

Definition at line 30 of file Utils.php.

Member Function Documentation

static pocketmine\utils\Utils::getCallableIdentifier ( callable  $variable)
static

Generates an unique identifier to a callable

Parameters
callable$variable
Returns
string

Definition at line 41 of file Utils.php.

static pocketmine\utils\Utils::getIP (   $force = false)
static

Gets the External IP using an external service, it is cached

Parameters
bool$forcedefault false, force IP check even when cached
Returns
string

Definition at line 108 of file Utils.php.

References pocketmine\utils\Utils\getURL().

+ Here is the call graph for this function:

static pocketmine\utils\Utils::getOS ( )
static

Returns the current Operating System Windows => win MacOS => mac iOS => ios Android => android Linux => Linux BSD => bsd Other => other

Returns
string

Definition at line 152 of file Utils.php.

Referenced by pocketmine\utils\Utils\getUniqueID().

+ Here is the caller graph for this function:

static pocketmine\utils\Utils::getRandomBytes (   $length = 16,
  $secure = true,
  $raw = true,
  $startEntropy = "",
$rounds = 0,
$drop = 0 
)
static

This function tries to get all the entropy available in PHP, and distills it to get a good RNG.

Parameters
int$lengthdefault 16, Number of bytes to generate
bool$securedefault true, Generate secure distilled bytes, slower
bool$rawdefault true, returns a binary string if true, or an hexadecimal one
string$startEntropydefault null, adds more initial entropy
int&$roundsWill be set to the number of rounds taken
int&$dropWill be set to the amount of dropped bytes
Returns
string

Definition at line 223 of file Utils.php.

static pocketmine\utils\Utils::getUniqueID (   $raw = false,
  $extra = "" 
)
static

Gets this machine / server instance unique ID Returns a hash, the first 32 characters (or 16 if raw) will be an identifier that won't change frequently. The rest of the hash will change depending on other factors.

Parameters
bool$rawdefault false, if true, returns the raw identifier, not hexadecimal
string$extraoptional, additional data to identify the machine
Returns
string

Definition at line 60 of file Utils.php.

References pocketmine\utils\Utils\getOS().

+ Here is the call graph for this function:

static pocketmine\utils\Utils::getURL (   $page,
  $timeout = 10 
)
static

GETs an URL using cURL

Parameters
$page
int$timeoutdefault 10
Returns
bool|mixed

Definition at line 338 of file Utils.php.

Referenced by pocketmine\utils\Utils\getIP().

+ Here is the caller graph for this function:

static pocketmine\utils\Utils::hexdump (   $bin)
static

Returns a prettified hexdump

Parameters
string$bin
Returns
string

Definition at line 182 of file Utils.php.

static pocketmine\utils\Utils::postURL (   $page,
  $args,
  $timeout = 10 
)
static

POSTs data to an URL

Parameters
$page
array | string$args
int$timeout
Returns
bool|mixed

Definition at line 368 of file Utils.php.

static pocketmine\utils\Utils::printable (   $str)
static

Returns a string that can be printed, replaces non-printable characters

Parameters
$str
Returns
string

Definition at line 202 of file Utils.php.


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