Welcome Guest, Not a member yet? Register   Sign In
[CodeIgniter] changing config.php by code
#3

[eluser]BrianDHall[/eluser]
As far as CI's code, no.

What you would need to do is basically use regex and you could also make use of CI's file helper to make reading/writing a bit easier.

So you'd load up config.php, run a preg/ereg function that looks for "$config['index_page'] = ", then rip out everything after the = and before the ;. Then you'd replace that with whatever you wanted the new value to be.

Not really hard I suppose, probably easier than you'd think.


Messages In This Thread
[CodeIgniter] changing config.php by code - by El Forum - 11-12-2009, 02:26 PM
[CodeIgniter] changing config.php by code - by El Forum - 11-12-2009, 02:35 PM
[CodeIgniter] changing config.php by code - by El Forum - 11-12-2009, 02:48 PM
[CodeIgniter] changing config.php by code - by El Forum - 11-12-2009, 03:03 PM
[CodeIgniter] changing config.php by code - by El Forum - 11-12-2009, 03:18 PM
[CodeIgniter] changing config.php by code - by El Forum - 11-12-2009, 03:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB