|
| 1 | +<?php |
| 2 | +// =================================================== |
| 3 | +// Load database info and local development parameters |
| 4 | +// =================================================== |
| 5 | +$chassisdir = '/vagrant'; |
| 6 | +if ( file_exists( $chassisdir . '/local-config-db.php' ) ) { |
| 7 | + define( 'WP_LOCAL_DEV', true ); |
| 8 | + include( $chassisdir . '/local-config-db.php' ); |
| 9 | +} |
| 10 | + |
| 11 | +if ( file_exists( $chassisdir . '/local-config.php' ) ) { |
| 12 | + defined('WP_LOCAL_DEV') or define( 'WP_LOCAL_DEV', true ); |
| 13 | + include( $chassisdir . '/local-config.php' ); |
| 14 | +} |
| 15 | + |
| 16 | +// ======================= |
| 17 | +// Load Chassis extensions |
| 18 | +// ======================= |
| 19 | +if ( file_exists( $chassisdir . '/local-config-extensions.php' ) ) { |
| 20 | + include( $chassisdir . '/local-config-extensions.php' ); |
| 21 | +} |
| 22 | + |
| 23 | +// ====================================== |
| 24 | +// Fake HTTP Host (for CLI compatibility) |
| 25 | +// ====================================== |
| 26 | +if ( empty( $_SERVER['HTTP_HOST'] ) ) { |
| 27 | + if ( defined( 'DOMAIN_CURRENT_SITE' ) ) { |
| 28 | + $_SERVER['HTTP_HOST'] = DOMAIN_CURRENT_SITE; |
| 29 | + } |
| 30 | + else { |
| 31 | + $_SERVER['HTTP_HOST'] = 'vagrant.local'; |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +// ======================== |
| 36 | +// Custom Content Directory |
| 37 | +// ======================== |
| 38 | +defined('WP_CONTENT_DIR') or define( 'WP_CONTENT_DIR', $chassisdir . '/content' ); |
| 39 | +defined('WP_CONTENT_URL') or define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/content' ); |
| 40 | + |
| 41 | +// ===================== |
| 42 | +// URL hacks for Vagrant |
| 43 | +// ===================== |
| 44 | +if ( WP_LOCAL_DEV && ! defined('WP_SITEURL') ) { |
| 45 | + define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp'); |
| 46 | + |
| 47 | + if ( ! defined( 'WP_HOME' ) ) { |
| 48 | + define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); |
| 49 | + } |
| 50 | +} |
| 51 | + |
| 52 | +// ================================================ |
| 53 | +// You almost certainly do not want to change these |
| 54 | +// ================================================ |
| 55 | +define( 'DB_CHARSET', 'utf8' ); |
| 56 | +define( 'DB_COLLATE', '' ); |
| 57 | + |
| 58 | +// ============================================================== |
| 59 | +// Table prefix |
| 60 | +// Change this if you have multiple installs in the same database |
| 61 | +// ============================================================== |
| 62 | +if ( empty( $table_prefix ) ) |
| 63 | + $table_prefix = 'sztests_'; |
| 64 | + |
| 65 | +// ===================================== |
| 66 | +// Errors |
| 67 | +// Show/hide errors for local/production |
| 68 | +// ===================================== |
| 69 | +defined( 'WP_DEBUG' ) or define( 'WP_DEBUG', true ); |
| 70 | + |
| 71 | +define( 'WP_TESTS_DOMAIN', 'example.org' ); |
| 72 | +define( 'WP_TESTS_EMAIL', ' [email protected]' ); |
| 73 | +define( 'WP_TESTS_TITLE', 'Test Blog' ); |
| 74 | + |
| 75 | +define( 'WP_PHP_BINARY', 'php' ); |
| 76 | + |
| 77 | +// =================== |
| 78 | +// Bootstrap WordPress |
| 79 | +// =================== |
| 80 | +if ( !defined( 'ABSPATH' ) ) |
| 81 | + define( 'ABSPATH', $chassisdir . '/wp/' ); |
0 commit comments