-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Load custom "sprinkles.json" file #813
Comments
An interesting scenario. Would require more than just conditional loading of Off the top of my head, for this to be done we need:
|
I think, at the very least, we should remove the hardcoded |
+1 The constants can be overwritten by sprinkle defined one? But then I guess it would be loaded after that info is require. Or maybe it could it be overwrittable by the env settings? |
Nothing that fancy. People who need to change the default Could even use loaders to support JSON or YAML. |
It could also be changed using Bakery somehow... |
i think to give the option to change the default definition by if you defined this by env settings or bakery this would be the same as static file name |
Problem is if you have to edit Nevertheless, your issue is different than the fact the sprinkle file is hardcoded. Having a different set of sprinkle depending of the domain is nonsense for me. If there's really a difference between the two domains, it should be handled inside a sprinkle. Even better, I would go for two different install, one for each domain, even if they have to share the same db. What is the reason you need to load a different sprinkle based on the domain name? |
i made two base sprinkles of my system (one is template and another is functionality) when this will scale up with more domain.. this will be hard for me to update every host.. if i can manage with sprinkles will be loaded by domain (or any other way) in the I dont see why my example (in the post) is wrong or not good ? |
I actually did originally envision a multi-tenant situation (what @mgpro94 is describing) as one possible use case for Sprinkles. In fact, I actually designed the Sprinkle system based on some "proto-sprinkles" I was using in a multi-tenant project of my own, where each site had a separate "proto-sprinkle" in the same installation. I ultimately ditched that approach in favor of using a common Sprinkle shared among separate installations of UF, but I don't think @mgpro94's use case is so far-fetched. |
This is now possible with UF5. Simply create two Recipe, and load the correct one in index/bakery. |
@alexweissman
Follow the conversation here: https://forums.userfrosting.com/t/can-i-load-different-sprinkle-for-each-domain/97
we agreed to add a way to load custom "sprinkles.json"..
as i suggested:
file: public/index.php
file: app/system/UserFrosting.php
The text was updated successfully, but these errors were encountered: