Occassional Config Saving Issues |
[eluser]kilishan[/eluser]
I'm working on a extended Config class that actually allows for saving items to the original config files. I've got it working for both config files and the database config files (saving dev, test, and prod server settings). However, every once in a while it decides to write the config file without the first line (the one with the PHP opening tag) so the config file fails to function when read and breaks the program. Obviously, this is a deal-breaker. Below is the current save() method. Does anyone have any idea what might be causing this? Also, if you know of a better way to find/replace the existing lines with the config setting on it, I'd love to hear it. Currently this one feels a bit hackish, though it does seem to work. Thanks Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]George36[/eluser]
Hi kilishan, Sorry I'm not able to see what the problem could be but thought I would reply in case the solution I came up with yesterday helps. Quote:http://ellislab.com/forums/viewthread/143985/ I'm presuming you would use this function to allow an admin to add config items from a control panel. I had a similar need, but opted for storing the config items in a db and dynamically creating when needed. Hope that helps, even if just a little. George
[eluser]kilishan[/eluser]
@helmutbjorg, thanks for looking the code over. @George36, thanks for the pointer. It's not what I'm looking for, though it's a pretty nice solution. This is for a personal project of mine. I've always that a CMS that worked with CI would be an 'ideal' situation, and one that I have yet to see. What I mean is that the CMS simply provides an interface to the existing CI config settings, can create basic controllers/models to build the urls of the site, and allows editing of view files to edit the pages themselves. To me, it seems like this would be the way to get the best performance possible, plus, it would give the end-user enough power to do what they need once some modules are built (like a blog, forums, etc), while allowing the developer the full power they needed to go in and edit the actual code. Consider it a proof of concept Just in the beginning stages, and this occasional glitch is driving me batty because I haven't yet determined a consistent cause. Then again, it's a personal project and time allotted for it is pretty slim at the moment. |
Welcome Guest, Not a member yet? Register Sign In |