\Pydio\Core\Utils\VarsStringHelper

Class StringHelper

Summary

Methods
Properties
Constants
natksort()
natkrsort()
xmlEntities()
xmlContentEntities()
slugify()
prettyPrintJSON()
generateRandomString()
regexpToLike()
cleanRegexp()
likeToLike()
cleanLike()
regexpToLdap()
createGUID()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

natksort()

natksort(array  $array) : boolean

Performs a natural sort on the array keys.

Behaves the same as ksort() with natural sorting added.

Parameters

array $array

The array to sort

Returns

boolean

natkrsort()

natkrsort(array  $array) : boolean

Performs a reverse natural sort on the array keys Behaves the same as krsort() with natural sorting added.

Parameters

array $array

The array to sort

Returns

boolean

xmlEntities()

xmlEntities(  $string, boolean  $toUtf8 = false) : mixed|string

Replace specific chars by their XML Entities, for use inside attributes value

Parameters

$string
boolean $toUtf8

Returns

mixed|string

xmlContentEntities()

xmlContentEntities(  $string, boolean  $toUtf8 = false) : mixed|string

Replace specific chars by their XML Entities, for use inside attributes value

Parameters

$string
boolean $toUtf8

Returns

mixed|string

slugify()

slugify(string  $text) : string

Modifies a string to remove all non ASCII characters and spaces.

Parameters

string $text

Returns

string

prettyPrintJSON()

prettyPrintJSON(string  $json) : string

Indents a flat JSON string to make it more human-readable.

Parameters

string $json

The original JSON string to process.

Returns

string —

Indented version of the original JSON string.

generateRandomString()

generateRandomString(  $length = 24, boolean  $complexChars = false) : string

generates a random password, uses base64: 0-9a-zA-Z

Parameters

$length
boolean $complexChars

Returns

string —

password

regexpToLike()

regexpToLike(  $regexp) : string

Parameters

$regexp

Returns

string

cleanRegexp()

cleanRegexp(  $regexp) : string

Parameters

$regexp

Returns

string

likeToLike()

likeToLike(  $regexp) : string

Parameters

$regexp

Returns

string

cleanLike()

cleanLike(  $regexp) : string

Parameters

$regexp

Returns

string

regexpToLdap()

regexpToLdap(  $regexp) : null|string

Parameters

$regexp

Returns

null|string

createGUID()

createGUID() : string

Create a unique UID

Returns

string