model view controller - Zend Framework-where should this root.php file go for MVC? -


I am changing the web app to use the MVC structure of the Zend Framework. I have a root.php file Which contains most database information, and some stable variables used in the program I'm not sure some of these apps Should be in a model that is called by the init () function in a controller, or in bootstrap or what?

Any Help

  & lt ;? Php / *** / configuration file * /     ## Defines the site configuration ## ("SITE_ROOT", dirname (__ FILE__)); Define ("SITE_URL", "http: // localhost / monkeycalendarapp / monkeycalendarapp / public"); Define ('db_host', 'localhost'); Define ('db_user', 'root'); Define ('DB_PASS', "xxx"); Define ('DB_NAME', "xxxxx"); Define ("PROJECT_NAME", "Monkey Mind Manager (Beta 2.2)"); // Define site title ("CALENDAR_WIDTH", "300"); // Define Left Mini Calendar Width ("CALENDAR_HEIGHT", "150"); // left mini calendar height $ page_title = 'Event List'; $ Stylesheet_name = 'style.css'; // Define the default stylesheet ("SITE_URL_AJAX", SITE_URL. "/ Ajax-tooltip"); Define ("JQUERY", SITE_URL. "/jquery-ui-1.7.2"); $ A_times = Array ("12:00", "12:30", "01:00", "01:30", "02:00", "02:30", "03:00", "03: 30 "," 04:00 "," 04:30 "," 05:00 "," 05:30 "," 06:00 "," 06:30 "," 07:00 "," 07:30 " "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30"); // PTL Type Promotional Timeline Type $ a_ptlType = array (1 = & gt; "Gigs", "To-Do", "Completed"); $ A_days = array ("su", "mo", "ye", "us", "gu", "father", "sa"); $ A_timesMerd = array ("12:00 am", "12:30 am", "01:00 am", "01:30 am", "02:00 am", "02:30 am", "03: 00 am "," 03: 30am "," 04:00 am, "" 04:30 am, "" 05:00 am "," 05:30 am, "": 06:00 AM "," 06:30 Am ",": "07:00 AM", "07:30 am" "08:00 am", "08:30 am", "09:00 am", "09:30 am", "10:00 am "," 10:30 am "," 11:00 am "," 11:30 am ",": 12:00 PM "," 12:30 PM "," 01:00 PM "," 01:30 PM "," 02:00 PM "," 02:30 PM "," 03:00 PM "," 03:30 PM "," 04: 12:00 "," 04:30 PM "," 05:00 PM "," 05:30 PM ",": 06:00 PM "," 06:30 PM ",": 07:00 PM "," 07:30 PM "," 08:00 PM "" 08:30 PM "," 09:00 PM "," 09:30 PM "," 10:00 PM "," 10:30 PM "," 11:00 PM "," 11:30 PM "); // Set the stylesheet for this user. $ AMPM = array ("am" = & gt; "am", "pm" => just "o"); Include (SITE_ROOT. "/includes/functions/general.php"); Include (SITE_ROOT. "/includes/db.php"); Session_start (); If (isset ($ _ session ['userData'] ['user id'])) {$ s_userID = $ _SESSION ['Userdata'] ['user id']; } $ Stylesheet_name = stylesheet (); Ini_set ('date.timezone', 'GMT'); Date_default_timezone_set ('GMT'); If ($ s_userID) {ini_set ('date.timezone', $ _SESSION ['userData'] ['timezone']); Date_default_timezone_set ($ _ session ['UserData'] ['time zone']); }? & Gt; Everything that needs configuration is a resource (you can use or write your own too)  

The resource can be configured in many ways, for example:

  • in application.ini
  • Zend applications in index to several config files Pass in Php
  • Configuring directly in Bootstrap

The best place to define is index.php ( include 'root.php' ), Actually. However, you should at least reduce the number of global constants / variables (in this case, the resource config files seem to be the best option).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -