PHP Server check for application updates

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MrGibbage
Forum Newbie
Posts: 3
Joined: Tue Jun 28, 2011 2:32 pm

PHP Server check for application updates

Post by MrGibbage »

I have some applications that I have written in C#, and I host them on my personal website. I would like to put some code in my C# applications that would check a server to see if that is the latest version of the application. I figured this wouldn't be too hard to do in PHP, but I would still like to see what is out there first. However, this is a really hard thing to search for. Anyone seen any decent PHP scripts for such a thing?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP Server check for application updates

Post by Celauran »

Can't imagine it would be terribly difficult. Assuming you've got a database table containing the names of your apps and their latest versions, maybe have the app send an XML POST to the server containing the name and version of the application sending the request, use that information to query the database, then send back a response as to whether or not an update is available.
MrGibbage
Forum Newbie
Posts: 3
Joined: Tue Jun 28, 2011 2:32 pm

Re: PHP Server check for application updates

Post by MrGibbage »

Yeah, that's pretty much what I was going to do tonight, but I figured if someone had already done it, perhaps with a handful of configuration options that I hadn't thought of, then why not. But yeah, this shouldn't be too hard at all.
MrGibbage
Forum Newbie
Posts: 3
Joined: Tue Jun 28, 2011 2:32 pm

Re: PHP Server check for application updates

Post by MrGibbage »

Well, I did decide to just do it up myself. In case someone finds this thread in search of a similar solution, I did put a post on my blog with the code to make it work.
http://skipstechtalk.net/2011/06/29/che ... t-version/
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: PHP Server check for application updates

Post by pickle »

That's an awful lot of work. The simplest solution would be to simply create a file that contains the latest version. Then, rather than worry about parsing XML, you just read the contents of the file. The work the server has to do is much less as well (no PHP invocation, no database querying)
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply