Skip to content

Instantly share code, notes, and snippets.

@kevinsmith
Created September 22, 2010 04:40
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinsmith/591155 to your computer and use it in GitHub Desktop.
Save kevinsmith/591155 to your computer and use it in GitHub Desktop.
/*
| Helps determine which settings to use based on the current server.
| Add this to the top of the constants.php file just under the
| opening php tag and copy it over everything down to just above
| the 'File Stream Modes' section. Modify the switches below as
| needed, and add as many switches as your setup requires.
*/
switch($_SERVER['HTTP_HOST'])
{
case 'example1.com':
case 'www.example1.com':
define('SITE', 'live');
break;
case 'example1.dev':
case 'www.example1.dev':
define('SITE', 'expressionengine');
break;
default:
define('SITE', 'live');
break;
}
/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
if (SITE === 'dev')
{
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
}
else
{
// This is for a live server in a suPHP environment. In a standard
// server setup, use the settings recommended in the EE installation
// guide.
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0644);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0755);
}
@kevinsmith
Copy link
Author

Changed 'dev' to 'expressionengine' to make it possible to perform upgrades locally.

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