Including sections into config.user.php

Michael Bushey's Avatar

Michael Bushey

01 Jun, 2015 09:53 PM

I am using php in my configs, ie:
$date is previously defined: $date=date('Y-m');
"path" : "\/var\/log\/<?php echo $date; ?>\/control.log",

The built in config looks like it's only for pure json, I added this to the config.user.php file:
        "files": {
<?php foreach (glob("config.user.php.d/*.php") as $file) include $file; ?>

I see the included files show up in the dropdown (with php obviously being interpreted as the date is in the title), however When I select it I get the message "File ID control2 does not exist, please review your configuration file and stop playing!". Any idea why?

Thanks!

  1. 1 Posted by Michael Bushey on 01 Jun, 2015 10:29 PM

    Michael Bushey's Avatar

    I was able to get it working by using the full path on the glob:

    <?php foreach (glob("/var/www/html/log.site.com/config.user.php.d/*.php") as $file) include($file); ?>

    The strange part is with the relative path it obviously opened it because it appeared in the menu, but it gave the File ID control error.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac