Example #1
0
 /**
  * Dump a PHP array to YAML.
  *
  * The dump method, when supplied with an array, will do its best
  * to convert the array into friendly YAML.
  *
  * @param  array|Traversable  $array     PHP array or traversable object
  * @param  integer            $options   Options to pass to dumper
  * @return string                        YAML representation of $value
  */
 public static function dump($value, $options = array())
 {
     if (is_callable(self::$dumpfunc)) {
         return call_user_func(self::$dumpfunc, $value);
     }
     $dumper = new Horde_Yaml_Dumper();
     return $dumper->dump($value, $options);
 }
Example #2
0
 /**
  * Dump a PHP array to YAML.
  *
  * The dump method, when supplied with an array, will do its best
  * to convert the array into friendly YAML.
  *
  * @param  array|Traversable  $array     PHP array or traversable object
  * @param  integer            $options   Options to pass to dumper
  * @return string                        YAML representation of $value
  */
 public static function dump($value, $options = array())
 {
     $dumper = new Horde_Yaml_Dumper();
     return $dumper->dump($value, $options);
 }