drago-ex / bootstrap
Basic configuration for Nette Framework
Installs: 1 863
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.1 <8.4
- nette/application: ^3.1
- nette/bootstrap: ^3.2
- nette/caching: ^3.2
- nette/utils: ^4.0
Requires (Dev)
- nette/tester: ^2.5
- phpstan/phpstan-nette: ^1.2.9
- tracy/tracy: ^2.10
README
Basic configuration.
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');