All framework configuration files are PHP files. Except for rare exceptions, a configuration file contains PHP code returning a named array of parameters as shown below:
<?php return array( 'param_1' => 'value_1', 'param_2' => 'value_2', ... );
During development and installation of an application, several system configuration files must be modified.
These files reside in directory wa-config/
.
File apps.php
File apps.php
contains the list of installed applications and allows managing their "visibility" in the main backend menu.
Example of file apps.php
:
<?php return array( 'contacts' => true, 'stickies' => true, 'guestbook' => true, 'installer' => true );
APP_ID's of the installed applications are used as the named array keys. Value true
for a key tells the system to display the corresponding application name and icon in the framework backend.
File routing.php
This is the system-wide HTTP request routing configuration file which distributes the entire URL space among applications.
Example of system file routing.php
:
<?php return array( 'site.ru' => array( array('url' => 'blog*', 'app' => 'blog'), array('url' => 'shop*', 'app' => 'shop'), array('url' => 'guestbook/*', 'app' => 'guestbook'), array('url' => '*', 'app' => 'site'), ) );
Read more about frontend request routing.
File db.php
File db.php
contains database connection parameters.
Example of file db.php
:
<?php return array( 'default' => array( 'type' => 'mysql', 'host' => 'localhost', 'user' => 'wafw_user', 'password' => 'my-strong-password', 'database' => 'wafw' ), );
File config.php
File config.php
stores several system settings.
Example of file config.php
:
<?php return array( 'debug' => true, 'backend_url' => 'admin', 'mod_rewrite' => true, );
Below is the list of parameters used in file config.php
:
debug
: acceptable values aretrue
/false
. This parameter enables of disables the display of detailed information on error occurring during the script operation. It is advisable to set this parameter totrue
during the application development.backend_url
: relative path to the backend. Default value iswebasyst
.mod_rewrite
:true
orfalse
. This parameter defines whether mod_rewrite rules should be supported. The default value is automatically determined during the framework installation.