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 [
    'application' => [
        'environment'    => \Vegas\Constants::DEV_ENV,

        'serviceDir'   =>  APP_ROOT . '/app/services/',
        'configDir'     => dirname(__FILE__) . DIRECTORY_SEPARATOR,
        'libraryDir'     => APP_ROOT . DIRECTORY_SEPARATOR . 'lib/',
        'pluginDir'      => APP_ROOT . '/app/plugins/',
        'moduleDir'      => APP_ROOT . '/app/modules/',
        'taskDir'      => APP_ROOT . '/app/tasks/',
        'baseUri'        => '/',
        'language'       => 'en_US',
        'view'  => [
            'cacheDir'  =>  APP_ROOT . '/cache/',
            'layout'    =>  'main',
            '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 [
    'db' => [
        '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