Welcome Guest, Not a member yet? Register   Sign In
Write to custom config?
#4

[eluser]spmckee[/eluser]
Think I'm gonna stay with the text config. It's a beautiful thing when I can load the config in My_Controller and access it globally without having to mess with a query.

And wouldn't you know it, 30 minutes later I come across the answer somwherez. Smile

For those interested:
Code:
<?php
$File = "YourFile.php";
$Handle = fopen($File, 'w');
?>

<?php
$rtn = "\n";
$File = "system/application/config/YourFile.php";
$Handle = fopen($File, 'w');
$Data  = '<?php'.$rtn;
$Data .= '$config["dev_mode"] = 1'.$rtn;
$Data .= '?>'.$rtn;

fwrite($Handle, $Data);
print "Data Written";
fclose($Handle);
?>


Messages In This Thread
Write to custom config? - by El Forum - 09-29-2009, 12:23 PM
Write to custom config? - by El Forum - 09-29-2009, 12:26 PM
Write to custom config? - by El Forum - 09-29-2009, 12:45 PM
Write to custom config? - by El Forum - 09-29-2009, 01:26 PM
Write to custom config? - by El Forum - 10-14-2009, 01:01 PM
Write to custom config? - by El Forum - 10-14-2009, 02:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB