php - Codeigniter config file change at runtime -
is possible edit config file @ runtime? i'm developing module manager , has able change aspects of configuration dynamically.
this means being able read , writte file @ runtime, , modify example line.
$config ['webtitle'] = 'foo';
some tips?
pd: dont wont create new table in database store configuration. alternatives?
edit: after searching time found answer quite similar i'm looking for, have not had success.
it might. htaccess block this?
link response : link
it sounds want modify config file. if so, yes, can it. need make sure file writable web server. fopen() file, fread() memory, change what's needed, fwrite() out again. easy! :)
please keep in mind there security risk if in shared hosting situation.
if doing setup process, may want check permissions call fileperms(). if permissions not correct, tell user need ftp account , make file writable. then, after setup done, tell user mark file non-writable again.
Comments
Post a Comment