com-tecnick-tmxphpbridge
[ class tree: com-tecnick-tmxphpbridge ] [ index: com-tecnick-tmxphpbridge ] [ all elements ]

Class: TMXResourceBundle

Source Location: /shared/code/tce_tmx.php

Class Overview


This PHP Class reads resource text data directly from a TMX (XML) file.


Author(s):

  • Nicola Asuni [www.tecnick.com]

Version:

  • 1.1.005

Copyright:

  • Copyright (c) 2004-2010 - Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) - Via della Pace n.11 - 09044 Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com

Variables

Methods



Class Details

[line 61]
This PHP Class reads resource text data directly from a TMX (XML) file.

First, the XMLTMXResourceBundle class instantiates itself with two parameters: a TMX file name and a target language name. Then, using an XML parser, it reads all of a translation unit's properties for the key information and specified language data and populates the resource array with them (key -> value).




Tags:

author:  Nicola Asuni [www.tecnick.com]
version:  1.1.005
copyright:  Copyright (c) 2004-2010 - Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) - Via della Pace n.11 - 09044 Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
link:  http://tmxphpbridge.sourceforge.net
abstract:  TMX-PHP Bridge Class
name:  TMXResourceBundle
license:  LGPL


[ Top ]


Class Variables

$cachefile =  ''

[line 103]



Tags:

var:  filename for cache
access:  private

Type:   string


[ Top ]

$current_data =  ''

[line 79]



Tags:

var:  Current data value.
access:  private

Type:   string


[ Top ]

$current_key =  ''

[line 73]



Tags:

var:  Current tu -> tuid value.
access:  private

Type:   string


[ Top ]

$current_language =  ''

[line 85]



Tags:

var:  Current tuv -> xml:lang value.
access:  private

Type:   string


[ Top ]

$language =  ''

[line 97]



Tags:

var:  ISO language identifier (a two- or three-letter code)
access:  private

Type:   string


[ Top ]

$resource = array()

[line 67]



Tags:

var:  Array used to contain key-translation couples.
access:  private

Type:   array


[ Top ]

$segdata =  false

[line 91]



Tags:

var:  Is TRUE when we are inside a seg element
access:  private

Type:   boolean


[ Top ]



Class Methods


constructor __construct [line 111]

TMXResourceBundle __construct( string $tmxfile, string $language, [string $cachefile = ''])

Class constructor.



Tags:

access:  public


Parameters:

string   $tmxfile   TMX (XML) file name
string   $language   ISO language identifier (a two- or three-letter code)
string   $cachefile   set filename for cache (leave blank to exclude cache)

[ Top ]

destructor __destruct [line 160]

void __destruct( )

Class destructor; resets $resource array.



Tags:

access:  public


[ Top ]

method endElementHandler [line 205]

void endElementHandler( resource $parser, string $name)

Sets the end element handler function for the XML parser parser.end_element_handler.



Tags:

access:  private


Parameters:

resource   $parser   The first parameter, parser, is a reference to the XML parser calling the handler.
string   $name   The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.

[ Top ]

method getResource [line 255]

Array. getResource( )

Returns the resource array containing the translated word/sentences.



Tags:

access:  public


[ Top ]

method segContentHandler [line 241]

void segContentHandler( resource $parser, string $data)

Sets the character data handler function for the XML parser parser.handler.



Tags:

access:  private


Parameters:

resource   $parser   The first parameter, parser, is a reference to the XML parser calling the handler.
string   $data   The second parameter, data, contains the character data as a string.

[ Top ]

method startElementHandler [line 171]

void startElementHandler( resource $parser, string $name, array $attribs)

Sets the start element handler function for the XML parser parser.start_element_handler.



Tags:

access:  private


Parameters:

resource   $parser   The first parameter, parser, is a reference to the XML parser calling the handler.
string   $name   The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters.
array   $attribs   The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on.

[ Top ]


Documentation generated on Mon, 06 Dec 2010 12:03:07 +0100 by phpDocumentor 1.4.3