springernature / bandiera-zf
Zend Framework Bandiera integration
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 58
Forks: 0
Open Issues: 0
Type:module
Requires
- php: ^7.2
- container-interop/container-interop: ^1.1
- npg/bandiera-client-php: ^1.0
- zendframework/zend-modulemanager: ^2.7
- zendframework/zend-stdlib: ^3.1
Requires (Dev)
- phpspec/prophecy: ^1.7
- phpunit/phpunit: ^8.0
- roave/security-advisories: dev-master
- symfony/var-dumper: ^3 || ^4
- zendframework/zend-eventmanager: ^2.6 | ^3.0
- zendframework/zend-i18n: ^2.7
- zendframework/zend-loader: ^2.5
- zendframework/zend-log: ^2.9
- zendframework/zend-mvc: ^3.0
- zendframework/zend-serializer: ^2.8
- zendframework/zend-view: ^2.7
This package is not auto-updated.
Last update: 2022-02-18 11:41:05 UTC
README
This integrates bandiera for using feature flags in your applications.
This module relies on the bandiera PHP client.
Installation
Installation is done via composer.
composer require springernature/bandiera-zf
Enable the module by adding the module to your application.config.php
:
return [ 'modules' => [ // ... 'SpringerNature\Zend\Bandiera', // ... ], // ...
Copy the sample config file springernature_bandiera.config.php
to your project.
Usage
This module register into the service container a default client called springernature.bandiera.client
.
public function myService(Client $bandiera) { if ($bandiera->isEnabled('my_app', 'feature') { // Do something } }
This module also expose a featureFlags
view helper. In a template the view helper can be used as following
<?php if ($this->featureFlags('feature', ['param' => 'foo'])) : ?> <?php endif; ?>
Development
- Fork this repo.
- Run
composer install
- Run the tests
composer run-script tests
License
Bandiera Zend Framework Integration is licensed under the MIT License.