You are here

protected function D3LibraryInfoProcessor::parseSpecialString in d3.js 7

Parse special strings into arrays.

example: { key: value } parses into: array('key' => 'value')

Return value

Fully parsed array.

1 call to D3LibraryInfoProcessor::parseSpecialString()
D3LibraryInfoProcessor::processValues in includes/D3LibraryInfoProcessor.inc
Sub function to start a recursive process.

File

includes/D3LibraryInfoProcessor.inc, line 121
D3 .info file processor class.

Class

D3LibraryInfoProcessor
Parse additional information from library .info files.

Code

protected function parseSpecialString($str) {
  $ret = array();

  // Parse the line into array values separated by commas.
  $array = explode(',', $this
    ->trim($str));
  foreach ($array as $string) {
    list($key, $values) = explode(':', $string);
    $ret[trim($key)] = trim($values, '\'\\"');
  }
  return $ret;
}