Welcome Guest, Not a member yet? Register   Sign In
changing some data form config folder by the controler
#3

[eluser]Twisted1919[/eluser]
here is how i would do it:
1) having in mind that the tricky part is the database, i would chmod the database.php file to 0777 so that i can write in it while i am doing the "install"(of course after install, chmod 0755 back for security reasons).
2)Look in these forums for MY_Config, it will allow you to save your website config to database rather than file.
3.a) Having the MY_Config set and correct permissions on database.php, when running the installer, i would save the database connection details and other website general settings to session/or just keep them in $_POST.
If the database settings are correct, then i would write the database.php file (file_put_contents() ?) with the data from session/$_POST then i would import all other session variables related to the website into database.
3.b) In the way i write database.php file, i can do it for config.php too, this means i won't need MY_Config extension.
4) Done, remove install or cancel the controller.(you can do a trick here, check if some table exists, if it does, than stop the install process, because the app is already installed, else continue with install process)

It's easy though, hope you get the idea .


Messages In This Thread
changing some data form config folder by the controler - by El Forum - 01-31-2011, 01:29 AM
changing some data form config folder by the controler - by El Forum - 02-02-2011, 01:03 PM
changing some data form config folder by the controler - by El Forum - 02-02-2011, 01:47 PM
changing some data form config folder by the controler - by El Forum - 02-02-2011, 11:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB