diff --git a/app/App.php b/app/App.php index 60391c2..faf5bc0 100644 --- a/app/App.php +++ b/app/App.php @@ -1,11 +1,17 @@ + * + * @param string $name The name of the magic method + * @param $arguments The arguments to the magic method * * @return bool */ @@ -36,4 +44,4 @@ public static function __callStatic( $name, $arguments ) { return $env === env( 'WP_ENV' ); } } -} \ No newline at end of file +} diff --git a/config/app.php b/config/app.php index 19e8f41..9277cf8 100644 --- a/config/app.php +++ b/config/app.php @@ -1,5 +1,4 @@ load(); $dotenv->required( [ 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'WP_HOME', 'WP_SITEURL' ] ); @@ -40,36 +39,36 @@ App::define( 'WP_CONTENT_DIR', $webroot_dir . CONTENT_DIR ); App::define( 'WP_CONTENT_URL', WP_HOME . CONTENT_DIR ); -App::define('DB_NAME', env('DB_NAME')); -App::define('DB_USER', env('DB_USER')); -App::define('DB_PASSWORD', env('DB_PASSWORD')); -App::define('DB_HOST', env('DB_HOST') ?: 'localhost'); -App::define('DB_CHARSET', 'utf8mb4'); -App::define('DB_COLLATE', ''); -$table_prefix = env('DB_PREFIX') ?: 'wp_'; +App::define( 'DB_NAME', env( 'DB_NAME' ) ); +App::define( 'DB_USER', env( 'DB_USER' ) ); +App::define( 'DB_PASSWORD', env( 'DB_PASSWORD' ) ); +App::define( 'DB_HOST', env( 'DB_HOST' ) ?: 'localhost' ); +App::define( 'DB_CHARSET', 'utf8mb4' ); +App::define( 'DB_COLLATE', '' ); +$table_prefix = env( 'DB_PREFIX' ) ?: 'wp_'; // Set other constants from env file. -foreach( array_keys($dotenv->load()) as $key ) { - App::define($key, env( $key )); +foreach ( array_keys( $dotenv->load() ) as $key ) { + App::define( $key, env( $key ) ); } -// Environment config +// Environment config. $env_config = __DIR__ . '/environments/' . WP_ENV . '.php'; if ( file_exists( $env_config ) ) { require_once $env_config; } -App::define('AUTOMATIC_UPDATER_DISABLED', true); -App::define('DISABLE_WP_CRON', env('DISABLE_WP_CRON') ?: false); -// Disable the plugin and theme file editor in the admin -App::define('DISALLOW_FILE_EDIT', true); -// Disable plugin and theme updates and installation from the admin -App::define('DISALLOW_FILE_MODS', true); +App::define( 'AUTOMATIC_UPDATER_DISABLED', true ); +App::define( 'DISABLE_WP_CRON', env( 'DISABLE_WP_CRON' ) ?: false ); +// Disable the plugin and theme file editor in the admin. +App::define( 'DISALLOW_FILE_EDIT', true ); +// Disable plugin and theme updates and installation from the admin. +App::define( 'DISALLOW_FILE_MODS', true ); -// Secret keys +// Secret keys. if ( ! file_exists( __DIR__ . '/keys.php' ) ) { $keys = file_get_contents( 'https://api.wordpress.org/secret-key/1.1/salt/' ); - file_put_contents( __DIR__ . '/keys.php', 'register(); \ No newline at end of file +/** + * Bootstrap our site code + */ + +( new DeliciousBrains\SpinupWPComposerSite\App() )->register(); diff --git a/public/index.php b/public/index.php index add0f9f..9e7f348 100644 --- a/public/index.php +++ b/public/index.php @@ -11,7 +11,7 @@ * * @var bool */ -define('WP_USE_THEMES', true); +define( 'WP_USE_THEMES', true ); /** Loads the WordPress Environment and Template */ -require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' ); \ No newline at end of file +require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' ); diff --git a/public/wp-config.php b/public/wp-config.php index 5e4c7ca..ddc003d 100644 --- a/public/wp-config.php +++ b/public/wp-config.php @@ -6,4 +6,4 @@ */ require_once dirname( __DIR__ ) . '/vendor/autoload.php'; require_once dirname( __DIR__ ) . '/config/app.php'; -require_once ABSPATH . 'wp-settings.php'; \ No newline at end of file +require_once ABSPATH . 'wp-settings.php';