function patterns_phpparser_load_new in Patterns 7
Same name and namespace in other branches
- 7.2 patterns_phpparser/patterns_phpparser.module \patterns_phpparser_load_new()
Loads and parses a PHP pattern from file.
Parameters
string $path The path to 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 23
Code
function patterns_phpparser_load_new($path, $local = TRUE) {
if ($local && !file_exists($path)) {
return FALSE;
}
if (!($php = file_get_contents($path))) {
return FALSE;
}
return patterns_phpparser_parse($php);
}