CodeIgniter Forums
Installation script for a CodeIgniter-based CMS - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Installation script for a CodeIgniter-based CMS (/thread-46607.html)



Installation script for a CodeIgniter-based CMS - El Forum - 11-08-2011

[eluser]Unknown[/eluser]
As a way to teach myself CodeIgniter I'm creating a CMS (here: https://github.com/TCotton/CodeSharp).

I'm looking at creating an installation script for the database. So here is my thought process so far:

I've placed this in the central contoller file:

Code:
if (file_exists("application/views/admin/install_view.php")) {

            redirect(site_url("install"));

        }

The idea being is that the user is automatically redirected to the install script, they fill in their user details and submit the form; the database is then created and the file destroyed. Then they'll find themselves back on the home page with a working CMS ready to go.

However, the models are still making calls to tables which don't yet exist:

Code:
A Database Error Occurred

Error Number: 1146

Table 'cotton_codesharp.admin' doesn't exist

SELECT * FROM (`admin`)

Filename: /home/cotton/public_html/codesharp/models/admin_config_model.php

Line Number: 105

Does anybody have any ideas how I can get around this?