CodeIgniter Forums

Full Version: Version/System update notifications
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi folks,

Is there any way I can receive notifications (perhaps via email) when there is a CI system update?

Thanks.
I believe that there is an RSS channel, you would need to ask the administrator for the link.
(08-21-2017, 01:30 AM)n2fole00 Wrote: [ -> ]Hi folks,

Is there any way I can receive notifications (perhaps via email) when there is a CI system update?

Thanks.

https://github.com/bcit-ci/CodeIgniter/releases.atom
(08-21-2017, 02:45 AM)Paradinight Wrote: [ -> ]https://github.com/bcit-ci/CodeIgniter/releases.atom

Thanks, I made this little script to keep me updated.

PHP Code:
<?php

/** 
 * Check CodeIgniter release for updates - Run as a cron job
 */

$local_version_file 'ci_version.txt'
if(!
file_exists($local_version_file)) { file_put_contents($local_version_file''); } // create for first run

$update_feed_address 'https://github.com/bcit-ci/CodeIgniter/releases.atom';
$xmlstr file_get_contents($update_feed_address);
$feed = new SimpleXMLElement($xmlstr);
$latest_version  $feed->entry[0]->id;

$file_contents file_get_contents($local_version_file); 
if(empty(
$file_contents)) { file_put_contents($local_version_file$latest_version); } // empty on first run 

if(strcmp($latest_version$file_contents) !== 0) { 
 
   // Release versions not matched - therefore new version available. Send notification 
 
   $to "your.mail@gmail.com";
 
   $subject "CodeIgniter Update Available";
 
   $txt "There is a CodeIgniter update available. Version: " $latest_version;
 
   $headers "From: admin@yourdomain.tk" "\r\n"// . "CC: somebodyelse@example.com";

 
   if(!mail($to,$subject,$txt,$headers)) { echo "Failed to send mail."; } 
    
    
file_put_contents($local_version_file$latest_version); // add the latest version back to the local datastore