Including variables inside curly braces in a Zend config ini file on Linux

Posted by Dave Morris on Stack Overflow See other posts from Stack Overflow or by Dave Morris
Published on 2010-03-22T17:19:20Z Indexed on 2010/03/22 17:21 UTC
Read the original article Hit count: 385

Filed under:
|
|
|
|

I am trying to include a variable in a .ini file setting by surrounding it with curly braces, and Zend is complaining that it cannot parse it properly on Linux. It works properly on Windows, though:

welcome_message = Welcome, {0}.

This is the error that is being thrown on Linux:

:  Uncaught exception 'Zend_Config_Exception' with message 'Error parsing /var/www/html/portal/application/configs/language/messages.ini on line 10
' in /usr/local/zend/share/ZendFramework/library/Zend/Config/Ini.php:181
Stack trace:
0 /usr/local/zend/share/ZendFramework/library/Zend/Config/Ini.php(201): Zend_Config_Ini->_parseIniFile('/var/www/html/p...')
1 /usr/local/zend/share/ZendFramework/library/Zend/Config/Ini.php(125): Zend_Config_Ini->_loadIniFile('/var/www/html/p...')
2 /var/www/html/portal/library/Ingrain/Language/Base.php(49): Zend_Config_Ini->__construct('/var/www/html/p...', NULL)
3 /var/www/html/portal/library/Ingrain/Language/Base.php(23): Ingrain_Language_Base->setConfig('messages.ini', NULL, NULL)
4 /var/www/html/portal/library/Ingrain/Language/Messages.php(7): Ingrain_Language_Base->__construct('messages.ini', NULL, NULL, NULL)
5 /var/www/html/portal/library/Ingrain/Helper/Language.php(38): Ingrain_Language_Messages->__construct()
6 /usr/local/zend/share/ZendFramework/library/Zend/Contr in

We are able to get the error to go away on Linux if we surround the braces with quotes, but that seems like a strange solution:

welcome_message = Welcome, "{"0"}".

Is there a better way to solve this issue for all platforms? Thanks for your help,

Dave

© Stack Overflow or respective owner

Related posts about zend

Related posts about php