Welcome Guest, Not a member yet? Register   Sign In
Installation script for a CodeIgniter-based CMS
#1

[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?




Theme © iAndrew 2016 - Forum software by © MyBB