Author Topic: Best methods to update deployed CMS's on external servers?  (Read 845 times)

0 Members and 1 Guest are viewing this topic.

Offline SomeFunkyDudeTopic starter

  • Irregular
  • Posts: 4
    • View Profile
Best methods to update deployed CMS's on external servers?
« on: December 03, 2008, 01:23:45 AM »
I want to create a CMS, and when the user logs in to update their photos or post news messages etc. they get a news feed from my server that lets them know if there's an update or upgrade for their CMS. Client needs will vary so I'll have to alter the CMS for each client, but my question is what is the best way to update their version of the CMS after it's deployed and possibly not on my server.

Lets say there's a security issue with the login system, I want to have a way of when they log in next time to update their site, get a notification of a necessary update. This update would then create an entirely new php login script or update the existing one.

I thought about possibly transporting the update by XML, by say a news feed of some sort, then parse the XML file into fwrite to write the new script to their file directory.

I think including files from remote servers is possible, but a feature that I think for security reasons most hosting companies disable. It is possible though to have a php script that parses XML data then writes the data to a new php file (I think), though I'm not sure if this is the best method.

Here's a test script I wrote, it uses php to fwrite a new file and the contents are actually a php script, so if you run the script it creates a script that multiplies 3x3.

Code: [Select]
<?php

$file 
"multiply.php";
$handle fopen($file'w') or die("error dude");
$message "<?php\n";
$message .= "\$result = (3 * 3);\n";
$message .= "echo \$result;\n";
$message .= "?>
";
fwrite($handle, $message);
fclose($handle);
echo "File ".$file." successfully created! View it <a href=\"".$file."\">here</a>.";

?>

Does anyone have any thoughts on this issue of remote updates to external applications that you've previously created for clients?
« Last Edit: December 03, 2008, 01:27:26 AM by SomeFunkyDude »

Offline dclamp

  • Enthusiast
  • Posts: 101
  • Gender: Male
    • View Profile
Re: Best methods to update deployed CMS's on external servers?
« Reply #1 on: December 03, 2008, 01:30:28 AM »
i would use an xml file that includes update information. It should have the files that have been modified.

When the user checks their CP, it will say "You need an update". The user can then choose to update or not. If they update, they should allow you to FTP the files from your server to their document root.

Offline corbin

  • Guru
  • Freak!
  • *
  • Posts: 7,951
  • Gender: Male
    • View Profile
Re: Best methods to update deployed CMS's on external servers?
« Reply #2 on: December 03, 2008, 05:22:11 PM »
A versioning system like SVN could make this easier.  (It might not be able to be as automated as easily then though.)


One way to do it would be to just have a file on a remote server that reads out files to the client computer.  Process:

-client requests file list from server, along with MD5 hashes
-server returns list/hashes
-client:
foreach(local file that doesn't match the hash) {
    download file from remote server and overwrite local file with it.
}
Why doesn't anyone ever say hi, hey, or whad up world?