Config files

The Phalcon REST Boilerplate needs a default configuration file app/configs/default.php and a environment based config file like app/configs/server.develop.php.

Default template

The boilerplate comes with a default template app/configs/default.template.php for all your standard configuration. Rename this file to default.php and adjust it to your needs.

default.template.php

return [
    'application' => [
        'title' => 'Phalcon REST Boilerplate',
        'description' => 'This repository provides an boilerplate application with all of the classes of Phalcon REST library implemented.',
        'baseUri' => '/',
        'viewsDir' => __DIR__ . '/../views/',
    ],
    'authentication' => [
        'secret' => 'this_should_be_changed',
        'expirationTime' => 86400 * 7, // One week till token expires
    ]
];

Server template

The boilerplate comes with a server template app/configs/server.template.php for all your environment specific configuration. Copy this file to server.develop.php and adjust it to your needs.

server.development.php

return [

    'debug' => true,
    'hostName' => 'http://phalcon-rest-boilerplate.redound.dev',
    'clientHostName' => 'http://phalcon-rest-app.redound.dev',
    'database' => [

        // Change to your own configuration
        'adapter' => 'Mysql',
        'host' => '127.0.0.1',
        'username' => 'root',
        'password' => 'root',
        'dbname' => 'phalcon_rest_boilerplate',
    ],
    'cors' => [
        'allowedOrigins' => ['*']
    ]
];

Environment variable

The boilerplate will either load server.develop.php, server.staging.php or server.production.php based on their respective APPLICATION_ENV values (develop, staging, production). If no environment variable has been set it defaults to develop.

apache configuration

<VirtualHost *:80>

    SetEnv APPLICATION_ENV "development"

</VirtualHost>