Jump to content

XML/PHP Help


LemonInflux

Recommended Posts

I'm creating some software, and on it I have an XML-controlled updater. Within the XML file, I have blocks like this:

 

<updates>

  <update>

    <title>Update</title>

    <author>Bob</author>

    <desc>A short description</desc>

<nfile>file.php</nfile>

<path>http://www.mysite.com/update.txt</path>

  </update>

</updates>

 

This works fine. On the control panel screen, it looks like this:

 

Update by Bob

 

A short description.

 

Files to be updated: file.php

 

-------

 

However, I've discovered some problems.

 

Every time someone goes to check for updates, all updates are installed, even if they have been already, which can cause some conflicts. So, I need to think of some kind of way to, in effect, 'check' the new updates, and install them from oldest to most recent. To do this, I considered a system whereby the user has an xml file, and a php script gets new updates from my site and puts it into their XML, the only difference between mine and theirs being theirs will have another tag within the <update></update>:

 

<installed></installed>

 

This will have yes or no. This will tell the php whether or not to update/install updates.

 

So, my question to you is, what's the easiest way of doing this? Does anyone have any better ideas? Or, if not, any idea how I'd go about this? I thought about fwrite, but there'd need to be a way to distinguish between each block, and I thought there might be some php xml commands that could help me with this.

 

Thanks in advance,

 

Tom.

Link to comment
Share on other sites

and I thought there might be some php xml commands that could help me with this.

 

If you're using php 5: www.php.net/simplexml - i think example 9 is what you're after.

 

Otherwise: www.php.net/xml

 

Must admit, i didn't read the whole post, but it might point you in the right direction.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.