Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config values overwrite when they have the same key #1

Open
rickschippers opened this issue Aug 28, 2019 · 6 comments
Open

Config values overwrite when they have the same key #1

rickschippers opened this issue Aug 28, 2019 · 6 comments

Comments

@rickschippers
Copy link

I'm using the library to parse apache configurations. I have a configuration like this:

<VirtualHost *:80>
	ServerAdmin foo@bar.com

	DocumentRoot /var/www/vhosts/default/web

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	Include conf-available/php7.1-fpm.conf
	Include expires.conf
</VirtualHost>

When this is parsed the VirtualHost.Include config will have the expires.conf. During parsing it has overwritten the conf-available/php7.1-fpm.conf, since the are both stored in in the Include key. But since you can have multiple Include statements in apache configuration they should not overwrite.

@nikoutel
Copy link
Owner

Thanks for catching that.

I've pushed a fix to branch dev. Have a look at it.
When I have more time I'll do some more testing and merge to master.

@rickschippers
Copy link
Author

rickschippers commented Aug 28, 2019

I tested dev-dev@dev. That doesn't fix the issue yet. I made a pull request with a possible solution:

#2

@rickschippers
Copy link
Author

Seem like dev-dev@dev through composer still gives me an older commit. Let me check again with your fix.

@nikoutel
Copy link
Owner

I didn't update composer. Now I have.
Can you test again please.

@rickschippers
Copy link
Author

rickschippers commented Aug 28, 2019

dev-dev@dev now gives me your commit with the fix. That indeed fixes the issue. It will parse correct.

[VirtualHost.Include.0] => conf-available/php7.2-fpm.conf
[VirtualHost.Include.1] => expires.conf

@nikoutel
Copy link
Owner

Great!
I guess its time for those GitHub Hooks for Packagist. I have always postponed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants