Project

General

Profile

Feature #1403

Can conf file parser auto type cast a string value to integer?

Added by Anonymous almost 12 years ago. Updated almost 11 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
Category:
core
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

Hi

I was trying to assign an environment vaiable to server.port with something like below.

server.port = env.WEB_PORT

I found it is not working. The Lighty config parse glue code is printing an error like:

'''2007-10-08 21:44:47: (configfile-glue.c.93) got a string but expected a short: server.port 8080'''[BR]

I looked at source code. As all the environment variable values are strings, assigning string to integer is not being allowed by the parser code.

Is it possible to let these kind of assignments?

Basically if the type of the value is string and the target accepts only integers, then the parsing code will do atoi(<value>) and then assign the value to target field.

Can you incorporate this change?

Thanks

-- Videoguy


Related issues

Is duplicate of Bug #1159: Cannot set server.port from environment variableFixed

Actions

History

#1

Updated by stbuehler almost 11 years ago

  • Target version changed from 1.4.20 to 1.4.21
#2

Updated by stbuehler almost 11 years ago

  • Status changed from New to Fixed
  • Pending changed from Yes to No
  • Patch available set to No

Also available in: Atom