narrowspark/configurators

This package is abandoned and no longer maintained. No replacement package was suggested.

Automatic configurators for the narrowspark framework

Fund package maintenance!
prisis

Installs: 197

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 2

Open Issues: 2

Type:automatic-configurator

0.8.0 2019-11-22 09:07 UTC

README

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6172726f77737061726b2f636f6e666967757261746f72732e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e332e302d3838393242462e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f727573742d6c616e672f727573742f6d61737465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6e6172726f77737061726b2f636f6e666967757261746f72732f6d61737465722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265

Installation

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):

{   
    "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:

// 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.

{   
    "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.

{   
    "extra": {
        "automatic": {
            "bootstrap": {
                "Viserio\\Component\\Foundation\\Bootstrap\\LoadEnvironmentVariables": ["http"]
            }
        }
    }
}

Contributing

If you would like to help take a look at the list of issues and check our Contributing 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

License

The Narrowspark configurators is open-sourced software licensed under the MIT license