You've already forked redmine-bundle
make url and apikey parameters
This commit is contained in:
@@ -15,11 +15,28 @@ final class Configuration implements ConfigurationInterface
|
||||
$treeBuilder = new TreeBuilder('magdev_redmine');
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
$rootNode->children()
|
||||
->scalarNode('ttl')
|
||||
->isRequired()
|
||||
->info('TTL for cached api calls')
|
||||
->end()
|
||||
->end();
|
||||
->scalarNode('url')
|
||||
->info('URL of the Redmine instance')
|
||||
->example('http://your-redmine.com')
|
||||
->cannotBeEmpty()
|
||||
->isRequired()
|
||||
->end()
|
||||
->scalarNode('apiKey')
|
||||
->info('API-Key to access Redmine')
|
||||
->example('abcdefghijklmnopqrstuvwxyz')
|
||||
->cannotBeEmpty()
|
||||
->isRequired()
|
||||
->end()
|
||||
->arrayNode('cache')
|
||||
->scalarNode('ttl')
|
||||
->info('TTL for cached API calls')
|
||||
->example([1800, 'P30M'])
|
||||
->defaultValue(1800)
|
||||
->cannotBeEmpty()
|
||||
->isRequired()
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ final class MagdevRedmineExtension extends Extension
|
||||
{
|
||||
$config = $this->processConfiguration(new Configuration(), $configs);
|
||||
|
||||
$container->setParameter('magdev_redmine.ttl', $config['ttl']);
|
||||
$container->setParameter('magdev_redmine.cache.ttl', $config['cache']['ttl']);
|
||||
$container->setParameter('magdev_redmine.url', $config['url']);
|
||||
$container->setParameter('magdev_redmine.apiKey', $config['apiKey']);
|
||||
|
||||
$loader = new YamlFileLoader($container, new FileLocator(dirname(__DIR__).'/../config'));
|
||||
$loader->load('services.yaml');
|
||||
|
||||
Reference in New Issue
Block a user