drago-ex/bootstrap

Basic configuration for Nette Framework

v1.0.6 2023-12-01 13:33 UTC

This package is auto-updated.

Last update: 2024-04-12 07:17:28 UTC


README

Basic configuration.

License: MIT PHP version Tests Coding Style CodeFactor Coverage Status

Requirements

  • PHP 8.1 or higher
  • composer

Installation

composer require drago-ex/bootstrap

Description of the method that searches for configuration files

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.

How to specify the priorities for configuration files

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.

Notice

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.

Use

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');