Basic configuration.
- PHP 8.1 or higher
- composer
composer require drago-ex/bootstrap
When running an application, the existence of the cache (Drago.CacheConf) is verified, and if it is empty, it activates searching for configuration files. During searches, the paths to the configuration files found are found, which is stored in the cache and then passed to the system container.
If we need to preload some configuration files, we will do so before the file name add a number. In general, the rule that the higher the number, the higher the priority will be.
Because caches only save paths to configuration files, it must always be deleted when create or delete configuration files to generate a new system container.
class Bootstrap
{
public static function boot(): ExtraConfigurator
{
$app = new ExtraConfigurator;
// Finder configuration files.
$app->addFindConfig(__DIR__ . '/path/to/dir');
return $app;
}
}
Multiple search.
$app->addFindConfig([
__DIR__ . '/path/to/dir',
__DIR__ . '/path/to/dir'
]);
Search exclusion.
$app->addFindConfig(__DIR__ . '/path/to/dir', 'exclude');