Hi Everyone,
I am diving into CI v4 after using CI v3 and v2. Learning and liking it the more I use it. Keep up the great work CI dev team.
I am using XAMPP with virtual hosts for local development. I have the CI public folder in the XAMPP htdocs directory and both the
application and
system directories outside the public directory, and renamed to suit the project. Configuration paths are all set and sites work.
If CI expects .env to be named as such, and in the same directory as the
application and
system folders, I can only have one .env file 'active' at a time while developing on localhost.
To be able to develop across multiple projects at the same, the only way I see of referencing the .env file is modifying its name and replacing / extending the System's Config\DotEnv class and passing a new name in the constructor.
PHP Code:
public function __construct(string $path, string $file = '.env_project_name')
{
$this->path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
}
Is the best way to go about it?