wallabag/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
Jeremy Benoist 426bb453d2
API user creation behing a toggle
I've added a toggle feature (in internal settings) so that user api creation can be disabled while form registration still can be enabled.
Also, the /api/user endpoint shouldn't require authentication. Even if we check the authentication when sending a GET request, to retrieve current user information.

I've moved all the internal settings definition to config to avoid duplicated place to define them.
I don't know why we didn't did that earlier.
2017-06-02 11:32:38 +02:00

72 lines
2.4 KiB
PHP

<?php
namespace Wallabag\CoreBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('wallabag_core');
$rootNode
->children()
->arrayNode('languages')
->prototype('scalar')->end()
->end()
->integerNode('items_on_page')
->defaultValue(12)
->end()
->scalarNode('theme')
->defaultValue('material')
->end()
->scalarNode('language')
->defaultValue('en')
->end()
->integerNode('rss_limit')
->defaultValue(50)
->end()
->integerNode('reading_speed')
->defaultValue(1)
->end()
->scalarNode('version')
->end()
->scalarNode('paypal_url')
->end()
->integerNode('cache_lifetime')
->defaultValue(10)
->end()
->scalarNode('fetching_error_message')
->end()
->scalarNode('fetching_error_message_title')
->end()
->scalarNode('action_mark_as_read')
->defaultValue(1)
->end()
->scalarNode('list_mode')
->defaultValue(1)
->end()
->scalarNode('api_limit_mass_actions')
->defaultValue(10)
->end()
->arrayNode('default_internal_settings')
->prototype('array')
->children()
->scalarNode('name')->end()
->scalarNode('value')->end()
->enumNode('section')
->values(['entry', 'misc', 'api', 'analytics', 'export', 'import'])
->end()
->end()
->end()
->end()
->end()
;
return $treeBuilder;
}
}