Book Image

Learning Phalcon PHP

By : Calin Rada, Ioan C Rada
Book Image

Learning Phalcon PHP

By: Calin Rada, Ioan C Rada

Overview of this book

Table of Contents (17 chapters)
Learning Phalcon PHP
About the Author
About the Reviewers

Creating the configuration file and the Bootstrap

Almost any application has some constants that will be reused (database credentials, SMTP credentials, and so on). For our application, we will create a global configuration file. This file will be an instance of the \Phalcon\Config component. Switch to the config directory and create it with the following content:


return new \Phalcon\Config(array(
    'application' => array(
        'name' => 'Learning Phalcon'
    'root_dir' => __DIR__.'/../',
    'redis' => array(
        'host' => '',
        'port' => 6379,
    'session' => array(
        'unique_id' => 'learning_phalcon',
        'name' => 'learning_phalcon',
        'path' => 'tcp://'
    'view' => array(
        'cache' => array(
            'dir' => __DIR__.'/../cache/volt/'

The Phalcon\Config component simplifies the access to the configuration data within our...