Development Tools
Test Environment Settings
In some cases, it is convenient to specify separate settings for the test environment. To do this, create a file /config/sys-local.php with the following contents:
$configLocal = array(
'site.host' => 'dev.example.com',
'site.static' => '//dev.example.com',
# db
'db.host' => '127.0.0.1',
'db.port' => '3306',
'db.name' => 'development',
'db.user' => 'user',
'db.pass' => 'password',
);
return $configLocal;
Thus, the application will connect to the test version of the database, access to which was specified in the example.
Here you can also check the current domain using the php global variable $_SERVER['HTTP_HOST']
Debug Mode
This mode should only be used by developers.
It is available in the admin panel in conjunction with the developer mode.
We recommend minimizing the use of this mode in a live project as it creates additional load and disables caching of some functions.
To enable this mode, you need to enable the setting 'debug' => true,
in the file /config/sys.php
in the "Debug (for developer)" section.
In this mode, you will also have access to the Development section in the admin panel.
During development, you also have access to the constant that checks if this mode is enabled:
if (BFF_DEBUG) {
// Debug mode enabled
bff::log('Logging an event', Logger::DEBUG);
}
if (FORDEV) {
// Developer mode enabled
}
Additional Settings
To ensure that the context record, additional data passed to the log file, is displayed in an expanded format, enable the following system setting:
'log.formatter.allowInlineLineBreaks' => true,
Composer
To install libraries used for development and testing, use the command without the prefix
--no-dev
, as described in the installation instructions.
You can find the complete list in the /composer.json
file in the require-dev
and suggest
sections.
Console Commands
Some commands are also available in console mode, read more about it in this article.