mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Improved dotEnv parse of boolean value. (yes,1,true,no,0,false)
This commit is contained in:
parent
5c3c0565e8
commit
595fa907e6
@ -346,7 +346,16 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
if not TryStrToBool(lTmp.Trim, Result) then
|
||||
lTmp := lTmp.Trim.ToLower;
|
||||
if (lTmp = 'yes') or (lTmp='1') or (lTmp='true') then
|
||||
begin
|
||||
Exit(True);
|
||||
end;
|
||||
if (lTmp = 'no') or (lTmp='0') or (lTmp='false') then
|
||||
begin
|
||||
Exit(False);
|
||||
end;
|
||||
if not TryStrToBool(lTmp, Result) then
|
||||
begin
|
||||
raise EMVCDotEnv.CreateFmt('Env "%s" is not a valid boolean [Current Value: "%s"]', [Name, lTmp]);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user