Configuration

Application Config

To see default content of config file please execute the following commands.

cd your-project
cat config/config.php

Default content should look like this

return array(
    'application' => array(
        'environment' => \Vegas\Constants::DEV_ENV,
        'baseUri' => '/',
        'language' => 'nl_NL',
        'configDir' => dirname(__FILE__) . DIRECTORY_SEPARATOR,
        'moduleDir' => APP_ROOT . '/app/modules/',
        'pluginDir' => APP_ROOT . '/app/plugins/',
        'serviceDir' => APP_ROOT . '/app/services/',
        'taskDir' => APP_ROOT . '/app/tasks/',
        'view' => array(
            'layout' => 'main',
            'cacheDir' =>  APP_ROOT . '/cache/',
            'layoutsDir' =>  APP_ROOT. '/app/layouts/'
        )
    )
    ...
);

Options

environment

Describes enviroment. Available options are \Vegas\Constants::DEV_ENV, \Vegas\Constants::PROD_ENV. When development then it should display stacktrace when error appears and every request should reload services and modules config files.

baseUri

Base URI of your project

language

Default language of project

configDir

Directory where config.php file exists

moduleDir

Path for modules

pluginDir

Path for plugins

serviceDir

Path for services

taskDir

Path for task files (scripts for CLI)

view

View configuration. Option "layout" describes the filename of main layout. Option "layoutsDir" describes path for main layout. Option "cacheDir" describes the directory for view cache files.


Database Config

If you are going to use database in your project you must configure database connection also inside config.php file.

return array(
    'db' => array(
        'adapter' => 'Mysql',
        'host' => 'localhost',
        'dbname' => 'test_db',
        'username' => 'admin',
        'password' => 'qwerty'
    )
    ...
);

Options

adapter

Name of adapter that vegas must use to connect with SQL server. Allowed options: 'Mysql', 'Postgresql', 'Sqlite', 'Oracle'

host

Machine in network where database server work

dbname

Database name

username

User who has access to database

password

Password for user who has access to database