示例#1
0
 /**
  * Safely parses the input string.
  *
  * In contrast to the original Yaml class, we do not try to resolve the input to a filename first. Consequentially,
  * there is no need to sanitize the input prior to calling this method.
  *
  * @param string $input
  *
  * @return mixed
  */
 public static function safeParse($input)
 {
     if (method_exists('Symfony\\Component\\Yaml\\Yaml', 'setPhpParsing')) {
         Yaml::setPhpParsing(false);
     }
     return (new Parser())->parse($input, true, false);
 }
示例#2
0
 public function registerContainerConfiguration(LoaderInterface $loader)
 {
     Yaml::setPhpParsing(true);
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
     Yaml::setPhpParsing(false);
 }