-
-
Notifications
You must be signed in to change notification settings - Fork 23
Add dotenv #321
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
Add dotenv #321
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| DBA_HOST=mysql80.ab | ||
| DBA_USER=testuser | ||
| DBA_PASSWORD=test | ||
| DBA_DATABASE=phpstan_dba | ||
| DBA_MODE=recording | ||
| DBA_REFLECTOR=mysqli |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,5 @@ composer.lock | |
|
|
||
| mysqli.php | ||
| pdo.php | ||
|
|
||
| .env | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,17 @@ | ||
| <?php | ||
|
|
||
| use Dotenv\Dotenv; | ||
| use staabm\PHPStanDba\QueryReflection\QueryReflection; | ||
| use staabm\PHPStanDba\QueryReflection\RuntimeConfiguration; | ||
| use staabm\PHPStanDba\Tests\ReflectorFactory; | ||
|
|
||
| require_once __DIR__.'/../../../vendor/autoload.php'; | ||
|
|
||
| if (false === getenv('GITHUB_ACTION')) { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
another question: does the dotenv class automatically load the .env.dist file now? does it work for you locally?
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh I get it now. I need to copy the .env.dist file to .env once.. it works now
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, the .dist file is supposed to be like a template for the envs.. But it's commonly used so some defaults / test setup can be blaced in dist and setup from the existing file..
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I am used to a process where the .dist file is automtically picked up, without the need to copy it a priori. but thats fine. thanks for the work you put into it here. I will merge it. |
||
| $dotenv = Dotenv::createImmutable(__DIR__.'/../../..'); | ||
| $dotenv->load(); | ||
| } | ||
|
|
||
| $config = RuntimeConfiguration::create(); | ||
| $config->errorMode(RuntimeConfiguration::ERROR_MODE_EXCEPTION); | ||
| // $config->debugMode(true); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.