Skip to content
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

yii utility in cli is evaluating to wrong environment. #73

Closed
tarunjangra opened this issue May 23, 2021 · 4 comments
Closed

yii utility in cli is evaluating to wrong environment. #73

tarunjangra opened this issue May 23, 2021 · 4 comments
Assignees
Labels

Comments

@tarunjangra
Copy link

What steps will reproduce the problem?

Try to execute any cli command with yii utility. Do not pass env variable.

What is the expected result?

As per following line of code in yii file, It should use production environment.

define('YII_ENV', getenv('env') ?? 'production');

What do you get instead?

It is using testing environment. Actually getenv('env') is evaluating to false which is not allowing to return 'production' string in YII_ENV.

Additional info

Q A
Version yii3
PHP version 7.4
Operating system ubuntu
@samdark
Copy link
Member

samdark commented May 23, 2021

How do you execute the command?

@tarunjangra
Copy link
Author

tarunjangra commented May 23, 2021

yii cycle/schema/rebuild it is referring to testing database. However I was expecting it to use production.

@samdark samdark self-assigned this May 23, 2021
@samdark
Copy link
Member

samdark commented May 23, 2021

Got it. I confirm the issue. Will fix that.

@samdark
Copy link
Member

samdark commented May 23, 2021

I've fixed that in application templates and demo:

define('YII_ENV', getenv('env') ?: 'production');

Please fix in your app as well.

@samdark samdark closed this as completed May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants