Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Skeleton layout fundamentally broken. ABSPATH already set. #579

Open
@crazyjaco

Description

@crazyjaco

Hello. I am trying to see if this box will work with my company's WordPress theme.
I am using a Skeleton layout to abstract my content folder from core.

I am noticing the following lines in the wp-config.php in the www folder:

if ( ! defined( 'ABSPATH' ) ) {
	if ( 'standard' === BOX_DIRECTORY_LAYOUT ) {
		define( 'ABSPATH', dirname( __FILE__ ) . '/' );
	} else if ( 'skeleton' === BOX_DIRECTORY_LAYOUT ) {
		define( 'ABSPATH', dirname( __FILE__ ) . '/wp/' );
	}
}

Unfortunately, it will never enter this logic because ABSPATH will always be defined before the wp-config.php file is loaded.
ABSPATH is set in the wp-load.php just before it then loads wp-config.php.

This means a skeleton layout will always break. :\

Even if I changed the above snippet to:

if ( 'skeleton' === BOX_DIRECTORY_LAYOUT ) {
		define( 'ABSPATH', dirname( __FILE__ ) . '/wp/' );
}

This wouldn't work either because then you are setting a constant twice, which will throw a php error.

There is no way to use a skeleton layout using a wp-config.php file within a separate wordpress install.
The wp-config.php needs to be in a parent directory of core.

This a fundamental architecture problem and I'm not sure there is a quick solution, not having worked in this box for more than a few hours.

I get further by deleting all the wordpress files in the root of www except the wp-config files and navigating to my.hostname/wp, but then there is a problem in the wp-config.php trying to get the correct hostname.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions