Skip to Main Content

DevDemon Updater - enable only on localhost

I use the FocusLab Master Config setup to have my sites work in multiple environments. This works really great, however I also use Dev Demon's Updater to update addons and EE. Now I don't want to accidentally use updater on the live or staging site. So how do we prevent this while still being able to use updater on localhost. It's actually really simple.

I use the FocusLab Master Config setup to have my sites work in multiple environments. This works really great, however I also use Dev Demon's Updater to update addons and EE. Now I don't want to accidentally use updater on the live or staging site. So how do we prevent this while still being able to use updater on localhost. It's actually really simple.

From the master config setup open config.master.php and add the following - note 'disable', really this could be anything as long as it's not one of the real options

    
      $env_config['updater']['file_transfer_method'] = 'disable'; // local, ftp, sftp
    
  

Then open config.local.php and add the following - you may need to adjust your third_party system and themes paths. I keep mine in /addons/themes and /addons/system/

    
      // DEVDEMON Updater
 
	$env_config['updater']['file_transfer_method'] = 'local'; // local, ftp, sftp
 
	$env_config['updater']['path_map']['root'] = $base_path; // Document Root
	$env_config['updater']['path_map']['backup'] = $base_path . '/site_backup/'; // Backup Dir
	$env_config['updater']['path_map']['system'] = APPPATH . '../'; // System Dir
	$env_config['updater']['path_map']['system_third_party'] = $base_path . '/addons/system/'; // Third Party dir system dir
	$env_config['updater']['path_map']['themes'] = $base_path    . '/themes/'; // Themes dir
	$env_config['updater']['path_map']['themes_third_party'] = $base_path . '/addons/themes/'; // Third Party dir in themes dir
    
  

Now you can use Updater locally and prevent mistakes from happening on your staging or live environments.