Skip to content

Fix #417: Add .env for development without Docker#458

Open
samdark wants to merge 7 commits intomasterfrom
dotenv
Open

Fix #417: Add .env for development without Docker#458
samdark wants to merge 7 commits intomasterfrom
dotenv

Conversation

@samdark
Copy link
Copy Markdown
Member

@samdark samdark commented Apr 5, 2026

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ❌ (it is app template)
Fixed issues #417, #395

@samdark samdark requested review from Copilot and vjik April 5, 2026 10:29
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.08%. Comparing base (59f7c2f) to head (5faa705).

Files with missing lines Patch % Lines
src/bootstrap.php 0.00% 4 Missing ⚠️
yii 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #458      +/-   ##
============================================
+ Coverage     76.96%   85.08%   +8.11%     
  Complexity       29       29              
============================================
  Files            11       11              
  Lines           178      181       +3     
============================================
+ Hits            137      154      +17     
+ Misses           41       27      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class .env support so the template works out-of-the-box in non-Docker local/dev environments (and defaults safely in production), addressing issues around missing/invalid APP_ENV.

Changes:

  • Introduce src/bootstrap.php to centralize autoloading + environment initialization and load .env via vlucas/phpdotenv.
  • Switch console (yii) and web (public/index.php) entrypoints to use the new bootstrap.
  • Document .env usage, add .env.example, ignore .env, and add the new dependency.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yii Uses shared bootstrap instead of removed autoload script.
public/index.php Uses shared bootstrap so .env is loaded for web execution.
src/bootstrap.php New bootstrap: composer autoload + dotenv safeLoad + Environment::prepare().
src/autoload.php Removed in favor of src/bootstrap.php.
src/Environment.php Adjusts defaulting/error handling for APP_ENV.
composer.json Adds vlucas/phpdotenv dependency.
README.md Documents copying .env.example to .env and running without explicit APP_ENV=dev.
CHANGELOG.md Records enhancement for issue #417.
.gitignore Ignores .env.
.env.example Provides a default dev .env template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants