Utils
class Utils
Class containing static utility functions
Methods
Convert a string into CamelCase
Check if something is an associative array
Remove the fragment from a URI (if it has one)
Return pretty-print view of a resource URI
Return pretty-print view of a literal
Clean up and split a mime-type up into its parts
Execute a command as a pipe
Details
at line 63
static string
camelise(string $str)
Convert a string into CamelCase
A capital letter is inserted for any non-letter (including userscore). For example: 'hello world' becomes HelloWorld 'rss-tag-soup' becomes RssTagSoup 'FOO//BAR' becomes FooBar
at line 81
static bool
isAssociativeArray(mixed $param)
Check if something is an associative array
Note: this method only checks the key of the first value in the array.
at line 102
static string
removeFragmentFromUri(mixed $uri)
Remove the fragment from a URI (if it has one)
at line 125
static string
dumpResourceValue(mixed $resource, string $format = 'html', string $color = 'blue')
Return pretty-print view of a resource URI
This method is mainly intended for internal use and is used by EasyRdf\Graph and EasyRdf\Sparql\Result to format a resource for display.
at line 174
static string
dumpLiteralValue(mixed $literal, string $format = 'html', string $color = 'black')
Return pretty-print view of a literal
This method is mainly intended for internal use and is used by EasyRdf\Graph and EasyRdf\Sparql\Result to format a literal for display.
at line 216
static array
parseMimeType(string $mimeType)
Clean up and split a mime-type up into its parts
at line 244
static string
execCommandPipe(string $command, array $args = null, string $input = null, string $dir = null)
Execute a command as a pipe
The proc_open() function is used to open a pipe to a a command line process, writing $input to STDIN, returning STDOUT and throwing an exception if anything is written to STDERR or the process returns non-zero.