You are here

function patterns_phpparser_load in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_phpparser/patterns_phpparser.module \patterns_phpparser_load()

Loads a serialized PHP pattern array from file.

Parameters

mixed $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_phpparser/patterns_phpparser.module, line 45

Code

function patterns_phpparser_load($path, $local = TRUE) {
  if ($local && !file_exists($path)) {
    return FALSE;
  }
  if (!($php = file_get_contents($path))) {
    return FALSE;
  }
  return patterns_phpparser_parse($php);
}