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:
<?php return new \Phalcon\Config(array( 'application' => array( 'name' => 'Learning Phalcon' ), 'root_dir' => __DIR__.'/../', 'redis' => array( 'host' => '127.0.0.1', 'port' => 6379, ), 'session' => array( 'unique_id' => 'learning_phalcon', 'name' => 'learning_phalcon', 'path' => 'tcp://127.0.0.1:6379?weight=1' ), 'view' => array( 'cache' => array( 'dir' => __DIR__.'/../cache/volt/' ) ), ));
The Phalcon\Config
component simplifies the access to the configuration data within our...