In Simple MVC, the business configuration files are splitted as follow :
. |-- business |-- conf | `-- apps.ini.changeme `-- front |-- conf | |-- access.ini | |-- front.ini.changeme | |-- languages.en.ini | `-- user_rights.ini
the business/conf folder contains a file named apps.ini.changeme. This file specifies common configuration for the business layer, it should be renamed to apps.ini and customized. Here is its content :
[database] host = localhost; user = *****; password = *****; database = *****; type = mysql; [template] URL = http://simplemvc.berejeb.com/; [controller] [model] [view] autorender_template = 1; [cache] ;allowed types : Array, File, APC type = File; prefix = simplemvc; directory = /tmp;
So as you notice, the file contains global sections like database, which handles the database connection params, template, controller, model and view sections, and cache section. Those can be a global placeholder for your common configurations across your applications.
You can then override those sections per application. For each Application you write, you must add a
[general] application.session.checkFrequency = "300000"; images.destination_dir = "/the/path/to/your/images/uploads/"; images.destination_url = "/images/uploads/"; rss.ttl = 10000;
You have to copy that file under front.ini and from there, you can override the global conf file. for example, if you have two applications that are dealing with different database connections, you can overrite the database section to sepecify the connection params for each application.
Also, remember in the boostrap file, we had some lines of code that were dealing with access. The helper was actually looking for the acces.ini configuration file ccess.ini :
This file indicates if each action should be public or protected.
; Access Config file : ; 0 - public ; 1 - protected Feed.index = 0; Feed.detail = 0; Feed.add = 1;
This is basically what we need to get the config working.
Move on to the next section, let’s take a look at our first page!
Leave a comment
Simple MVC in action
Type this URL from your iphone, ipad or ipod touch to see the application: