You are here

function patterns_parser_exists in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/parser/ \patterns_parser_exists()

Checks wheter a parser is defined for a given format.


mixed $format A string representing the format:

Return value

bool TRUE, if the parser is defined, FALSE otherwise.

8 calls to patterns_parser_exists()
PatternsTestCase::callbackOnDir in tests/patterns.test
Loads all the pattern files from a directory and executes a callback on each parsed pattern.
PatternsTestCase::runDir in tests/patterns.test
Scans a directory for patterns files, and executes them.
patterns_drush_get_file_format in ./
patterns_import_validate in includes/forms/
patterns_io_get_format_from_file in includes/io/
Extracts and validates the pattern format from a file string

... See full list


includes/parser/, line 106


function patterns_parser_exists($format = PATTERNS_FORMAT_UNKNOWN, $reset = TRUE) {
  if (empty($format) || $format == PATTERNS_FORMAT_UNKNOWN) {
    return FALSE;
  $patterns_formats = patterns_parser_build_formats_index($reset);
  if (!isset($patterns_formats[$format]) || empty($patterns_formats[$format])) {
    return FALSE;
  return TRUE;