Skip to content

Feature request: ability to customize path to .env #11894

Closed Answered by brandonkelly
tomdavies asked this question in Ideas
Discussion options

You must be logged in to vote

Just added support for a CRAFT_DOTENV_PATH constant, for Craft 4.3. (e28fc5d)

Alternatively, you can point CRAFT_BASE_PATH to the top level directory, and override the config/, storage and templates/ directory path constants (rather than CRAFT_COMPOSER_PATH and CRAFT_VENDOR_PATH):

$basePath = __DIR__;

// Define path constants
define('CRAFT_BASE_PATH', dirname($basePath));
define('CRAFT_CONFIG_PATH', "$basePath/config");
define('CRAFT_STORAGE_PATH', "$basePath/storage");
define('CRAFT_TEMPLATES_PATH', "$basePath/templates");

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tomdavies
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants