Git, DB and Low Variables
Hi Low,
I am running into a problem right now which really shouldn't be a problem I think.
To start of: I have read some posts about LV and Git and I fully understand why LV's can't or shouldn't be created as files directly. And that's not what I am wanting to do.
I have a pretty common Git setup with local, dev (or staging) and production. Now, I have created a couple of LV's in production's CP, ticked save as files and cloned them to my local env.
When I edit a LV the changes are not being reflected on the local site however. I have to connect to my local db to see the changes. When I edit a regular EE template, eg. index in index.group this is different. The changes are being reflected right after saving the changes even if I am connected to the remote db and the changes are not being reflected on the livesite.
So I assume that the difference is that LV's are synced with the db (right away) and are also always called directly from the db, right?
Now, I just don't get it why I save the LV's as files in the first place. The idea was to do this to make working with Git possible.
Or am I just blockheaded because it has been getting late again today?
Thanks and Cheers!
Marc
Replies
Low 27 Sep 2013 08:29
Yeah, the files are synced with the DB and the vars themselves are always loaded from the DB. That's because LV makes use of native functionality as a base: the user defined global variables.
These are always loaded from the DB, and there aren't any hooks in place to change that. By syncing the files and DB, that doesn't really matter, 'cause the DB would have been synced anyway. It's a workaround to make the save-as-files option work for all parsing stages.
People wanted a way to edit the vars using files, which they can with this approach. More advanced setups like you have (changing files but accessing a different DB) doesn't fit into that setup, I'm afraid.
MarcTiedemann 27 Sep 2013 10:40
Ok, I see. Thanks for your explanation. I totally see the reasoning for doing things with LV the way you are doing it. Just doesn't work with versioning systems, which I was *hoping* for.
But sometimes it just takes some time to fully understand a Module and/or what the developer wanted to achieve. :)
I guess I'll resort to Stash then. Should be doing what I want in regard of versioning.
Thansk again. Have a great one!