Overview

Namespaces

  • None
  • Xmf
    • Database
    • Module
      • Helper
    • Template
  • Xoops
    • Auth
    • Core
      • Cache
      • Database
        • Logging
        • Schema
      • Exception
      • Handler
        • Scheme
      • Kernel
        • Dtype
        • Handlers
        • Model
      • Lists
      • Locale
        • Punic
      • Service
        • Contract
      • Session
      • Text
        • Sanitizer
          • Extensions
      • Theme
        • Plugins
    • Form
    • Html
    • Locale
    • Module
      • Helper
      • Plugin

Classes

  • Assets
  • ComposerUtility
  • Events
  • FilterInput
  • FixedGroups
  • HttpRequest
  • Logger
  • MediaUploader
  • MimeTypes
  • PreloadItem
  • Psr0ClassLoader
  • Psr4ClassLoader
  • Random
  • Registry
  • Request
  • Security
  • XoopsTpl
  • Yaml

Interfaces

  • AttributeInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class Yaml

Yaml dump and parse methods

YAML is a serialization format most useful when human readability is a consideration. It can be useful for configuration files, as well as import and export functions.

This file is a front end for a separate YAML package present in the vendor directory. The intent is to provide a consistent interface no mater what underlying library is actually used.

At present, this class expects the symfony/yaml package.

Direct known subclasses

Xmf\Yaml
Namespace: Xoops\Core
Package: Yaml
Category: Xoops\Core\Yaml
Copyright: 2013-2014 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Version: Release: 1.0
Since: 1.0
See: http://www.yaml.org/
Link: http://xoops.org
Located at oops_lib/Xoops/Core/Yaml.php
Methods summary
public static string|boolean
# dump( mixed $var, integer $inline = 4, integer $indent = 4 )

Dump an PHP array as a YAML string

Dump an PHP array as a YAML string

Parameters

$var
Variable which will be dumped
$inline
Nesting level where you switch to inline YAML
$indent
Number of spaces to indent for nested nodes

Returns

string|boolean
YAML string or false on error
public static array|boolean
# load( string $yamlString )

Load a YAML string into a PHP array

Load a YAML string into a PHP array

Parameters

$yamlString
YAML dump string

Returns

array|boolean
PHP array or false on error
public static array|boolean
# read( string $yamlFile )

Read a file containing YAML into a PHP array

Read a file containing YAML into a PHP array

Parameters

$yamlFile
filename of YAML file

Returns

array|boolean
PHP array or false on error
public static integer|boolean
# save( array $var, string $yamlFile, integer $inline = 4, integer $indent = 4 )

Save a PHP array as a YAML file

Save a PHP array as a YAML file

Parameters

$var
variable which will be dumped
$yamlFile
filename of YAML file
$inline
Nesting level where you switch to inline YAML
$indent
Number of spaces to indent for nested nodes

Returns

integer|boolean
number of bytes written, or false on error
public static string|boolean
# dumpWrapped( mixed $var, integer $inline = 4, integer $indent = 4 )

Dump an PHP array as a YAML string with a php wrapper

Dump an PHP array as a YAML string with a php wrapper

The wrap is a php header that surrounds the yaml with section markers, '---' and '...' along with php comment markers. The php wrapper keeps the yaml file contents from being revealed by serving the file directly from a poorly configured server.

Parameters

$var
Variable which will be dumped
$inline
Nesting level where you switch to inline YAML
$indent
Number of spaces to indent for nested nodes

Returns

string|boolean
YAML string or false on error
public static array|boolean
# loadWrapped( string $yamlString )

Load a YAML string with a php wrapper into a PHP array

Load a YAML string with a php wrapper into a PHP array

The wrap is a php header that surrounds the yaml with section markers, '---' and '...' along with php comment markers. The php wrapper keeps the yaml file contents from being revealed by serving the file directly from a poorly configured server.

Parameters

$yamlString
YAML dump string

Returns

array|boolean
PHP array or false on error
public static array|boolean
# readWrapped( string $yamlFile )

Read a file containing YAML with a php wrapper into a PHP array

Read a file containing YAML with a php wrapper into a PHP array

The wrap is a php header that surrounds the yaml with section markers, '---' and '...' along with php comment markers. The php wrapper keeps the yaml file contents from being revealed by serving the file directly from a poorly configured server.

Parameters

$yamlFile
filename of YAML file

Returns

array|boolean
PHP array or false on error
public static integer|boolean
# saveWrapped( array $var, string $yamlFile, integer $inline = 4, integer $indent = 4 )

Save a PHP array as a YAML file with a php wrapper

Save a PHP array as a YAML file with a php wrapper

The wrap is a php header that surrounds the yaml with section markers, '---' and '...' along with php comment markers. The php wrapper keeps the yaml file contents from being revealed by serving the file directly from a poorly configured server.

Parameters

$var
variable which will be dumped
$yamlFile
filename of YAML file
$inline
Nesting level where you switch to inline YAML
$indent
Number of spaces to indent for nested nodes

Returns

integer|boolean
number of bytes written, or false on error
API documentation generated by ApiGen