Change config values with php script - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Change config values with php script (/showthread.php?tid=69049) |
Change config values with php script - omid_student - 10-01-2017 I have below values in application/config/config.php $config['name'] = 'omid'; $config['id'] = 1; Now i need change this values with other php file Mayne? RE: Change config values with php script - InsiteFX - 10-01-2017 See the Config Library in the Users Guide, but if you need to make it permanent then you will need to create your config file and read and write to it. RE: Change config values with php script - omid_student - 10-02-2017 (10-01-2017, 12:22 PM)InsiteFX Wrote: See the Config Library in the Users Guide, but if you need to make it But i need to change value and save it in same config file RE: Change config values with php script - PaulD - 10-02-2017 It seems to me that these are not config variables at all. User ID and User Name are dependent on the user and IMHO not contained in a config file at all. I often have a user library that interrogates the session in some way and returns user details, permissions and authorises access. By doing that it is just one call to the user library to get whatever I need in a controller. The user_id is identified through the session and the user details are gathered from a database table. Authorisation is done usually through ion_auth but by keeping it all in one user library you can swap auth libraries around quite easily, or write your own, although that takes quite a bit of security knowledge to do it well. Hope that helps in some small way, Paul PS A config file is still just a file so you can always read it and alter it with php. However this completely defeats the purpose of a config file in my opinion. RE: Change config values with php script - omid_student - 10-02-2017 (10-02-2017, 10:21 AM)PaulD Wrote: It seems to me that these are not config variables at all. User ID and User Name are dependent on the user and IMHO not contained in a config file at all. Ok thank you |