Created
May 29, 2013 11:03
-
-
Save gish/5669510 to your computer and use it in GitHub Desktop.
WP-konfiguration för multistage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define( 'ENVIRONMENT', getenv( 'ENVIRONMENT' ) ? getenv( 'ENVIRONMENT' ) : 'production' ); | |
define( 'DOMAIN', $_SERVER['HTTP_HOST'] ); | |
// Här är default-inställningarna. De kan overridas för varje stage | |
$settings = array( | |
// Sökvägar | |
'WP_SITEURL' => 'http://' . DOMAIN . '/wordpress', | |
'WP_HOME' => 'http://' . DOMAIN, | |
'WP_CONTENT_DIR' => dirname( __FILE__ ) . '/content', | |
'WP_CONTENT_URL' => 'http://' . DOMAIN . '/content', | |
'WP_DEBUG' => false, // Sätts till true i 'development' | |
// Databas | |
'DB_HOST' => '127.0.0.1', | |
'DB_CHARSET' => 'utf8', | |
'DB_COLLATE' => '', | |
'DB_USER' => '', // Ange username | |
'DB_PASSWORD' => '', // Ange password | |
'WP_POST_REVISIONS' => false, // Ta bort revisions | |
); | |
switch ( ENVIRONMENT ) | |
{ | |
case 'development': | |
$settings = array_merge( | |
$settings, | |
array( | |
'DB_NAME' => '', // Ange DB | |
'WP_DEBUG' => true, // Skriver ut PHP warnings | |
) | |
); | |
break; | |
case 'staging': | |
$settings = array_merge( | |
$settings, | |
array( | |
'DB_NAME' => '', // Ange DB | |
) | |
); | |
break; | |
default: // Anta production för allt annat | |
$settings = array_merge( | |
$settings, | |
array( | |
'DB_NAME' => '', // Ange DB | |
) | |
); | |
break; | |
} | |
foreach ( $settings as $name => $value ) | |
{ | |
define( $name, $value ); | |
} | |
// Lägg till salt | |
// https://api.wordpress.org/secret-key/1.1/salt/ | |
exit('Salt saknas'); // Lägg till salt och radera denna rad | |
// Tabell-prefix | |
$table_prefix = 'wp_'; | |
// Språk | |
define( 'WPLANG', '' ); | |
/** Absolute path to the WordPress directory. */ | |
if ( ! defined( 'ABSPATH' ) ) | |
define( 'ABSPATH', dirname( __FILE__ ) . '/wordpress' ); | |
/** Sets up WordPress vars and included files. */ | |
require_once(ABSPATH . '/wp-settings.php' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment