You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There doesn't seem to be a way to merge multiple ini config files into a single file that is used to build. A feature like this would be useful specifically for merging theme config into an application's build config. This would be useful with CMS type applications (i.e., Croogo) that use CakePHP theming.
Bare bones example
Here's a real world example of what I'd like to do.
Splitting ini config files like this would decouple the application's config from the defined themes, whereas a current solution might be to use theme:css/navigation.css couples the application config to the existence of that css file in the theme.
Merging
Since a Theme isn't a standalone package, like a Plugin would be, an incomplete ini file like the one above doesn't seem like a problem. Themes seem like they would be application-aware, so bringing in application config like cachePath also doesn't feel wrong.
RFC
I'd like to hear ideas of how this should be accomplished so I can submit a PR, or if there's anything wrong with what I'm proposing. I'm thinking all that might need to be done is merging (and prepending theme: to files) it during AssetConfig::buildFromIniFile. Perhaps requiring a new mergeThemeConfig option to the [General] section should be added for this functionality.
I'm not super aware of the internals of AssetCompress so there are probably things I'm missing here.
The text was updated successfully, but these errors were encountered:
Good questions. Perhaps it can create a merged build for each theme, prefixing the build file and serving the theme build if a theme is active when the helper tries to serve it. This would allow runtime themes to still have complete builds.
I don't think theme configs should do anything but add files to builds. The application is responsible for filters in the same way the application is responsible for actually building the assets.
Problem
There doesn't seem to be a way to merge multiple ini config files into a single file that is used to build. A feature like this would be useful specifically for merging theme config into an application's build config. This would be useful with CMS type applications (i.e., Croogo) that use CakePHP theming.
Bare bones example
Here's a real world example of what I'd like to do.
Config/asset_compress.ini
View/Themed/SomeTheme/Config/asset_compress.ini
The desired result here would be that the configuration would be merged and the final configuration would look something like this:
Decoupling
Splitting ini config files like this would decouple the application's config from the defined themes, whereas a current solution might be to use
theme:css/navigation.css
couples the application config to the existence of that css file in the theme.Merging
Since a Theme isn't a standalone package, like a Plugin would be, an incomplete ini file like the one above doesn't seem like a problem. Themes seem like they would be application-aware, so bringing in application config like
cachePath
also doesn't feel wrong.RFC
I'd like to hear ideas of how this should be accomplished so I can submit a PR, or if there's anything wrong with what I'm proposing. I'm thinking all that might need to be done is merging (and prepending
theme:
to files) it duringAssetConfig::buildFromIniFile
. Perhaps requiring a newmergeThemeConfig
option to the[General]
section should be added for this functionality.I'm not super aware of the internals of AssetCompress so there are probably things I'm missing here.
The text was updated successfully, but these errors were encountered: