├── public ├── content │ ├── plugins │ │ └── index.php │ ├── themes │ │ └── index.php │ └── mu-plugins │ │ ├── index.php │ │ └── register-theme-directory.php ├── index.php └── wp-config.php ├── .gitignore ├── .env.example ├── README.md ├── scripts └── GenerateKeysAndSalts.php └── composer.json /public/content/plugins/index.php: -------------------------------------------------------------------------------- 1 | load(); 15 | $dotenv->required( [ 'WPC_DB_HOST', 'WPC_DB_NAME', 'WPC_DB_USER', 'WPC_DB_PASSWORD' ] ); 16 | $dotenv->ifPresent( 'ALLOW_INSECURE' )->isBoolean(); 17 | unset( $dotenv ); 18 | 19 | collect( $_ENV )->keys() 20 | ->filter( fn( $k ) => starts_with( $k, 'WPC_' ) ) 21 | ->map( fn( $k ) => substr( $k, 4 ) ) 22 | ->each( fn( $k ) => defined( $k ) || define( $k, env( "WPC_$k" ) ) ); 23 | 24 | if ( ! env( 'ALLOW_INSECURE', false ) ) { 25 | $_SERVER['HTTPS'] = 'on'; 26 | $_SERVER['SERVER_PORT'] = '443'; 27 | $_SERVER['REQUEST_SCHEME'] = 'https'; 28 | } 29 | $table_prefix = env( 'TABLE_PREFIX', 'wp_' ); 30 | 31 | // =============================================== 32 | // No file edits unless explicitly allowed in .env 33 | // =============================================== 34 | if ( ! defined( 'DISALLOW_FILE_MODS' ) ) { 35 | define( 'DISALLOW_FILE_MODS', true ); 36 | } 37 | 38 | // ======================== 39 | // Custom Content Directory 40 | // ======================== 41 | define( 'WP_CONTENT_DIR', __DIR__ . '/content' ); 42 | $scheme = $_SERVER['REQUEST_SCHEME'] ?? 'http'; 43 | $host = $_SERVER['HTTP_HOST'] ?? 'localhost'; 44 | define( 'WP_CONTENT_URL', "$scheme://$host/content" ); 45 | 46 | // =========== 47 | // Hide errors 48 | // =========== 49 | ini_set( 'display_errors', 0 ); 50 | 51 | // ====================================== 52 | // Load a Memcached config if we have one 53 | // ====================================== 54 | if ( file_exists( __DIR__ . '/../memcached.php' ) ) { 55 | $memcached_servers = require_once __DIR__ . '/../memcached.php'; 56 | } 57 | 58 | // =================== 59 | // Bootstrap WordPress 60 | // =================== 61 | if ( ! defined( 'ABSPATH' ) ) { 62 | define( 'ABSPATH', __DIR__ . '/wp/' ); 63 | } 64 | require_once ABSPATH . 'wp-settings.php'; 65 | --------------------------------------------------------------------------------