You are here

function patterns_xmlparser_load in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_xmlparser/patterns_xmlparser.module \patterns_xmlparser_load()

Loads an XML pattern file without validating.

Parameters

string $path The path of the pattern file.:

bool $local: (optional) TRUE if the pattern file is local. Defaults to TRUE.

Return value

array|bool The pattern structure, or FALSE.

File

patterns_xmlparser/patterns_xmlparser.module, line 23

Code

function patterns_xmlparser_load($path, $local = TRUE) {
  if ($local && !file_exists($path)) {
    return FALSE;
  }
  if (!($xml = file_get_contents($path))) {
    return FALSE;
  }
  return patterns_xmlparser_parse($xml);
}