flex-env
flex-env copied to clipboard
"env:set" does not support non-alphabetical characters
Did you try to set a value with a plus character? The result will surprise you: .env file:
[email protected] MAIL_PASSWORD=hy6gGbS+ MAIL_ENCRYPTION=tls
Executing command: php artisan env:set MAIL_PASSWORD ABCDEF+
Result file looks like this:
[email protected] MAIL_PASSWORD=ABCDEF+ + MAIL_ENCRYPTION=tls
If your old value has other charaters, you get error: .env file:
[email protected] MAIL_PASSWORD=hy6^gGbS+ MAIL_ENCRYPTION=tls
Executing command: php artisan env:set MAIL_PASSWORD ABCDEF+
got error Could not set the value in your .env file, reverting...
The problem is preg_replace
function...
Ah, well spotted! Seems like you've already identified the bug, can you submit a PR to fix this? If not, I'll have a look at this later next week 🙂
Sorry @svenluijten, a little busy at this time for PR.
No worries @svytas! I'll pick it up as soon as I can make some time 😄
fixed by #38
Hi, still it works strange - looks like I cannot change value if there are no numbers in it:
vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD 2 Successfully set [MAIL_PASSWORD] to [2] in your .env file. vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD 2A Successfully set [MAIL_PASSWORD] to [2A] in your .env file. vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD A2 Successfully set [MAIL_PASSWORD] to [A2] in your .env file. vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD X2 Successfully set [MAIL_PASSWORD] to [X2] in your .env file. vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD X2X Successfully set [MAIL_PASSWORD] to [X2X] in your .env file. vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD X2+X Successfully set [MAIL_PASSWORD] to [X2+X] in your .env file. vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD XX Could not set the value in your .env file, reverting... vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD XXDD Could not set the value in your .env file, reverting... vagrant@homestead:/test$ php artisan env:set MAIL_PASSWORD AA Could not set the value in your .env file, reverting...
That's... very strange. This package desperately needs a rewrite / big refactor anyway, I'll see what I can do!