Welcome, Guest Log In

Class Spyc

Property Summary
mixed   $LiteralBlockMarkers  
mixed   $LiteralPlaceHolder  
mixed   $path  
mixed   $result  
mixed   $SavedGroups  
mixed   $_allNodes  
mixed   $_allParent  
mixed   $_containsGroupAlias  
mixed   $_containsGroupAnchor  
mixed   $_dumpIndent  
mixed   $_dumpWordWrap  
mixed   $_haveRefs  
mixed   $_inBlock  
mixed   $_isInline  
mixed   $_lastIndent  
mixed   $_lastNode  
mixed   $_nodeId  

[ Top ]
Method Summary
static string   YAMLDump()   Dump YAML from PHP array statically
static array   YAMLLoad()   Load YAML into a PHP array statically
void   addArray()  
void   addGroup()  
void   addLiteralLine()  
void   clearBiggerPathValues()  
string   dump()   Dump PHP array to YAML
void   flatten()  
void   getParentPathByIndent()  
void   isArrayElement()  
void   isComment()  
void   isHashElement()  
void   isLiteral()  
void   literalBlockContinues()  
void   load()  
void   loadFromSource()  
void   nodeContainsGroup()  
void   returnArrayElement()  
void   returnKeyValuePair()  
void   returnMappedSequence()  
void   returnMappedValue()  
void   revertLiteralPlaceHolder()  
void   startsLiteralBlock()  
void   startsMappedSequence()  
void   startsMappedValue()  
void   stripGroup()  
void   stripIndent()  
string   _doFolding()   Folds a string of text, if necessary
string   _doLiteralBlock()   Creates a literal block for dumping
string   _dumpNode()   Returns YAML from a key and a value
int   _getIndent()   Finds and returns the indentation of a YAML line
array   _inlineEscape()   Used in inlines to check for more inlines or quoted strings
array   _parseLine()   Parses YAML code and returns an array for a node
mixed   _toType()   Finds the type of the passed value, returns the value as the new type.
string   _yamlize()   Attempts to convert a key / value array item to YAML
string   _yamlizeArray()   Attempts to convert an array to YAML

[ Top ]
Properties
mixed   $LiteralBlockMarkers = array ('>', '|') [line 47]
API Tags:
Access:  private


[ Top ]
mixed   $LiteralPlaceHolder = '___YAML_Literal_Block___' [line 48]
API Tags:
Access:  private


[ Top ]
mixed   $path [line 45]
API Tags:
Access:  private


[ Top ]
mixed   $result [line 46]
API Tags:
Access:  private


[ Top ]
mixed   $SavedGroups = array() [line 49]
API Tags:
Access:  private


[ Top ]
mixed   $_allNodes [line 35]
API Tags:
Access:  private


[ Top ]
mixed   $_allParent [line 36]
API Tags:
Access:  private


[ Top ]
mixed   $_containsGroupAlias = false [line 44]
API Tags:
Access:  private


[ Top ]
mixed   $_containsGroupAnchor = false [line 43]
API Tags:
Access:  private


[ Top ]
mixed   $_dumpIndent [line 41]
API Tags:
Access:  private


[ Top ]
mixed   $_dumpWordWrap [line 42]
API Tags:
Access:  private


[ Top ]
mixed   $_haveRefs [line 34]
API Tags:
Access:  private


[ Top ]
mixed   $_inBlock [line 39]
API Tags:
Access:  private


[ Top ]
mixed   $_isInline [line 40]
API Tags:
Access:  private


[ Top ]
mixed   $_lastIndent [line 37]
API Tags:
Access:  private


[ Top ]
mixed   $_lastNode [line 38]
API Tags:
Access:  private


[ Top ]
mixed   $_nodeId [line 56]
API Tags:
Access:  public


[ Top ]
Methods
static method YAMLDump  [line 99]

  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.

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)

API Tags:
Access:  public


[ Top ]
static method YAMLLoad  [line 74]

  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);

Parameters:
string   $input:  Path of YAML file or string containing YAML

API Tags:
Access:  public


[ Top ]
addArray  [line 505]

  void addArray( $array, $indent  )

Parameters:
   $array: 
   $indent: 

API Tags:
Access:  private


[ Top ]
addGroup  [line 732]

  void addGroup( $line, $group  )

Parameters:
   $line: 
   $group: 

API Tags:
Access:  private


[ Top ]
addLiteralLine  [line 573]

  void addLiteralLine( $literalBlock, $line, $literalBlockStyle  )

Parameters:
   $literalBlock: 
   $line: 
   $literalBlockStyle: 

API Tags:
Access:  private


[ Top ]
clearBiggerPathValues  [line 616]

  void clearBiggerPathValues( $indent  )

Parameters:
   $indent: 

API Tags:
Access:  private


[ Top ]
dump  [line 125]

  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.

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)

API Tags:
Access:  public


[ Top ]
flatten  [line 551]

  void flatten( $array  )

Parameters:
   $array: 

API Tags:
Access:  private


[ Top ]
getParentPathByIndent  [line 603]

  void getParentPathByIndent( $indent  )

Parameters:
   $indent: 

API Tags:
Access:  private


[ Top ]
isArrayElement  [line 635]

  void isArrayElement( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
isComment  [line 630]

  void isComment( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
isHashElement  [line 644]

  void isHashElement( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
isLiteral  [line 652]

  void isLiteral( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
literalBlockContinues  [line 499]

  void literalBlockContinues( $line, $lineIndent  )

Parameters:
   $line: 
   $lineIndent: 

API Tags:
Access:  private


[ Top ]
load  [line 268]

  void load( $input  )

Parameters:
   $input: 

API Tags:
Access:  private


[ Top ]
loadFromSource  [line 301]

  void loadFromSource( $input  )

Parameters:
   $input: 

API Tags:
Access:  private


[ Top ]
nodeContainsGroup  [line 723]

  void nodeContainsGroup( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
returnArrayElement  [line 713]

  void returnArrayElement( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
returnKeyValuePair  [line 681]

  void returnKeyValuePair( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
returnMappedSequence  [line 663]

  void returnMappedSequence( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
returnMappedValue  [line 670]

  void returnMappedValue( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
revertLiteralPlaceHolder  [line 589]

  void revertLiteralPlaceHolder( $lineArray, $literalBlock  )

Parameters:
   $lineArray: 
   $literalBlock: 

API Tags:
Access:  private


[ Top ]
startsLiteralBlock  [line 566]

  void startsLiteralBlock( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
startsMappedSequence  [line 659]

  void startsMappedSequence( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
startsMappedValue  [line 677]

  void startsMappedValue( $line  )

Parameters:
   $line: 

API Tags:
Access:  private


[ Top ]
stripGroup  [line 738]

  void stripGroup( $line, $group  )

Parameters:
   $line: 
   $group: 

API Tags:
Access:  private


[ Top ]
stripIndent  [line 598]

  void stripIndent( $line, [ $indent = -1]  )

Parameters:
   $line: 
   $indent: 

API Tags:
Access:  private


[ Top ]
_doFolding  [line 251]

  string _doFolding( $value $value, $indent  )

Folds a string of text, if necessary

Parameters:
$value   $value:  The string you wish to fold
   $indent: 

API Tags:
Access:  private


[ Top ]
_doLiteralBlock  [line 234]

  string _doLiteralBlock( $value $value, $indent $indent  )

Creates a literal block for dumping

Parameters:
$value   $value: 
$indent   $indent:  int The value of the indent

API Tags:
Access:  private


[ Top ]
_dumpNode  [line 203]

  string _dumpNode( $key $key, $value $value, $indent $indent  )

Returns YAML from a key and a value

Parameters:
$key   $key:  The name of the key
$value   $value:  The value of the item
$indent   $indent:  The indent of the current node

API Tags:
Access:  private


[ Top ]
_getIndent  [line 318]

  int _getIndent( string $line  )

Finds and returns the indentation of a YAML line

Parameters:
string   $line:  A line from the YAML file

API Tags:
Access:  private


[ Top ]
_inlineEscape  [line 430]

  array _inlineEscape( $inline  )

Used in inlines to check for more inlines or quoted strings

Parameters:
   $inline: 

API Tags:
Access:  private


[ Top ]
_parseLine  [line 330]

  array _parseLine( string $line  )

Parses YAML code and returns an array for a node

Parameters:
string   $line:  A line from the YAML file

API Tags:
Access:  private


[ Top ]
_toType  [line 362]

  mixed _toType( string $value  )

Finds the type of the passed value, returns the value as the new type.

Parameters:
string   $value: 

API Tags:
Access:  private


[ Top ]
_yamlize  [line 160]

  string _yamlize( $key $key, $value $value, $indent $indent  )

Attempts to convert a key / value array item to YAML

Parameters:
$key   $key:  The name of the key
$value   $value:  The value of the item
$indent   $indent:  The indent of the current node

API Tags:
Access:  private


[ Top ]
_yamlizeArray  [line 183]

  string _yamlizeArray( $array $array, $indent $indent  )

Attempts to convert an array to YAML

Parameters:
$array   $array:  The array you want to convert
$indent   $indent:  The indent of the current level

API Tags:
Access:  private


[ Top ]

Documentation generated on Fri, 25 Jul 2008 15:20:03 -0400 by phpDocumentor 1.4.2
Krai Framework site admin credits sitemap valid xhtml?