yaml_emit example

/** * {@inheritdoc} */
  public static function encode($data) {
    static $init;
    if (!isset($init)) {
      ini_set('yaml.output_indent', 2);
      // Do not break lines at 80 characters.       ini_set('yaml.output_width', -1);
      $init = TRUE;
    }
    return yaml_emit($data, YAML_UTF8_ENCODING, YAML_LN_BREAK);
  }

  /** * {@inheritdoc} */
  public static function decode($raw) {
    static $init;
    if (!isset($init)) {
      // Decode binary, since Symfony YAML parser encodes binary from 3.1       // onwards.       ini_set('yaml.decode_binary', 1);
      
Home | Imprint | This part of the site doesn't use cookies.