IP.Board  3.3.0
classXMLArchive Class Reference

Public Member Functions

 __construct ()
 add ($data, $saveName='')
 addData ($data, $filename, $extra_tags=array())
 addDir ($dir)
 addDirectory ($dir)
 addFile ($filename, $extra_tags=array())
 addRootTagValues ($array=array())
 allowHiddenFiles ()
 asArray ()
 countFileArray ()
 getArchiveContents ()
 getFile ($key)
 read ($filename)
 readXML ($data)
 save ($filename)
 saveGZIP ($filename)
 setStripPath ($path)
 write ($input, $basePath='/')

Data Fields

 $_fileArray = array()
 $_stripPathString = ""
 $_workFiles = array()
 $error_message = ""
 $error_number = 0
 $non_binary = 'txt htm html xml css js cgi php php3'

Protected Member Functions

 _create ()
 _getDirContents ($dir)
 _stripPath ($path)
 _writeContents ($path, $content)

Protected Attributes

 $_allowHiddenFiles = FALSE
 $_defaultRootValues = array()
 $_xml = null

Constructor & Destructor Documentation

Constructor

Parameters:
stringScript root path
Returns:
void

Member Function Documentation

_create ( ) [protected]

Create the XML archive

Returns:
void
_getDirContents ( dir) [protected]

Get directory contents

Parameters:
stringDirectory
Returns:
boolean
_stripPath ( path) [protected]

Strip path information from the real path

Parameters:
stringInput path
Returns:
string
_writeContents ( path,
content 
) [protected]

Write contents of a file to disk Creates directories, etc as it goes

Parameters:
stringPath with filename to write to
stringData to write
Returns:
boolean
add ( data,
saveName = '' 
)

Main "Add" function handles a lot of stuff. It's good like that!

Parameters:
stringFilename or data
stringFile to store as
Returns:
mixed
addData ( data,
filename,
extra_tags = array() 
)

Add filecontents to archive

Parameters:
stringFile data
stringFile name
arrayExtra tags
Returns:
void
addDir ( dir)

Shorthand function

Returns:
mixed
See also:
addDirectory()
addDirectory ( dir)

Add directory to archive

Parameters:
stringDirectory to add
Returns:
mixed
Exceptions:
Exception
addFile ( filename,
extra_tags = array() 
)

Add file to archive

Parameters:
stringFile to add
arrayExtra tags
Returns:
mixed
addRootTagValues ( array = array())

Adds values to the root tag

Returns:
void

Allow hidden files to be added when using addDir

Returns:
void
asArray ( )

Return file data as array

Returns:
array

Return number of files contained in the expanded archive

Returns:
integer

Method of getting XML document from this class

Returns:
string XML document
getFile ( key)

Return a file from the fileArray

Parameters:
stringKey
Returns:
string
read ( filename)

Read an XML document from disk

Parameters:
stringFile name
Returns:
void
readXML ( data)

Read an XML document from passed data

Parameters:
stringRaw XML Data
Returns:
void
save ( filename)

Write out the XML document as a normal file

Parameters:
stringFIlename
Returns:
void
saveGZIP ( filename)

Write out the XML document as a GZIP file

Parameters:
stringFilename
Returns:
void
setStripPath ( path)

Set the path to 'strip' from the path data

Parameters:
stringFull path to remove
Returns:
void
write ( input,
basePath = '/' 
)

Write the archive back to disk

Note: Ensure that if you intend to make XMLArchives available for others that you create it with setStripPath otherwise you may get unexpected results!

Parameters:
mixedFilename (must end with .xml or .gz) or raw data
stringBase path to write to
Returns:
boolean
Exceptions:
ExceptionException Codes: WRITE_NOT_VALID_INPUT The input (XML or filename) is not valid NO_FILES_TO_WRITE The archive contains nothing to write back

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables