diff --git a/CHANGELOG.md b/CHANGELOG.md index 77aef016..d2f9606a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +1.3.2 +----- + +* Added curl-options to configuration + 1.3.1 ----- diff --git a/Command/LoadFixtureCommand.php b/Command/LoadFixtureCommand.php index b1d85357..2dea4ec2 100644 --- a/Command/LoadFixtureCommand.php +++ b/Command/LoadFixtureCommand.php @@ -56,7 +56,7 @@ protected function configure() ->addOption('no-initialize', null, InputOption::VALUE_NONE, 'Do not run the repository initializers after purging the repository.') ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command (deprecated, alias for dm)') ->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command') - ->setHelp(<<setHelp(<<<'EOT' The doctrine:phpcr:fixtures:load command loads data fixtures from your bundles DataFixtures/PHPCR directory: diff --git a/Command/MigratorMigrateCommand.php b/Command/MigratorMigrateCommand.php index 899b180d..e0dbc791 100644 --- a/Command/MigratorMigrateCommand.php +++ b/Command/MigratorMigrateCommand.php @@ -40,7 +40,7 @@ protected function configure() ->addOption('identifier', null, InputOption::VALUE_OPTIONAL, 'Path or UUID of the node to dump', '/') ->addOption('depth', null, InputOption::VALUE_OPTIONAL, 'Set to a number to limit how deep into the tree to recurse', '-1') ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The session to use for this command') - ->setHelp(<<setHelp(<<<'EOT' To find the available 'migrators' run this command without an input argument EOT ) diff --git a/Command/NodeTypeRegisterCommand.php b/Command/NodeTypeRegisterCommand.php index d2005b19..51fb6b2b 100644 --- a/Command/NodeTypeRegisterCommand.php +++ b/Command/NodeTypeRegisterCommand.php @@ -38,7 +38,7 @@ class NodeTypeRegisterCommand extends BaseRegisterNodeTypesCommand protected function configure() { parent::configure(); - $newHelp = <<addArgument('cmd', InputArgument::IS_ARRAY); $this->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The session to use for this command'); $this->setDescription('Proxy for an embedded PHPCR Shell. Commands should be quoted'); - $this->setHelp(<<setHelp(<<<'EOT' This command will send commands to an embedded PHPCR shell. For it to work you will need to have the phpcr-shell dependency installed. diff --git a/Command/RepositoryInitCommand.php b/Command/RepositoryInitCommand.php index 4bbc36ff..d39ee669 100644 --- a/Command/RepositoryInitCommand.php +++ b/Command/RepositoryInitCommand.php @@ -52,7 +52,7 @@ protected function configure() ->setName('doctrine:phpcr:repository:init') ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The session to use for this command') ->setDescription('Initialize the PHPCR repository.') - ->setHelp(<<setHelp(<<<'EOT' Run all initializers tagged with doctrine_phpcr.initializer to create documents or base paths so the application can work. If phpcr-odm is present, also runs the doctrine:phpcr:register-system-node-types command. diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 328d47eb..8b5085f9 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -166,6 +166,10 @@ private function getPHPCRSessionsNode() ->useAttributeAsKey('key') ->prototype('scalar')->end() ->end() + ->arrayNode('curl_options') + ->useAttributeAsKey('key') + ->prototype('scalar')->end() + ->end() // jackrabbit ->scalarNode('url')->end() diff --git a/DependencyInjection/DoctrinePHPCRExtension.php b/DependencyInjection/DoctrinePHPCRExtension.php index 00187bbc..9c0be79b 100644 --- a/DependencyInjection/DoctrinePHPCRExtension.php +++ b/DependencyInjection/DoctrinePHPCRExtension.php @@ -20,19 +20,19 @@ namespace Doctrine\Bundle\PHPCRBundle\DependencyInjection; +use Doctrine\ODM\PHPCR\Version; +use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; +use Symfony\Component\Config\Definition\Processor; +use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Alias; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\DefinitionDecorator; -use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; -use Symfony\Component\Config\FileLocator; -use Symfony\Component\Config\Definition\Processor; -use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension; -use Doctrine\ODM\PHPCR\Version; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Reference; /** * PHPCR Extension. @@ -210,6 +210,18 @@ private function loadJackalopeSession(array $session, ContainerBuilder $containe // pipe additional parameters unchanged to jackalope $backendParameters += $session['backend']['parameters']; + if (array_key_exists('curl_options', $session['backend']) && count($session['backend']['curl_options'])) { + $curlOptions = array(); + foreach ($session['backend']['curl_options'] as $option => $value) { + if (!is_int($option)) { + $option = constant($option); + } + + $curlOptions[$option] = $value; + } + $backendParameters['jackalope.jackrabbit_curl_options'] = $curlOptions; + } + // only set this default here when we know we are jackalope if (!isset($backendParameters['jackalope.check_login_on_server'])) { $backendParameters['jackalope.check_login_on_server'] = false; diff --git a/OptionalCommand/Jackalope/JackrabbitCommand.php b/OptionalCommand/Jackalope/JackrabbitCommand.php index ca2dd292..0c7d5ecd 100644 --- a/OptionalCommand/Jackalope/JackrabbitCommand.php +++ b/OptionalCommand/Jackalope/JackrabbitCommand.php @@ -65,7 +65,7 @@ protected function configure() $this ->setName('doctrine:phpcr:jackrabbit') - ->setHelp(<<setHelp(<<<'EOF' The doctrine:phpcr:jackrabbit command allows to have a minimal control on the Jackrabbit server from within a Symfony 2 command. diff --git a/OptionalCommand/ODM/DocumentConvertTranslationCommand.php b/OptionalCommand/ODM/DocumentConvertTranslationCommand.php index 5674d574..ecd9caa5 100644 --- a/OptionalCommand/ODM/DocumentConvertTranslationCommand.php +++ b/OptionalCommand/ODM/DocumentConvertTranslationCommand.php @@ -42,7 +42,7 @@ protected function configure() $this ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.', null) - ->setHelp($this->getHelp().<<setHelp($this->getHelp().<<<'EOT' If you are using multiple document managers you can pick your choice with the --session option: diff --git a/OptionalCommand/ODM/InfoDoctrineCommand.php b/OptionalCommand/ODM/InfoDoctrineCommand.php index ab60bdfb..191a1247 100644 --- a/OptionalCommand/ODM/InfoDoctrineCommand.php +++ b/OptionalCommand/ODM/InfoDoctrineCommand.php @@ -42,7 +42,7 @@ protected function configure() $this ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.', null) - ->setHelp($this->getHelp().<<setHelp($this->getHelp().<<<'EOT' If you are using multiple document managers you can pick your choice with the --session option: diff --git a/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php b/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php index 9bb777d5..a2dc8713 100644 --- a/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php +++ b/OptionalCommand/ODM/VerifyUniqueNodeTypesMappingCommand.php @@ -42,7 +42,7 @@ protected function configure() ->setName('doctrine:phpcr:mapping:verify-unique-node-types') ->setDescription('Verify that documents claiming to have unique node types are truly unique') ->addOption('session', null, InputOption::VALUE_OPTIONAL, 'The session to use for this command') - ->setHelp(<<setHelp(<<<'EOT' The %command.name% command checks all mapped PHPCR-ODM documents and verifies that any claiming to use unique node types are truly unique. EOT diff --git a/Tests/Unit/DependencyInjection/ConfigurationTest.php b/Tests/Unit/DependencyInjection/ConfigurationTest.php index f2c3490f..073be596 100644 --- a/Tests/Unit/DependencyInjection/ConfigurationTest.php +++ b/Tests/Unit/DependencyInjection/ConfigurationTest.php @@ -61,6 +61,7 @@ public function configurations() 'jackalope.default_header' => 'X-ID: %serverid%', 'jackalope.jackrabbit_expect' => true, ), + 'curl_options' => array(), 'url' => 'http://localhost:8080/server/', 'backtrace' => false, ), @@ -137,6 +138,7 @@ public function configurations() 'factory' => null, 'parameters' => array( ), + 'curl_options' => array(), 'url' => 'http://a', 'backtrace' => false, ), @@ -155,6 +157,7 @@ public function configurations() 'profiling' => false, 'parameters' => array( ), + 'curl_options' => array(), 'url' => 'http://b', 'backtrace' => false, 'factory' => null, @@ -238,6 +241,7 @@ public function configurations() 'jackalope.disable_stream_wrapper' => true, 'jackalope.disable_transactions' => true, ), + 'curl_options' => array(), ), 'workspace' => 'default', 'username' => 'admin',