\GSPPanel\Strings
Methods
ByteSize(integer $size) : string
Converts bytes into KB, MB, GB and returns the value
Name | Type | Description |
---|---|---|
$size | integer |
Type | Description |
---|---|
string |
CheckBlacklist(string $type, string $value) : boolean
Checks the blacklist for the specified item
Name | Type | Description |
---|---|---|
$type | string | The blacklist type to search for |
$value | string | The value to search for in the blacklist |
Type | Description |
---|---|
boolean | true|false If there was a match found |
EndsWith( $FullStr, $EndStr) : void
Checks if the end of a string contains certain text
Name | Type | Description |
---|---|---|
$FullStr | ||
$EndStr |
- Access
- private
GameReplaceVars(array $params) : array
Replaces GSP-Panel variables with the correct game variables
$params requires the following;
- ugid: The users gameserver id
- content: The content that needs variables replaced
Returns the following:
- error
- -1: No usergame specified
- 0: Success
- content: The new content with replaced variables
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |
ReplaceVars(array $params) : array
Replaces GSP-Panel variables with the correct user profile or setting variables
$params requires the following;
- uid: The users id
- content: The content that needs variables replaced
Returns the following:
- error
- -1: No user id specified
- -2: No user found matching the specified user id
- 0: Success
- content: The new content with replaced variables
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |
array2ini(array $array) : string
Converts an array to an ini
Name | Type | Description |
---|---|---|
$array | array |
Type | Description |
---|---|
string |
createRandomPassword() : string
Returns a random password
Type | Description |
---|---|
string |
filter_xml( $matches) : void
Name | Type | Description |
---|---|---|
$matches |
parse_ini_string(string $str, boolean $ProcessSections = false) : array
Converts an ini to an array
Name | Type | Description |
---|---|---|
$str | string | The ini contents |
$ProcessSections | boolean | Seperate the array into sections |
Type | Description |
---|---|
array |
search_array(string $needle, array $array, string $item) : string
Allows multi-dimensional array search using the specified key
Name | Type | Description |
---|---|---|
$needle | string | The value to search for |
$array | array | The array to search in |
$item | string | The key to look for needle in |
Type | Description |
---|---|
string | Returns -1 if nothing was found or returns the key |
str_replace_last( $search, $replace, $subject) : void
Replaces the last string and returns the new contents
Name | Type | Description |
---|---|---|
$search | ||
$replace | ||
$subject |
- Access
- private
version_compare2( $version1, $version2) : void
Compare two versions
Name | Type | Description |
---|---|---|
$version1 | ||
$version2 |
- Access
- private
xml2array( $xml) : void
Converts an XML string to an array
Name | Type | Description |
---|---|---|
$xml |
xml_to_array( $xml, $main_heading = '') : void
Converts an XML string to an array
Name | Type | Description |
---|---|---|
$xml | ||
$main_heading |