Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error

Location/Reading custom xml files - Printable Version
The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error



Official Murl Engine Forum
Location/Reading custom xml files - Printable Version

+- Official Murl Engine Forum (https://murlengine.com/forum)
+-- Forum: Murl Engine (https://murlengine.com/forum/forumdisplay.php?fid=5)
+--- Forum: General (https://murlengine.com/forum/forumdisplay.php?fid=8)
+--- Thread: Location/Reading custom xml files (/showthread.php?tid=15)



Location/Reading custom xml files - Arami - 05 May 2013

Hi,

I have some questions regarding custom xml files.

What I want is to read custom xml config files.
I guess the perfect location would be inside .murlres package.

Reading and parsing xml files using Murl::Util::FileTools::LoadBinaryFile and Murl::Util::XmlParser works great, but my question is how to open the file when it's inside a .murlres package?

If the .murlres package is the wrong choice what would be the right one?

thx

Andreas


RE: Location/Reading custom xml files - dizzy - 06 May 2013

The .murlres package can easily be used to host any type of custom files. Simply specify your resource inside the package.xml file using the type="BINARY" attribute:
<?xml version="1.0" ?>
<Package id="Main">
    <Resource type="BINARY" id="MyXmlFile" fileName="my_fancy_file.xml"/>
</Package>

You can then access that file from e.g. a logic class' OnInit() method like this:
Bool App::MyLogic::OnInit(const Logic::IState* state)
{
    const Resource::ICollection* resourceCollection = state->GetResourceCollection();
    const Resource::IBinary* myXmlFile = resourceCollection->GetBinary("Main:MyXmlFile");

	const ConstData& myXmlFileDataObject = myXmlFile->GetData();
    
	const UInt8* data = myXmlFileDataObject.GetData();
	UInt32 byteSize = myXmlFileDataObject.GetByteSize();

	// Do something useful...

    return true;
}



RE: Location/Reading custom xml files - Arami - 06 May 2013

Thank you!!!

Thats exactly what I want/need!

Andreas