Configuration
Construct configuration values can be changed in system configuration file config.php.
Get configuration value
<?php echo ipConfig()->get('timezone'); // Gets 'timezone' configuration value
See the list of available configuration values below.
Available configuration values
| Key | Value | Purpose |
| adminLocale | string | Language code for administration pages. |
| baseDir | string | Absolute path to the website root is generated by Construct automatically. Set this configuration value if automatic setting does not work. |
| charset | string | HTML charset |
| db | array |
Database connection settings. See "Database connection settings" table below for more details. For security reasons, this configuration value can't be accessed using ipConfig() function. |
| debugMode | boolean | Debug mode loads raw unminified JS files, alerts AJAX errors. |
| defaultDoctype | string | HTML doctype. Default value 'DOCTYPE_HTML5' |
| developmentEnvironment | boolean | Displays error and debug information. Change to 0 before deploying to production server. |
| disableHttpOnlySetting | boolean |
Construct sets PHP session.cookie_httponly setting to true by default. Use this setting to disable this behaviour. |
| fileOverrides | array |
deprecated and will be removed in 5.0.0 version Allows to override directories for Construct files: 'fileOverrides' => array( |
| rewritesDisabled | boolean | Set to true if mod_rewrite is disabled. |
| sessionName | string | Prevents session conflict when two sites runs on the same server. |
| showErrors | boolean | Set to 0 if you don't wish to display errors on the page. |
| theme | string |
Current theme name. |
| timezone | string | PHP 5 requires timezone to be set. E.g. 'UTC' |
| urlOverrides | array |
Allows to specify different URLs for Construct files: 'urlOverrides' => array( 'Ip/' => 'http://example.com/xxx/', ) |
Database connection settings
| Key | Meaning |
| hostname | Database host name or IP address |
| username | Database username |
| password | Database user's password |
| tablePrefix | Table prefix for Construct tables |
| database | Database name |
| charset | Charset |
| driver (since 4.2.1) |
Database engine driver. Two drivers available: 'mysql' or 'sqlite'. Default is 'mysql'.
some plugins may not support SQLite |
Get a current theme name
<?php echo ipConfig()->theme();
The code above outputs a name of current website's theme.
Check if a site is running in development environment
<?php
if (ipConfig()->isDevelopmentEnvironment()){
var_dump(ipRequest()->getPost());
}
?>
The example above checks if the site is running in development environment and shows HTTP request dump.
To switch a website to development environment mode, set developmentEnvironment constant value to 1 in config.php file.
Check if a site is running in debug mode
<?php
if (ipConfig()->isDebugMode()){
var_dump(ipRequest()->getPost());
}
?>
Website title & email
Construct provides a global setting to store website's title and email. Both values can be set in Config section of admin. This is how you can get these values in PHP
<?php
$websiteTitle = ipGetOptionLang('Config.websiteTitle');
$websiteEmail = ipGetOptionLang('Config.websiteEmail');
You can set different values for each language. The function returns correct value depending on the language of currently rendered page. Pass language code as a second parameter to get specific language value
<?php
$websiteTitle = ipGetOptionLang('Config.websiteTitle', 'en');
$websiteEmail = ipGetOptionLang('Config.websiteEmail', 'en');