Initial commit
This commit is contained in:
commit
f20ee555ea
28
DependencyInjection/Configuration.php
Normal file
28
DependencyInjection/Configuration.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticsearchBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
|
||||
/**
|
||||
* This class contains the configuration information for the bundle
|
||||
*
|
||||
* This information is solely responsible for how the different configuration
|
||||
* sections are normalized, and merged.
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
/**
|
||||
* Generates the configuration tree.
|
||||
*
|
||||
* @return \Symfony\Component\DependencyInjection\Configuration\NodeInterface
|
||||
*/
|
||||
public function getConfigTree()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$treeBuilder->root('foq_elasticsearch', 'array');
|
||||
|
||||
return $treeBuilder->buildTree();
|
||||
}
|
||||
}
|
23
DependencyInjection/FOQElasticsearchExtension.php
Normal file
23
DependencyInjection/FOQElasticsearchExtension.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticsearchBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Processor;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
|
||||
class FOQElasticsearchExtension extends Extension
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('config.xml');
|
||||
|
||||
$configuration = new Configuration();
|
||||
$processor = new Processor();
|
||||
|
||||
$config = $processor->process($configuration->getConfigTree(), $configs);
|
||||
}
|
||||
}
|
9
FOQElasticsearchBundle.php
Normal file
9
FOQElasticsearchBundle.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticsearchBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class FOQElasticsearchBundle extends Bundle
|
||||
{
|
||||
}
|
58
README.md
Normal file
58
README.md
Normal file
|
@ -0,0 +1,58 @@
|
|||
[Elastica](https://github.com/ruflin/Elastica) integration in Symfony2
|
||||
|
||||
## Installation
|
||||
|
||||
### Install elasticsearch
|
||||
|
||||
http://www.elasticsearch.org/guide/reference/setup/installation.html
|
||||
|
||||
### Install Elastica
|
||||
|
||||
#### Download
|
||||
|
||||
With submodule:
|
||||
git submodule add git://github.com/ruflin/Elastica vendor/elastica
|
||||
|
||||
With clone:
|
||||
git clone git://github.com/ruflin/Elastica vendor/elastica
|
||||
|
||||
#### Register autoloading
|
||||
|
||||
// app/autoload.php
|
||||
|
||||
$loader->registerPrefixes(array(
|
||||
...
|
||||
'elastica' => __DIR__.'/../vendor/elastica/lib',
|
||||
));
|
||||
|
||||
### Install ElasticaBundle
|
||||
|
||||
#### Download
|
||||
|
||||
With submodule:
|
||||
git submodule add git://github.com/Exercise/ElasticaBundle src/Exercise/ElasticaBundle
|
||||
|
||||
With clone:
|
||||
git clone git://github.com/Exercise/ElasticaBundle src/Exercise/ElasticaBundle
|
||||
|
||||
#### Register autoloading
|
||||
|
||||
// app/autoload.php
|
||||
|
||||
$loader->registerNamespaces(array(
|
||||
...
|
||||
'FOQ' => __DIR__.'/../src',
|
||||
));
|
||||
|
||||
#### Register the bundle
|
||||
|
||||
// app/AppKernel.php
|
||||
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
// ...
|
||||
new FOQ\ElasticaBundle\FOQElasticaBundle(),
|
||||
// ...
|
||||
);
|
||||
}
|
19
Resources/meta/LICENSE
Normal file
19
Resources/meta/LICENSE
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2011 Exercise.com, Inc
|
||||
|
||||
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.
|
Loading…
Reference in a new issue