I’ve got several constants defined in one of my classes and would like to use on of them in my application.ini, is this possible?
logger.main.level = \My\App\Logger::WARNING
This does not seem to work, it just parses it as a string
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to use the value of a constant in your
application.iniyou need to define the constant in the/public/index.phpfile (see theAPPLICATION_PATH).If you want to do it cleanly in your code I would eiter do it using the log level manually with the numeric value (assuming the constant is numeric as in Zend_Log) since this value is not likely to change or do it in the index.php and define a new constant named something like
LOGLEVEL_WARNING(you can then get the value of the constant statically from your class), which you will be able to use in theapplication.inifile likelogger.main.level = LOGLEVEL_WARNINGMy pick would be the numeric value in the
application.inifile like this :Take a look at
APPLICATION_PATHandDATESTAMPwhich are constants that I have defined in my index.php