Class EasyRdf_Utils

Description

Class containing static utility functions

Located in /EasyRdf/Utils.php (line 47)


	
			
Method Summary
static string camelise (string $str)
static string dumpLiteralValue ( $literal, [bool $html = true], [string $color = 'black'], mixed $resource)
static string dumpResourceValue (mixed $resource, [bool $html = true], [string $color = 'blue'])
static string execCommandPipe (string $command, [array $args = null], [string $input = null], [string $dir = null])
static bool isAssociativeArray (mixed $param)
static array parseMimeType (string $mimeType)
static string removeFragmentFromUri (mixed $uri)
Methods
static method camelise (line 62)

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

  • return: The input string converted to CamelCase
  • access: public
static string camelise (string $str)
  • string $str: The input string
static method dumpLiteralValue (line 161)

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.

  • access: public
static string dumpLiteralValue ( $literal, [bool $html = true], [string $color = 'black'], mixed $resource)
  • mixed $resource: An EasyRdf_Literal object or an associative array
  • bool $html: Set to true to format the dump using HTML
  • string $color: The colour of the text
  • $literal
static method dumpResourceValue (line 120)

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.

  • access: public
static string dumpResourceValue (mixed $resource, [bool $html = true], [string $color = 'blue'])
  • mixed $resource: An EasyRdf_Resource object or an associative array
  • bool $html: Set to true to format the dump using HTML
  • string $color: The colour of the text
static method execCommandPipe (line 218)

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.

  • return: The result of the command, printed to STDOUT
  • access: public
static string execCommandPipe (string $command, [array $args = null], [string $input = null], [string $dir = null])
  • string $command: The command to execute
  • array $args: Optional list of arguments to pass to the command
  • string $input: Optional buffer to send to the command
  • string $dir: Path to directory to run command in (defaults to /tmp)
static method isAssociativeArray (line 79)

Check if something is an associative array

Note: this method only checks the key of the first value in the array.

  • return: true if the variable is an associative array
  • access: public
static bool isAssociativeArray (mixed $param)
  • mixed $param: The variable to check
static method parseMimeType (line 192)

Clean up and split a mime-type up into its parts

  • return: $parameters
  • access: public
static array parseMimeType (string $mimeType)
  • string $mimeType: A MIME Type, optionally with parameters
static method removeFragmentFromUri (line 99)

Remove the fragment from a URI (if it has one)

  • return: The same URI with the fragment removed
  • access: public
static string removeFragmentFromUri (mixed $uri)
  • mixed $uri: A URI

Documentation generated on Wed, 16 Jan 2013 19:16:39 +0000 by phpDocumentor 1.4.4