Nov 27, 2010
admin

Installation and configuration

Download & Installation

To Install Simple MVC, you can either do it directly through git hub via

git clone git://github.com/bachkoutou/Simple-MVC.git

or download and uncompress the files :

https://github.com/bachkoutou/Simple-MVC/zipball/master
https://github.com/bachkoutou/Simple-MVC/tarball/master

Once decompressed, here is the structure you should get :

|-- CHANGELOG
|-- INSTALL
|-- README
|-- business
|-- conf
|-- core
|-- sql
`-- www

Here is a description for each folder

  • CHANGELOG , INSTALL, README : common files concerning respectively the changelog, the installation manual and the read-me text.
  • business : The business folder, this is where you put your apps or modules. Each Module is created in a subfolder.
  • conf : The configuration folder
  • core : The Core API. You should not change this folder if you want to get updates for upcoming versions of the framework without having to troublshoot.
  • sql : just a folder for some sql script samples
  • www : the webroot folder: this is where your vhost should point.

Preparing the environment

For purposes like the autoload mechanism and eventual uploads, Simple MVC needs a temporary folder that should be Writable by the webserver. The configuration by default uses a relative folder that should be called tmp. So if your Simple MVC path is /path/to/simplemvc/, you should add a /path/to/simplemvc/tmp/ folder and give your apache user write access to it.
The second step is to point your virtual host to the webroot folder. To help you do that, there is a sample file under conf, called vhost-sample.conf. It simply tells the virtual host to point to the www directory.
here is the code of that file (we consider simplemvc installed under /var/www/simpleMVC/) :

<VirtualHost *:80>
    ServerName www.simpleMVC.dev
    DocumentRoot /var/www/simpleMVC/www
    <Directory /var/www/simpleMVC/www>
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Setting up the default application / module

There is no many things to set to get the framework working. However, I’ll be showing some placeholders that allow you to change some default values of the system.

Under conf/, you will find a configuration-changeMe.php file. Since SimpleMVC supports many  applications (which we call modules), you can specify a configuration file per module. For example, the configuration file for the module front will be named as configuration_front.php.
So if your module is called front for example, all you to do is to copy the configuration-changeMe.php file to a configuration_front.php and change the MODULE constant to “front”

 define('MODULE', '{moduleName}' . DS);
// will be
 define('MODULE', 'front' . DS);

We will talk about the configuration files later on this book. Let’s start to build our application! this is explained here!

1 Comment

Leave a comment to Introduction « Simple MVC, a light PHP5 Framework