• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
database before routes

#1
Im building a multisite where each site setting is loaded from the databse based on the subdomain or domain . this works great

However : how would point different application folders for each site.

Lets say site 1 is using version 1 of the application
Lets site 2 is using version 2 

The only idea I came up is to put the MVC and libraries in a version named folder. 
And use a constant for the version named folder in routes.php
But it seems the routes.php is loaded before database.php
And database.php is the place where I can point which site uses which version

Any ideas?
Reply

#2
You could use your own standard MySQLi connection and retrieve the information from the database.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
(03-07-2017, 06:02 AM)InsiteFX Wrote: You could use your own standard MySQLi connection and retrieve the information from the database.

Thanks. thats an option.

I'm not really on perfomance yet but I already use a PDO connection in the database.php
Then I should do the same PDO connection in routes.php 

Or maybe I can do a single PDO connection in routes.php, and then pass database connection setup to database.php ?

 And is it recommended to use a folder structure like this

application
   config
   core (etc)
   version 1 
      - model
      - view
      - controller
   version 2
      - model
      - view
      - controller
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.