Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
@@ -2,16 +2,28 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v2.0.0
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2004 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Tue, 21 Sep 2004 16:34:28 GMT
|
||||
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > XML ARCHIVE CLASS: Handling methods (KERNEL)
|
||||
@@ -20,59 +32,134 @@
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
USAGE:
|
||||
*/
|
||||
|
||||
$xmlarchive = new class_xmlarchive();
|
||||
/**
|
||||
* IPS Kernel Pages: XMLArchive
|
||||
*
|
||||
* This class contains all generic functions to handle
|
||||
* the creation and extraction of XML Archive documents
|
||||
* This is a proprietry technology of IPS, Inc.
|
||||
*
|
||||
* Example Usage:
|
||||
* <code>
|
||||
*
|
||||
* $xmlarchive = new class_xmlarchive();
|
||||
*
|
||||
* $xmlarchive->xml_add_file( 'some/dir/filename.html' );
|
||||
* $xmlarchive->xml_add_file_contents( $data, 'some/dir/filename.html' );
|
||||
*
|
||||
* $xmlarchive->xml_add_file( 'some/dir/filename.html', array( 'custom_tag' => $value ) );
|
||||
* $xmlarchive->xml_add_file_contents( $data, 'some/dir/filename.html', array( 'custom_tag' => $value ) );
|
||||
*
|
||||
* $xmlarchive->xml_add_directory( 'some/dir' );
|
||||
* $xmlarchive->xml_create_archive();
|
||||
*
|
||||
* $xmlarchive->xml_save( 'filename.xml' );
|
||||
* $xmlarchive->xml_save_gzip( 'filename.xml.gz' );
|
||||
*
|
||||
* $contents = $xmlarchive->xml_get_contents();
|
||||
*
|
||||
* $xmlarchive->xml_read_archive( 'filename.xml' );
|
||||
* $xmlarchive->xml_read_archive_data( $xml_data );
|
||||
* </code>
|
||||
* ERROR NUMBERS:
|
||||
* <ul>
|
||||
* <li>001: No such directory or file
|
||||
* <li>002: Not a directory
|
||||
* <li>003: Could not write archive to disk
|
||||
* <li>004: No XML document to save
|
||||
* <li>005: Could not load xml data
|
||||
* </ul>
|
||||
*
|
||||
* @package IPS_KERNEL
|
||||
* @author Matt Mecham
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 2.1
|
||||
*/
|
||||
|
||||
$xmlarchive->xml_add_file( 'some/dir/filename.html' );
|
||||
$xmlarchive->xml_add_file_contents( $data, 'some/dir/filename.html' );
|
||||
|
||||
$xmlarchive->xml_add_file( 'some/dir/filename.html', array( 'custom_tag' => $value ) );
|
||||
$xmlarchive->xml_add_file_contents( $data, 'some/dir/filename.html', array( 'custom_tag' => $value ) );
|
||||
|
||||
$xmlarchive->xml_add_directory( 'some/dir' );
|
||||
$xmlarchive->xml_create_archive();
|
||||
|
||||
$xmlarchive->xml_save( 'filename.xml' );
|
||||
$xmlarchive->xml_save_gzip( 'filename.xml.gz' );
|
||||
|
||||
$contents = $xmlarchive->xml_get_contents();
|
||||
|
||||
$xmlarchive->xml_read_archive( 'filename.xml' );
|
||||
$xmlarchive->xml_read_archive_data( $xml_data );
|
||||
|
||||
ERROR NUMBERS:
|
||||
--------------
|
||||
001: No such directory or file
|
||||
002: Not a directory
|
||||
003: Could not write archive to disk
|
||||
004: No XML document to save
|
||||
005: Could not load xml data
|
||||
/**
|
||||
* XMLArchive Creation and Extraction Functions
|
||||
*
|
||||
* Methods and functions for handling XMLArchive documents
|
||||
*
|
||||
* @package IPS_KERNEL
|
||||
* @author Matt Mecham
|
||||
* @version 2.1
|
||||
*/
|
||||
|
||||
class class_xmlarchive
|
||||
{
|
||||
/**
|
||||
* XML content
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $xml = "";
|
||||
|
||||
/**
|
||||
* File array
|
||||
*
|
||||
* @var artay
|
||||
*/
|
||||
var $file_array = array();
|
||||
|
||||
/**
|
||||
* Error number
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
var $error_number = 0;
|
||||
|
||||
/**
|
||||
* Error message
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $error_message = "";
|
||||
|
||||
/**
|
||||
* Work files
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $workfiles = array();
|
||||
|
||||
/**
|
||||
* Non binary file extensions
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $non_binary = 'txt htm html xml css js cgi php php3';
|
||||
|
||||
/**
|
||||
* Strip path
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $strip_path = "";
|
||||
|
||||
/**
|
||||
* Root path
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $root_path = "";
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CONSTRUCTOR
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function class_xmlarchive()
|
||||
function class_xmlarchive( $root_path="" )
|
||||
{
|
||||
$tmp = "";
|
||||
$tmp = "";
|
||||
$this->root_path = $root_path;
|
||||
|
||||
//-----------------------------------
|
||||
// Get the XML class
|
||||
//-----------------------------------
|
||||
|
||||
require_once( 'class_xml.php' );
|
||||
require_once( $this->root_path.'class_xml.php' );
|
||||
|
||||
$this->xml = new class_xml();
|
||||
|
||||
@@ -83,6 +170,12 @@ class class_xmlarchive
|
||||
// READ Archive from disk
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Read an XML document from disk
|
||||
*
|
||||
* @param string File name
|
||||
* @return void
|
||||
*/
|
||||
function xml_read_archive( $filename )
|
||||
{
|
||||
if ( file_exists( $filename ) )
|
||||
@@ -124,6 +217,12 @@ class class_xmlarchive
|
||||
// READ Archive from data
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Read an XML document from passed data
|
||||
*
|
||||
* @param string Raw XML Data
|
||||
* @return void
|
||||
*/
|
||||
function xml_read_archive_data( $data )
|
||||
{
|
||||
if ( $data )
|
||||
@@ -158,13 +257,19 @@ class class_xmlarchive
|
||||
// SAVE XML to disk
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Write out the XML document as a GZIP file
|
||||
*
|
||||
* @param string FIlename
|
||||
* @return void
|
||||
*/
|
||||
function xml_save_gzip( $filename )
|
||||
{
|
||||
if ( $this->xml->xml_document )
|
||||
{
|
||||
if ( $FH = @gzopen( $filename, 'wb' ) )
|
||||
{
|
||||
@gzwrite( $FH, $this->xml->xml_document, strlen( $this->xml->xml_document ) );
|
||||
@gzwrite( $FH, $this->xml->xml_document );
|
||||
@gzclose( $FH );
|
||||
}
|
||||
else
|
||||
@@ -182,13 +287,19 @@ class class_xmlarchive
|
||||
// SAVE XML to disk
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Write out the XML document as a normal file
|
||||
*
|
||||
* @param string FIlename
|
||||
* @return void
|
||||
*/
|
||||
function xml_save( $filename )
|
||||
{
|
||||
if ( $this->xml->xml_document )
|
||||
{
|
||||
if ( $FH = @fopen( $filename, 'wb' ) )
|
||||
{
|
||||
@fwrite( $FH, $this->xml->xml_document, strlen( $this->xml->xml_document ) );
|
||||
@fwrite( $FH, $this->xml->xml_document );
|
||||
@fclose( $FH );
|
||||
}
|
||||
else
|
||||
@@ -206,6 +317,11 @@ class class_xmlarchive
|
||||
// XML get contents
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Method of getting XML document from this class
|
||||
*
|
||||
* @return string XML document
|
||||
*/
|
||||
function xml_get_contents()
|
||||
{
|
||||
return $this->xml->xml_document;
|
||||
@@ -215,6 +331,11 @@ class class_xmlarchive
|
||||
// Create the XML archive
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Create the XML archive
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function xml_create_archive()
|
||||
{
|
||||
$this->xml->xml_set_root( 'xmlarchive', array( 'generator' => 'IPB', 'created' => time() ) );
|
||||
|
||||
Reference in new issue
Block a user