setDefinition($id, new DefinitionDecorator('knp_gaufrette.adapter.ftp')) ->addArgument($config['directory']) ->addArgument($config['host']) ->addArgument($config) ; } /** * {@inheritDoc} */ function getKey() { return 'ftp'; } /** * {@inheritDoc} */ function addConfiguration(NodeDefinition $builder) { $builder ->children() ->scalarNode('directory')->isRequired()->end() ->scalarNode('host')->isRequired()->end() ->scalarNode('port')->defaultValue(21)->end() ->scalarNode('username')->defaultNull()->end() ->scalarNode('password')->defaultNull()->end() ->booleanNode('passive')->defaultFalse()->end() ->booleanNode('create')->defaultFalse()->end() ->scalarNode('mode') ->defaultValue(defined('FTP_ASCII') ? FTP_ASCII : null) ->beforeNormalization() ->ifString() ->then(function($v) { return constant($v); }) ->booleanNode('ssl')->defaultFalse()->end() ->end() ->end() ; } }