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

Reference Configure::read settings in ini file (3.0) #258

Open
btaens opened this issue Apr 15, 2015 · 4 comments
Open

Reference Configure::read settings in ini file (3.0) #258

btaens opened this issue Apr 15, 2015 · 4 comments

Comments

@btaens
Copy link

btaens commented Apr 15, 2015

I was thinking about server-side and localhost configuration options.
I know the plugin already has the asset_compress.local.ini option to configure server-side, and localhost options, but that could potentially expose certain executable locations on the server we may not want to show to other developers when configuring filters.

I think a simpler, and more universal solution might be to simply be able to reference Cakephp's configuration file contents (like in the ini file, just write: path = %AssetCompress.Uglifyjs.path%, which would equal to Configure::read('AssetCompress.Uglifyjs.path'))

This way, someone could do a lot of interesting things with their configuration. I, for example, read my config from a YAML file, and use Incenteev's ParameterHandler to update an uncommited parameters.yml file, so it prompts everyone for the missing configuration options when they execute composer install. Paths could also be globally set for the entire app, so if someone uses a filter executable somewhere outside of AssetCompress, now only has to set it at one place.

@btaens btaens changed the title Reference Configure::read settings in ini file Reference Configure::read settings in ini file (3.0) Apr 15, 2015
@markstory markstory added this to the 3.0 milestone Apr 15, 2015
@markstory
Copy link
Owner

I'm going to be pushing some changes soon that will automatically import any and all user defined constants into the configuration files. Would that help with this?

@btaens
Copy link
Author

btaens commented Apr 16, 2015

I suppose a constant could be defined that reads a Config parameter, but that seems a bit hacky, and it might not be desirable to litter the namespace with constants just for this.

I plan to try my hands at a UrlRewrite filter during the weekend, and I've already written a similar Config checking implementation for YAML files in my own app, so I can reference other Configs within my own Config.

Would you mind if I made a pull request with this feature, and a UrlRewrite filter this weekend? (Probably as separate pulls)

@markstory
Copy link
Owner

I'm just in the middle of splitting out the internally bits of this plugin into a standalone library. You might want to wait for that to land, so the pull request will merge reasonably. AssetConfig will be moved out of the plugin, but this plugin could have a subclass that adds Configure reading.

Have you considered using {{ }} as the delimiters instead of %?

@btaens
Copy link
Author

btaens commented Apr 16, 2015

That would actually make more sense. I was actually about to ask what delimeter you prefer. Sure thing.

@markstory markstory modified the milestone: 3.0 Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants