Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial import

  • Loading branch information...
commit 8611f24aafd19f0809d7cc0ec55bf36ff9300ae2 0 parents
@igorw igorw authored
48 DependencyInjection/Configuration.php
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ * This file is part of the Nelmio SolariumBundle.
+ *
+ * (c) Nelmio <hello@nelm.io>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Nelmio\SolariumBundle\DependencyInjection;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+use Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition;
+use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
+use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
+
+/**
+ * @author Igor Wiedler <igor@wiedler.ch>
+ */
+class Configuration implements ConfigurationInterface
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function getConfigTreeBuilder()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('Nelmio_solarium');
+
+ $rootNode
+ ->children()
+ ->arrayNode('adapter')
+ ->children()
+ ->scalarNode('class')->defaultValue('Solarium_Client_Adapter_Http')->end()
+ ->scalarNode('host')->defaultValue('127.0.0.1')->end()
+ ->scalarNode('port')->defaultValue(8983)->end()
+ ->scalarNode('path')->defaultValue('/solr')->end()
+ ->end()
+ ->end()
+ ->end()
+ ;
+
+ return $treeBuilder;
+ }
+}
46 DependencyInjection/NelmioSolariumExtension.php
@@ -0,0 +1,46 @@
+<?php
+
+/*
+ * This file is part of the Nelmio SolariumBundle.
+ *
+ * (c) Nelmio <hello@nelm.io>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Nelmio\SolariumBundle\DependencyInjection;
+
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
+/**
+ * @author Igor Wiedler <igor@wiedler.ch>
+ */
+class NelmioSolariumExtension extends Extension
+{
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ $processor = new Processor();
+ $configuration = new Configuration();
+ $config = $processor->processConfiguration($configuration, $configs);
+ $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+
+ if (!empty($config['adapter'])) {
+ $options = array(
+ 'adapter' => $config['adapter']['class'],
+ 'adapteroptions' => array(
+ 'host' => $config['adapter']['host'],
+ 'port' => $config['adapter']['port'],
+ 'path' => $config['adapter']['path'],
+ ),
+ );
+ $container->setParameter('solarium.client.options', $options);
+
+ $loader->load('services.yml');
+ }
+ }
+}
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Nelmio
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
21 NelmioSolariumBundle.php
@@ -0,0 +1,21 @@
+<?php
+
+/*
+ * This file is part of the Nelmio SolariumBundle.
+ *
+ * (c) Nelmio <hello@nelm.io>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Nelmio\SolariumBundle;
+
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+/**
+ * @author Igor Wiedler <igor@wiedler.ch>
+ */
+class NelmioSolariumBundle extends Bundle
+{
+}
42 README.md
@@ -0,0 +1,42 @@
+# NelmioSolariumBundle
+
+## About
+
+The NelmioSolariumBundle provides integration with the [solarium](www.solarium-project.org)
+solr client.
+
+## Features
+
+...
+
+## Configuration
+
+...
+
+## Installation
+
+Put the NelmioSolariumBundle into the ``vendor/bundles/Nelmio`` directory:
+
+ $ git clone git://github.com/nelmio/NelmioSolariumBundle.git vendor/bundles/Nelmio/SolariumBundle
+
+Register the `Nelmio` namespace in your project's autoload script (app/autoload.php):
+
+ $loader->registerNamespaces(array(
+ 'Nelmio' => __DIR__.'/../vendor/bundles',
+ ));
+
+Add the NelmioSolariumBundle to your application's kernel:
+
+ public function registerBundles()
+ {
+ $bundles = array(
+ ...
+ new Nelmio\SolariumBundle\NelmioSolariumBundle(),
+ ...
+ );
+ ...
+ }
+
+## License
+
+Released under the MIT License, see LICENSE.
4 Resources/config/services.yml
@@ -0,0 +1,4 @@
+services:
+ solarium.client:
+ class: Solarium_Client
+ arguments: [ %solarium.client.options% ]
25 composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "nelmio/solarium-bundle",
+ "description": "Integration with solarium solr client.",
+ "keywords": ["solr", "solarium", "search"],
+ "type": "symfony-bundle",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nelmio",
+ "homepage": "http://nelm.io"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://github.com/nelmio/NelmioSolariumBundle/contributors"
+ }
+ ],
+ "require": {
+ "symfony/framework-bundle": "2.*",
+ "solarium/solarium": ">=2.3.0-dev"
+ },
+ "autoload": {
+ "psr-0": { "Nelmio\\SolariumBundle": "" }
+ },
+ "target-dir": "Nelmio/SolariumBundle"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.