Skip to content

Instantly share code, notes, and snippets.

@davidalexander
Last active October 4, 2015 22:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidalexander/2711848 to your computer and use it in GitHub Desktop.
Save davidalexander/2711848 to your computer and use it in GitHub Desktop.
Magento developer subdomains
/**
* Set developer mode and display_errors based on subdomain
*/
$staging_subdomains = array(
's1',
's2',
's3',
's4',
's5',
'mac',
'local',
'staging',
'dev',
'development',
'live',
);
foreach ($staging_subdomains as $needle) {
if (strpos($_SERVER['SERVER_NAME'], $needle . '.') === 0) {
Varien_Profiler::enable();
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
break;
}
}
@davidalexander
Copy link
Author

This code should be added after #Varien_Profiler::enable(); in index.php

@davidalexander
Copy link
Author

Code now enables Varien_Profiler::enable(); which needs to be enabled in system configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment