Config-General - Using Relative Includes and Includes with Quotes

Posted on Wed Aug 20 08:45:38 2008 by kirkt
Using Relative Includes and Includes with Quotes
While testing Config::General for reading Apache Configuration Files, I came across some issues regarding the Include directive.

1. Relative Include files are searched from the location of the configuration file or from the -ConfigPath option. When reading from an Apache setup, relative files are read from ServerRoot by Apache. In order to work around this, I am reading the main configuration file without -ApacheCompatible and grabbing the value of ServerRoot. I then put that value in -ConfigPath and re-parse.

This seems to resolve the situation I am having, but is there an option to do -ApacheComptible and turn off include file processing? I did not see anything in the documentation. If include file processing is on and it cannot find the included file, Config::General dies. (Which I want it to do. If someone has a bad configuration file, it should die to let me know.)

2. If an Include directive has a Configuration filename with quotes around it, Config::General cannot find it and dies. Removing the quotes works. This all occurs with ApacheCompatible turned on. In a typical Unix setup, most people do not put quotes around the filename, but I believe they can and I believe it is required in windows to accommodate spaces in the filename. I understand the module shouldn't remove quotes from values and it's up to me to handle values with quotes; however, the include processing is automatic.
Write a response