You are here

function patterns_load_yaml in Patterns 6.2

Same name and namespace in other branches
  1. 6 patterns.module \patterns_load_yaml()
1 call to patterns_load_yaml()
patterns_load_string_yaml in ./patterns.module

File

./patterns.module, line 1125
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_load_yaml($path, $local = TRUE) {
  if ($local && !file_exists($path)) {
    return FALSE;
  }
  include_once 'spyc/spyc.php';
  $pattern = Spyc::YAMLLoad($path);
  if (!patterns_validate_pattern($pattern)) {
    return FALSE;
  }
  return $pattern;
}