Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bedrock v2 #764

Open
4 tasks
retlehs opened this issue Feb 20, 2025 · 2 comments
Open
4 tasks

Bedrock v2 #764

retlehs opened this issue Feb 20, 2025 · 2 comments
Assignees

Comments

@retlehs
Copy link
Member

retlehs commented Feb 20, 2025

Bedrock will be getting a major version update 💥 We'll be making changes to the directory structure and configuration system to better align with modern PHP practices.

These directory changes mean we'll need to update Trellis to accommodate the new structure. It will also mean we'll need to update any other tools that interact with Bedrock sites, such as Valet/Herd drivers, deployment scripts, docs/tutorials, etc.

Directory structure

  • Rename web/ directory to public/ to better align with modern PHP practices
  • Make the app/ directory (wp-content) the public web root 🔨

Configuration

  • Adopt wp-config v2
    • New fluent configuration API
    • Simplified environment handling
  • Drop WP_ENV in favor of WordPress core's WP_ENVIRONMENT_TYPE

Bedrock v1:

├── composer.json
├── config/
│   ├── application.php     # Primary wp-config
│   └── environments
│       ├── development.php
│       ├── staging.php
│       └── production.php
├── vendor/                 # Composer dependencies
└── web/                    # Public document root
    ├── app/                # WordPress content dir
    │   ├── mu-plugins/
    │   ├── plugins/
    │   ├── themes/
    │   └── uploads/
    ├── index.php
    ├── wp-config.php
    └── wp/                 # WordPress core

Bedrock v2:

├── config.php              # Primary wp-config
├── composer.json
├── vendor/                 # Composer dependencies
└── public/                 # Public document root (renamed from web/)
    ├── index.php
    ├── wp-config.php       # Required wp-config.php from WordPress, loads our wp-config.php from the project root
    ├── mu-plugins/
    ├── plugins/
    ├── themes/
    ├── uploads/
    └── wp/                 # WordPress core
@retlehs retlehs self-assigned this Feb 20, 2025
@dalepgrant
Copy link

dalepgrant commented Feb 21, 2025

How set are you on the names? Having two files as wp-config.php will get confusing, you're already referring to them as 'primary' and 'required' to differentiate. The one required by WP is obviously going to have to stay as wp-config.php; could the other change to just config.php, or app-config.php? 🤷‍♂

 ├── composer.json
 ├── vendor/                 # Composer dependencies
-├── wp-config.php           # Primary wp-config
+├── config.php              # Consolidated config
 └── public/                 # Public document root (renamed from web/)
     ├── index.php
     ├── wp-config.php       # Required wp-config.php from WordPress, loads our config.php from the project root
     ├── mu-plugins/
     ├── plugins/
     ├── themes/
     ├── uploads/
     └── wp/                 # WordPress core

Edit: make diff clearer

@retlehs
Copy link
Member Author

retlehs commented Feb 21, 2025

@dalepgrant Great idea, thank you! 🙏 Just updated the OP

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

No branches or pull requests

2 participants