Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narrowspark/configurators
:microscope: Automatic configurators for the narrowspark framework.
https://github.com/narrowspark/configurators
automatic automatic-configurators narrowspark narrowspark-framework php73
Last synced: about 2 months ago
JSON representation
:microscope: Automatic configurators for the narrowspark framework.
- Host: GitHub
- URL: https://github.com/narrowspark/configurators
- Owner: narrowspark
- License: mit
- Archived: true
- Created: 2018-05-01T10:17:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T06:58:50.000Z (over 2 years ago)
- Last Synced: 2024-09-25T20:04:27.655Z (about 2 months ago)
- Topics: automatic, automatic-configurators, narrowspark, narrowspark-framework, php73
- Language: PHP
- Homepage:
- Size: 136 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Automatic Narrowspark Framework Configurators
Installation
------------```bash
composer require narrowspark/automatic narrowspark/configurators
```Configurators
-------------
There are several types of tasks, which are called **configurators:**
`options`, `bootstrap` and `providers`.`providers` Configurator
Turns on one or more service provider in the Narrowspark app by appending them to the `serviceproviders.php` file.
Its value is an associative array where the key is the service provider class name and the value is an array of environments where it must be used.
The supported environments are `local`, `prod`, `testing` and `global` (which enables the `service provider` in all environments):```json
{
"extra": {
"automatic": {
"providers": {
"Viserio\\Component\\Routing\\Provider\\RoutingServiceProvider": [
"global"
],
"Viserio\\Component\\Routing\\Provider\\RoutingDataCollectorServiceProvider": [
"testing"
]
}
}
}
}
```The previous operation is transformed into the following PHP code:
```php
// config/serviceproviders.php
return [
/** > viserio/routing **/
\Viserio\Component\Routing\Provider\RoutingServiceProvider::class,
/** viserio/routing < **/
];// config/testing/serviceproviders.php
return [
/** > viserio/routing **/
\Viserio\Component\Routing\Provider\RoutingDataCollectorServiceProvider::class,
/** viserio/routing < **/
];
````options` Configurator
Adds new config files to the `config` folder provided from your root composer.json `config-dir` name.
> **Note:** the package name is taken to generate the file name.
This example creates a new `view` config file in the `packages` folder and `packages/test` folder:
> **Note:** the first array key is taken as environment key, like `global` or `test` in this example.
```json
{
"extra": {
"automatic": {
"options": {
"global": {
"viserio": {
"view": {
"paths": null
}
}
},
"test": {
"viserio": {
"view": {
"paths": [
"./views/"
]
}
}
}
}
}
}
}
````bootstrap` Configurator
This example creates new `bootstrap` configs for the `console` and `http` kernel:
you can choose between `http`, `console` and `global` type to configure your kernel bootstraps,
with the possibility to configure bootstraps for your chosen environment.> **Note:** generates a new `bootstrap.php` file to the `config` folder provided from your root composer.json `config-dir` name, if the file doesn’t exists.
> **Note:** the `global` type will configure both kernels.
```json
{
"extra": {
"automatic": {
"bootstrap": {
"Viserio\\Component\\Foundation\\Bootstrap\\LoadEnvironmentVariables": ["http"]
}
}
}
}
```Contributing
------------If you would like to help take a look at the [list of issues](https://github.com/narrowspark/configurators/issues) and check our [Contributing](CONTRIBUTING.md) guild.
> **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Credits
-------------- [Daniel Bannert](https://github.com/prisis)
- [All Contributors](https://github.com/narrowspark/automatic/graphs/contributors)License
---------------The Narrowspark configurators is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)
[1]: http://github.com/jshttp/mime-db