-2

I have two things in place.

  1. Just a normal, run of the mill wordpress site, userspice.com

  2. A downloadable php script called UserSpice that is used for managing users/controlling access to pages, etc. It's a complete PDO/OOP rewrite of UserCake. It is going through a lot of updates and features are being added weekly. UserSpice 4 has a dashboard for the administrator to administrate things. I would like the dashboard to be able to phone home to UserSpice.com to check what the latest version of UserSpice (the php app) is and offer to download the update.

I have searched extensively, but most searches involve updating the php version, NOT the app itself. Is there a particular phone home api or something like that which is built specifically for this purpose. I would assume it would involve just putting a version.txt or xml file in the root of userspice.com that contains the current version, but ideally I would want it to phone home at some sort of interval so as not to bring the userspice.com server down with useless requests.

Dan Hoover
  • 235
  • 1
  • 14

1 Answers1

0

I tend to embed a constant in the code with the current version number and update it as necessary (usually manually to match notes in a version history page). That makes it easy to put the version on the screen and use it in code logic.

That's better both because you don't have to read the file and it's one less component to manage and distribute.

"Phone home" is then implemented using a web api call that compares the internal constant with the return value from the api call to your central website. That can be called from jquery so that it doesn't slow down the page load. A couple of seconds after the admin page loads something would display in the header with the "new version" message attached.

christutty
  • 952
  • 5
  • 12
  • So how would I have this check my website to make sure that what they have is the ACTUAL latest version? It's a downloadable/installable PHP User Management framework, so I'm not pushing out updates to it automatically. – Dan Hoover Feb 10 '16 at 02:03
  • Ahh, I've seen systems that use a text file in the deployed system that has the current version but when you say "root of my website" you mean the central management web site rather than the deployed client web site. I'd assumed that your "phone home" would be a web api call so misunderstood you completely. Is there a reason you're not using web api to call home? – christutty Feb 10 '16 at 02:19
  • Right. I was talking about the project website. I'm sorry. I knew this was going to be a pretty vague question because I'm looking for direction. Is there a particular api I should look at? – Dan Hoover Feb 10 '16 at 02:32
  • No, I'm just thinking of a simple AJAX method on your home site that would return a JSON package with the most recent version. Nothing fancy but it can be called from jquery so doesn't slow down the page load. – christutty Feb 10 '16 at 02:39
  • That sounds good to me. Thanks! – Dan Hoover Feb 10 '16 at 14:31