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

Class: XML_XRD_Loader

Source Location: /XML_XRD-0.3.0/src/XML/XRD/Loader.php

Class Overview


File/string loading dispatcher.


Author(s):

Version:

  • Release: @package_version@

Methods


Inherited Variables

Inherited Methods


Class Details

[line 28]
File/string loading dispatcher.

Loads the correct loader for the type of XRD file (XML or JSON). Also provides type auto-detection.



[ Top ]


Method Detail

__construct (Constructor)   [line 30]

XML_XRD_Loader __construct( XML_XRD $xrd)

  • Access: public

Parameters:

XML_XRD   $xrd     

[ Top ]

detectTypeFromFile   [line 109]

string detectTypeFromFile( string $file)

Tries to detect the file type (xml or json) from the file content
  • Return: File type ('xml' or 'json')
  • Throws: XML_XRD_Loader_Exception When opening the file fails.
  • Access: public

Parameters:

string   $file     File name to check

[ Top ]

detectTypeFromString   [line 139]

string detectTypeFromString( string $str)

Tries to detect the file type from the content of the file
  • Return: File type ('xml' or 'json')
  • Throws: XML_XRD_Loader_Exception When the type cannot be detected
  • Access: public

Parameters:

string   $str     Content of XRD file

[ Top ]

getLoader   [line 85]

XML_XRD_Loader getLoader( string $type)

Creates a XRD loader object for the given type
  • Access: protected

Parameters:

string   $type     File type: xml or json

[ Top ]

loadFile   [line 49]

void loadFile( string $file, [string $type = null])

Loads the contents of the given file.

Note: Only use file type auto-detection for local files. Do not use it on remote files as the file gets requested several times.

  • Throws: XML_XRD_Loader_Exception When the file is invalid or cannot be loaded
  • Access: public

Parameters:

string   $file     Path to an XRD file
string   $type     File type: xml or json, NULL for auto-detection

[ Top ]

loadString   [line 69]

void loadString( string $str, [string $type = null])

Loads the contents of the given string
  • Throws: XML_XRD_Loader_Exception When the string is invalid or cannot be loaded
  • Access: public

Parameters:

string   $str     XRD string
string   $type     File type: xml or json, NULL for auto-detection

[ Top ]


Documentation generated on Fri, 26 Apr 2013 21:00:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.