Closed alphabraga closed 9 years ago
Oh man, shame on us :blush:
The way Respect/Config currently works, there is no way not to expand your password. We've tryied to be careful not to cause any problems of this kind just to be shot in the face by it some time later.
This is an edge case, but it is indeed something we want to consider and allow. I will try to go through some possible solutions I came up with.
We could use a scape char (like "\"), preventing expansion:
password = "pa\[s\]sw\[o\]r\\d"
The good part of that approach is that it becomes pretty clear what we want to scape and prevent, without producing unexpected effects. The problems with that approach is introducing something new to the syntax we tried to keep as clean as possible.
This is tricky one, it doesn't involve changing the syntax but it may produce some other edge cases I am not aware of:
; will not be expanded
password = "pas[s]word"
; [db_host] and [db_name] will be expanded
pdo_dsn = "mysql:host=[db_host];dbname=[db_name]"
; will expand [pdo_dsn] and [password]
pdo_args = [[pdo_dsn], "dbuser", [password]]
Is that I have none. I would like some opinions and more ideas on this before jumping over any solution.
While we don't come up with a solution, there is a simple workaround:
pass_1 = p[
pass_2 = a]ss[
pass_3 = w]0rd
password = [pass_1][pass_2][pass_3]
You could also avoid the problem and store the password encoded in base64 and decode it when you retrieve:
password_base64 = cFthXXNzW3ddMHJk
Hi. First of all, thanks for the great and simple configuration library.
In my config file: password = 'p[a]ss[w]0rd'
Wen I load my .ini file with respect/config he try to expand the password var. And i got some not found indexes errors....
I dont want expand my password