Spyc
[ class tree: Spyc ] [ index: Spyc ] [ all elements ]

Class: Spyc

Source Location: /vendors/spyc/spyc.php

Class Overview


The Simple PHP YAML Class.


Variables

Constants

Methods



Class Details

[line 57]
The Simple PHP YAML Class.

This class can be used to read a YAML file and convert its contents into a PHP array. It currently supports a very limited subsection of the YAML spec.

Usage:

  1.    $Spyc  new Spyc;
  2.    $array $Spyc->load($file);
or:
  1.    $array Spyc::YAMLLoad($file);
or:
  1.    $array spyc_load_file($file);




[ Top ]


Class Variables

$setting_dump_force_quotes =  false

[line 69]

Setting this to true will force YAMLDump to enclose any string value in quotes. False by default.



Tags:

access:  public

Type:   bool


[ Top ]

$setting_use_syck_is_possible =  false

[line 76]

Setting this to true will forse YAMLLoad to use syck_load function when possible. False by default.



Tags:

access:  public

Type:   bool


[ Top ]

$_nodeId =

[line 103]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method YAMLDump [line 187]

static string YAMLDump( array $array, [int $indent = false], [int $wordwrap = false])

Dump YAML from PHP array statically

The dump method, when supplied with an array, will do its best to convert the array into friendly YAML. Pretty simple. Feel free to save the returned string as nothing.yaml and pass it around.

Oh, and you can decide how big the indent is and what the wordwrap for folding is. Pretty cool -- just pass in 'false' for either if you want to use the default.

Indent's default is 2 spaces, wordwrap's default is 40 characters. And you can turn off wordwrap by passing in 0.




Tags:

access:  public


Parameters:

array   $array   PHP array
int   $indent   Pass in false to use the default, which is 2
int   $wordwrap   Pass in 0 for no wordwrap, false for default (40)

[ Top ]

static method YAMLLoad [line 138]

static array YAMLLoad( string $input)

Load YAML into a PHP array statically

The load method, when supplied with a YAML stream (string or file), will do its best to convert YAML in a file into a PHP array. Pretty simple. Usage:

  1.    $array Spyc::YAMLLoad('lucky.yaml');
  2.    print_r($array);




Tags:

access:  public


Parameters:

string   $input   Path of YAML file or string containing YAML

[ Top ]

static method YAMLLoadString [line 162]

static array YAMLLoadString( string $input)

Load a string of YAML into a PHP array statically

The load method, when supplied with a YAML string, will do its best to convert YAML in a string into a PHP array. Pretty simple.

Note: use this function if you don't want files from the file system loaded and processed as YAML. This is of interest to people concerned about security whose input is from a string.

Usage:

  1.    $array Spyc::YAMLLoadString("---\n0: hello world\n");
  2.    print_r($array);




Tags:

access:  public


Parameters:

string   $input   String containing YAML

[ Top ]

method dump [line 213]

string dump( array $array, [int $indent = false], [int $wordwrap = false])

Dump PHP array to YAML

The dump method, when supplied with an array, will do its best to convert the array into friendly YAML. Pretty simple. Feel free to save the returned string as tasteful.yaml and pass it around.

Oh, and you can decide how big the indent is and what the wordwrap for folding is. Pretty cool -- just pass in 'false' for either if you want to use the default.

Indent's default is 2 spaces, wordwrap's default is 40 characters. And you can turn off wordwrap by passing in 0.




Tags:

access:  public


Parameters:

array   $array   PHP array
int   $indent   Pass in false to use the default, which is 2
int   $wordwrap   Pass in 0 for no wordwrap, false for default (40)

[ Top ]

method load [line 110]

array load( string $input)

Load a valid YAML string to Spyc.



Tags:

access:  public


Parameters:

string   $input  

[ Top ]

method loadFile [line 119]

array loadFile( string $file)

Load a valid YAML file to Spyc.



Tags:

access:  public


Parameters:

string   $file  

[ Top ]

method revertLiteralPlaceHolder [line 861]

void revertLiteralPlaceHolder( $lineArray, $literalBlock)



Tags:

access:  public


Parameters:

   $lineArray  
   $literalBlock  

[ Top ]


Class Constants

REMPTY =  "\0\0\0\0\0"

[line 61]


[ Top ]



Documentation generated on Mon, 05 Sep 2011 20:34:37 -0500 by phpDocumentor 1.4.3