Rename FOQ namespaces and services to FOS

This commit is contained in:
Jeremy Mikola 2013-03-27 13:39:28 -04:00
parent 22ad3cfe01
commit 49de4d361d
66 changed files with 292 additions and 292 deletions

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use Elastica_Client; use Elastica_Client;
use FOQ\ElasticaBundle\Logger\ElasticaLogger; use FOS\ElasticaBundle\Logger\ElasticaLogger;
/** /**
* @author Gordon Franke <info@nevalon.de> * @author Gordon Franke <info@nevalon.de>

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Command; namespace FOS\ElasticaBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
@ -20,7 +20,7 @@ class PopulateCommand extends ContainerAwareCommand
protected function configure() protected function configure()
{ {
$this $this
->setName('foq:elastica:populate') ->setName('fos:elastica:populate')
->setDescription('Populates search indexes from providers') ->setDescription('Populates search indexes from providers')
->addOption('no-reset', null, InputOption::VALUE_NONE, 'Do not reset the indexes before they are populated.'); ->addOption('no-reset', null, InputOption::VALUE_NONE, 'Do not reset the indexes before they are populated.');
} }
@ -32,18 +32,18 @@ class PopulateCommand extends ContainerAwareCommand
{ {
if (!$input->getOption('no-reset')) { if (!$input->getOption('no-reset')) {
$output->writeln('Resetting indexes'); $output->writeln('Resetting indexes');
$this->getContainer()->get('foq_elastica.reseter')->reset(); $this->getContainer()->get('fos_elastica.reseter')->reset();
} }
$output->writeln('Populating indexes'); $output->writeln('Populating indexes');
$this->getContainer()->get('foq_elastica.populator')->populate(function($text) use ($output) { $this->getContainer()->get('fos_elastica.populator')->populate(function($text) use ($output) {
$output->writeLn($text); $output->writeLn($text);
}); });
$output->writeln('Refreshing indexes'); $output->writeln('Refreshing indexes');
array_map(function($index) { array_map(function($index) {
$index->refresh(); $index->refresh();
}, $this->getContainer()->get('foq_elastica.index_manager')->getAllIndexes()); }, $this->getContainer()->get('fos_elastica.index_manager')->getAllIndexes());
$output->writeln('Done'); $output->writeln('Done');
} }

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Command; namespace FOS\ElasticaBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
@ -32,7 +32,7 @@ class SearchCommand extends ContainerAwareCommand
->addOption('show-source', null, InputOption::VALUE_NONE, 'Show the documents sources') ->addOption('show-source', null, InputOption::VALUE_NONE, 'Show the documents sources')
->addOption('show-id', null, InputOption::VALUE_NONE, 'Show the documents ids') ->addOption('show-id', null, InputOption::VALUE_NONE, 'Show the documents ids')
->addOption('explain', null, InputOption::VALUE_NONE, 'Enables explanation for each hit on how its score was computed.') ->addOption('explain', null, InputOption::VALUE_NONE, 'Enables explanation for each hit on how its score was computed.')
->setName('foq:elastica:search') ->setName('fos:elastica:search')
->setDescription('Searches documents in a given type and index'); ->setDescription('Searches documents in a given type and index');
} }
@ -41,7 +41,7 @@ class SearchCommand extends ContainerAwareCommand
*/ */
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
$index = $this->getContainer()->get('foq_elastica.index_manager')->getIndex($input->getOption('index')); $index = $this->getContainer()->get('fos_elastica.index_manager')->getIndex($input->getOption('index'));
$type = $index->getType($input->getArgument('type')); $type = $index->getType($input->getArgument('type'));
$query = Elastica_Query::create($input->getArgument('query')); $query = Elastica_Query::create($input->getArgument('query'));
$query->setLimit($input->getOption('limit')); $query->setLimit($input->getOption('limit'));

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Configuration; namespace FOS\ElasticaBundle\Configuration;
/** /**
* Annotation class for setting search repository. * Annotation class for setting search repository.

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\DataCollector; namespace FOS\ElasticaBundle\DataCollector;
use FOQ\ElasticaBundle\Logger\ElasticaLogger; use FOS\ElasticaBundle\Logger\ElasticaLogger;
use Symfony\Component\HttpKernel\DataCollector\DataCollector; use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\DependencyInjection\Compiler; namespace FOS\ElasticaBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@ -13,15 +13,15 @@ class AddProviderPass implements CompilerPassInterface
*/ */
public function process(ContainerBuilder $container) public function process(ContainerBuilder $container)
{ {
if (!$container->hasDefinition('foq_elastica.populator')) { if (!$container->hasDefinition('fos_elastica.populator')) {
return; return;
} }
$providers = array(); $providers = array();
foreach ($container->findTaggedServiceIds('foq_elastica.provider') as $id => $attributes) { foreach ($container->findTaggedServiceIds('fos_elastica.provider') as $id => $attributes) {
$providers[$id] = new Reference($id); $providers[$id] = new Reference($id);
} }
$container->getDefinition('foq_elastica.populator')->replaceArgument(0, $providers); $container->getDefinition('fos_elastica.populator')->replaceArgument(0, $providers);
} }
} }

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\DependencyInjection\Compiler; namespace FOS\ElasticaBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@ -20,13 +20,13 @@ class TransformerPass implements CompilerPassInterface
*/ */
public function process(ContainerBuilder $container) public function process(ContainerBuilder $container)
{ {
if (!$container->hasDefinition('foq_elastica.elastica_to_model_transformer.collection.prototype')) { if (!$container->hasDefinition('fos_elastica.elastica_to_model_transformer.collection.prototype')) {
return; return;
} }
$transformers = array(); $transformers = array();
foreach ($container->findTaggedServiceIds('foq_elastica.elastica_to_model_transformer') as $id => $tags) { foreach ($container->findTaggedServiceIds('fos_elastica.elastica_to_model_transformer') as $id => $tags) {
foreach ($tags as $tag) { foreach ($tags as $tag) {
if (empty($tag['index']) || empty($tag['type'])) { if (empty($tag['index']) || empty($tag['type'])) {
throw new InvalidArgumentException('The Transformer must have both a type and an index defined.'); throw new InvalidArgumentException('The Transformer must have both a type and an index defined.');
@ -37,11 +37,11 @@ class TransformerPass implements CompilerPassInterface
} }
foreach ($transformers as $index => $indexTransformers) { foreach ($transformers as $index => $indexTransformers) {
if (!$container->hasDefinition(sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $index))) { if (!$container->hasDefinition(sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $index))) {
continue; continue;
} }
$index = $container->getDefinition(sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $index)); $index = $container->getDefinition(sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $index));
$index->replaceArgument(0, $indexTransformers); $index->replaceArgument(0, $indexTransformers);
} }
} }

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\DependencyInjection; namespace FOS\ElasticaBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
@ -17,7 +17,7 @@ class Configuration
public function getConfigTree() public function getConfigTree()
{ {
$treeBuilder = new TreeBuilder(); $treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('foq_elastica', 'array'); $rootNode = $treeBuilder->root('fos_elastica', 'array');
$this->addClientsSection($rootNode); $this->addClientsSection($rootNode);
$this->addIndexesSection($rootNode); $this->addIndexesSection($rootNode);

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\DependencyInjection; namespace FOS\ElasticaBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Processor; use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\HttpKernel\DependencyInjection\Extension;
@ -12,7 +12,7 @@ use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
use InvalidArgumentException; use InvalidArgumentException;
class FOQElasticaExtension extends Extension class FOSElasticaExtension extends Extension
{ {
protected $indexConfigs = array(); protected $indexConfigs = array();
protected $typeFields = array(); protected $typeFields = array();
@ -50,8 +50,8 @@ class FOQElasticaExtension extends Extension
$this->loadIndexManager($indexDefsByName, $container->getDefinition($indexIdsByName[$config['default_index']]), $container); $this->loadIndexManager($indexDefsByName, $container->getDefinition($indexIdsByName[$config['default_index']]), $container);
$this->loadReseter($this->indexConfigs, $container); $this->loadReseter($this->indexConfigs, $container);
$container->setAlias('foq_elastica.client', sprintf('foq_elastica.client.%s', $config['default_client'])); $container->setAlias('fos_elastica.client', sprintf('fos_elastica.client.%s', $config['default_client']));
$container->setAlias('foq_elastica.index', sprintf('foq_elastica.index.%s', $config['default_index'])); $container->setAlias('fos_elastica.index', sprintf('fos_elastica.index.%s', $config['default_index']));
$this->createDefaultManagerAlias($config['default_manager'], $container); $this->createDefaultManagerAlias($config['default_manager'], $container);
} }
@ -66,10 +66,10 @@ class FOQElasticaExtension extends Extension
{ {
$clientIds = array(); $clientIds = array();
foreach ($clients as $name => $clientConfig) { foreach ($clients as $name => $clientConfig) {
$clientDef = $container->getDefinition('foq_elastica.client'); $clientDef = $container->getDefinition('fos_elastica.client');
$clientDef->replaceArgument(0, $clientConfig); $clientDef->replaceArgument(0, $clientConfig);
$clientId = sprintf('foq_elastica.client.%s', $name); $clientId = sprintf('fos_elastica.client.%s', $name);
$container->setDefinition($clientId, $clientDef); $container->setDefinition($clientId, $clientDef);
@ -99,9 +99,9 @@ class FOQElasticaExtension extends Extension
} }
$clientId = $clientIdsByName[$clientName]; $clientId = $clientIdsByName[$clientName];
$indexId = sprintf('foq_elastica.index.%s', $name); $indexId = sprintf('fos_elastica.index.%s', $name);
$indexDefArgs = array($name); $indexDefArgs = array($name);
$indexDef = new Definition('%foq_elastica.index.class%', $indexDefArgs); $indexDef = new Definition('%fos_elastica.index.class%', $indexDefArgs);
$indexDef->setFactoryService($clientId); $indexDef->setFactoryService($clientId);
$indexDef->setFactoryMethod('getIndex'); $indexDef->setFactoryMethod('getIndex');
$container->setDefinition($indexId, $indexDef); $container->setDefinition($indexId, $indexDef);
@ -135,13 +135,13 @@ class FOQElasticaExtension extends Extension
*/ */
protected function loadIndexFinder(ContainerBuilder $container, $name, $indexId) protected function loadIndexFinder(ContainerBuilder $container, $name, $indexId)
{ {
$abstractTransformerId = 'foq_elastica.elastica_to_model_transformer.collection.prototype'; $abstractTransformerId = 'fos_elastica.elastica_to_model_transformer.collection.prototype';
$transformerId = sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $name); $transformerId = sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $name);
$transformerDef = new DefinitionDecorator($abstractTransformerId); $transformerDef = new DefinitionDecorator($abstractTransformerId);
$container->setDefinition($transformerId, $transformerDef); $container->setDefinition($transformerId, $transformerDef);
$abstractFinderId = 'foq_elastica.finder.prototype'; $abstractFinderId = 'fos_elastica.finder.prototype';
$finderId = sprintf('foq_elastica.finder.%s', $name); $finderId = sprintf('fos_elastica.finder.%s', $name);
$finderDef = new DefinitionDecorator($abstractFinderId); $finderDef = new DefinitionDecorator($abstractFinderId);
$finderDef->replaceArgument(0, new Reference($indexId)); $finderDef->replaceArgument(0, new Reference($indexId));
$finderDef->replaceArgument(1, new Reference($transformerId)); $finderDef->replaceArgument(1, new Reference($transformerId));
@ -163,7 +163,7 @@ class FOQElasticaExtension extends Extension
$type = self::deepArrayUnion($typePrototypeConfig, $type); $type = self::deepArrayUnion($typePrototypeConfig, $type);
$typeId = sprintf('%s.%s', $indexId, $name); $typeId = sprintf('%s.%s', $indexId, $name);
$typeDefArgs = array($name); $typeDefArgs = array($name);
$typeDef = new Definition('%foq_elastica.type.class%', $typeDefArgs); $typeDef = new Definition('%fos_elastica.type.class%', $typeDefArgs);
$typeDef->setFactoryService($indexId); $typeDef->setFactoryService($indexId);
$typeDef->setFactoryMethod('getType'); $typeDef->setFactoryMethod('getType');
$container->setDefinition($typeId, $typeDef); $container->setDefinition($typeId, $typeDef);
@ -217,7 +217,7 @@ class FOQElasticaExtension extends Extension
if (isset($typeConfig['provider'])) { if (isset($typeConfig['provider'])) {
$providerId = $this->loadTypeProvider($typeConfig, $container, $objectPersisterId, $typeDef, $indexName, $typeName); $providerId = $this->loadTypeProvider($typeConfig, $container, $objectPersisterId, $typeDef, $indexName, $typeName);
$container->getDefinition('foq_elastica.populator')->addMethodCall('addProvider', array($providerId, new Reference($providerId))); $container->getDefinition('fos_elastica.populator')->addMethodCall('addProvider', array($providerId, new Reference($providerId)));
} }
if (isset($typeConfig['finder'])) { if (isset($typeConfig['finder'])) {
$this->loadTypeFinder($typeConfig, $container, $elasticaToModelTransformerId, $typeDef, $indexName, $typeName); $this->loadTypeFinder($typeConfig, $container, $elasticaToModelTransformerId, $typeDef, $indexName, $typeName);
@ -232,10 +232,10 @@ class FOQElasticaExtension extends Extension
if (isset($typeConfig['elastica_to_model_transformer']['service'])) { if (isset($typeConfig['elastica_to_model_transformer']['service'])) {
return $typeConfig['elastica_to_model_transformer']['service']; return $typeConfig['elastica_to_model_transformer']['service'];
} }
$abstractId = sprintf('foq_elastica.elastica_to_model_transformer.prototype.%s', $typeConfig['driver']); $abstractId = sprintf('fos_elastica.elastica_to_model_transformer.prototype.%s', $typeConfig['driver']);
$serviceId = sprintf('foq_elastica.elastica_to_model_transformer.%s.%s', $indexName, $typeName); $serviceId = sprintf('fos_elastica.elastica_to_model_transformer.%s.%s', $indexName, $typeName);
$serviceDef = new DefinitionDecorator($abstractId); $serviceDef = new DefinitionDecorator($abstractId);
$serviceDef->addTag('foq_elastica.elastica_to_model_transformer', array('type' => $typeName, 'index' => $indexName)); $serviceDef->addTag('fos_elastica.elastica_to_model_transformer', array('type' => $typeName, 'index' => $indexName));
// Doctrine has a mandatory service as first argument // Doctrine has a mandatory service as first argument
$argPos = ('propel' === $typeConfig['driver']) ? 0 : 1; $argPos = ('propel' === $typeConfig['driver']) ? 0 : 1;
@ -255,8 +255,8 @@ class FOQElasticaExtension extends Extension
if (isset($typeConfig['model_to_elastica_transformer']['service'])) { if (isset($typeConfig['model_to_elastica_transformer']['service'])) {
return $typeConfig['model_to_elastica_transformer']['service']; return $typeConfig['model_to_elastica_transformer']['service'];
} }
$abstractId = sprintf('foq_elastica.model_to_elastica_transformer.prototype.auto'); $abstractId = sprintf('fos_elastica.model_to_elastica_transformer.prototype.auto');
$serviceId = sprintf('foq_elastica.model_to_elastica_transformer.%s.%s', $indexName, $typeName); $serviceId = sprintf('fos_elastica.model_to_elastica_transformer.%s.%s', $indexName, $typeName);
$serviceDef = new DefinitionDecorator($abstractId); $serviceDef = new DefinitionDecorator($abstractId);
$serviceDef->replaceArgument(0, array( $serviceDef->replaceArgument(0, array(
'identifier' => $typeConfig['identifier'] 'identifier' => $typeConfig['identifier']
@ -268,8 +268,8 @@ class FOQElasticaExtension extends Extension
protected function loadObjectPersister(array $typeConfig, Definition $typeDef, ContainerBuilder $container, $indexName, $typeName, $transformerId) protected function loadObjectPersister(array $typeConfig, Definition $typeDef, ContainerBuilder $container, $indexName, $typeName, $transformerId)
{ {
$abstractId = sprintf('foq_elastica.object_persister.prototype'); $abstractId = sprintf('fos_elastica.object_persister.prototype');
$serviceId = sprintf('foq_elastica.object_persister.%s.%s', $indexName, $typeName); $serviceId = sprintf('fos_elastica.object_persister.%s.%s', $indexName, $typeName);
$serviceDef = new DefinitionDecorator($abstractId); $serviceDef = new DefinitionDecorator($abstractId);
$serviceDef->replaceArgument(0, $typeDef); $serviceDef->replaceArgument(0, $typeDef);
$serviceDef->replaceArgument(1, new Reference($transformerId)); $serviceDef->replaceArgument(1, new Reference($transformerId));
@ -285,8 +285,8 @@ class FOQElasticaExtension extends Extension
if (isset($typeConfig['provider']['service'])) { if (isset($typeConfig['provider']['service'])) {
return $typeConfig['provider']['service']; return $typeConfig['provider']['service'];
} }
$abstractProviderId = sprintf('foq_elastica.provider.prototype.%s', $typeConfig['driver']); $abstractProviderId = sprintf('fos_elastica.provider.prototype.%s', $typeConfig['driver']);
$providerId = sprintf('foq_elastica.provider.%s.%s', $indexName, $typeName); $providerId = sprintf('fos_elastica.provider.%s.%s', $indexName, $typeName);
$providerDef = new DefinitionDecorator($abstractProviderId); $providerDef = new DefinitionDecorator($abstractProviderId);
$providerDef->replaceArgument(0, $typeDef); $providerDef->replaceArgument(0, $typeDef);
@ -314,8 +314,8 @@ class FOQElasticaExtension extends Extension
if (isset($typeConfig['listener']['service'])) { if (isset($typeConfig['listener']['service'])) {
return $typeConfig['listener']['service']; return $typeConfig['listener']['service'];
} }
$abstractListenerId = sprintf('foq_elastica.listener.prototype.%s', $typeConfig['driver']); $abstractListenerId = sprintf('fos_elastica.listener.prototype.%s', $typeConfig['driver']);
$listenerId = sprintf('foq_elastica.listener.%s.%s', $indexName, $typeName); $listenerId = sprintf('fos_elastica.listener.%s.%s', $indexName, $typeName);
$listenerDef = new DefinitionDecorator($abstractListenerId); $listenerDef = new DefinitionDecorator($abstractListenerId);
$listenerDef->replaceArgument(0, new Reference($objectPersisterId)); $listenerDef->replaceArgument(0, new Reference($objectPersisterId));
$listenerDef->replaceArgument(1, $typeConfig['model']); $listenerDef->replaceArgument(1, $typeConfig['model']);
@ -353,14 +353,14 @@ class FOQElasticaExtension extends Extension
if (isset($typeConfig['finder']['service'])) { if (isset($typeConfig['finder']['service'])) {
return $typeConfig['finder']['service']; return $typeConfig['finder']['service'];
} }
$abstractFinderId = 'foq_elastica.finder.prototype'; $abstractFinderId = 'fos_elastica.finder.prototype';
$finderId = sprintf('foq_elastica.finder.%s.%s', $indexName, $typeName); $finderId = sprintf('fos_elastica.finder.%s.%s', $indexName, $typeName);
$finderDef = new DefinitionDecorator($abstractFinderId); $finderDef = new DefinitionDecorator($abstractFinderId);
$finderDef->replaceArgument(0, $typeDef); $finderDef->replaceArgument(0, $typeDef);
$finderDef->replaceArgument(1, new Reference($elasticaToModelId)); $finderDef->replaceArgument(1, new Reference($elasticaToModelId));
$container->setDefinition($finderId, $finderDef); $container->setDefinition($finderId, $finderDef);
$managerId = sprintf('foq_elastica.manager.%s', $typeConfig['driver']); $managerId = sprintf('fos_elastica.manager.%s', $typeConfig['driver']);
$managerDef = $container->getDefinition($managerId); $managerDef = $container->getDefinition($managerId);
$arguments = array( $typeConfig['model'], new Reference($finderId)); $arguments = array( $typeConfig['model'], new Reference($finderId));
if (isset($typeConfig['repository'])) { if (isset($typeConfig['repository'])) {
@ -379,9 +379,9 @@ class FOQElasticaExtension extends Extension
**/ **/
protected function loadIndexManager(array $indexDefs, $defaultIndexId, ContainerBuilder $container) protected function loadIndexManager(array $indexDefs, $defaultIndexId, ContainerBuilder $container)
{ {
$managerDef = $container->getDefinition('foq_elastica.index_manager'); $managerDef = $container->getDefinition('fos_elastica.index_manager');
$managerDef->replaceArgument(0, $indexDefs); $managerDef->replaceArgument(0, $indexDefs);
$managerDef->replaceArgument(1, new Reference('foq_elastica.index')); $managerDef->replaceArgument(1, new Reference('fos_elastica.index'));
} }
/** /**
@ -391,7 +391,7 @@ class FOQElasticaExtension extends Extension
**/ **/
protected function loadReseter(array $indexConfigs, ContainerBuilder $container) protected function loadReseter(array $indexConfigs, ContainerBuilder $container)
{ {
$reseterDef = $container->getDefinition('foq_elastica.reseter'); $reseterDef = $container->getDefinition('fos_elastica.reseter');
$reseterDef->replaceArgument(0, $indexConfigs); $reseterDef->replaceArgument(0, $indexConfigs);
} }
@ -419,7 +419,7 @@ class FOQElasticaExtension extends Extension
$defaultManagerService = $this->loadedDrivers[0]; $defaultManagerService = $this->loadedDrivers[0];
} }
$container->setAlias('foq_elastica.manager', sprintf('foq_elastica.manager.%s', $defaultManagerService)); $container->setAlias('fos_elastica.manager', sprintf('fos_elastica.manager.%s', $defaultManagerService));
} }
} }

View file

@ -1,10 +1,10 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine; namespace FOS\ElasticaBundle\Doctrine;
use FOQ\ElasticaBundle\HybridResult; use FOS\ElasticaBundle\HybridResult;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use FOQ\ElasticaBundle\Transformer\HighlightableModelInterface; use FOS\ElasticaBundle\Transformer\HighlightableModelInterface;
use Elastica_Document; use Elastica_Document;
/** /**

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine; namespace FOS\ElasticaBundle\Doctrine;
use FOQ\ElasticaBundle\Persister\ObjectPersisterInterface; use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface;
abstract class AbstractListener abstract class AbstractListener

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine; namespace FOS\ElasticaBundle\Doctrine;
use FOQ\ElasticaBundle\Provider\ProviderInterface; use FOS\ElasticaBundle\Provider\ProviderInterface;
use FOQ\ElasticaBundle\Persister\ObjectPersisterInterface; use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
use Elastica_Type; use Elastica_Type;
use Elastica_Document; use Elastica_Document;
use Closure; use Closure;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine\MongoDB; namespace FOS\ElasticaBundle\Doctrine\MongoDB;
use FOQ\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer; use FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer;
use Elastica_Document; use Elastica_Document;
/** /**

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine\MongoDB; namespace FOS\ElasticaBundle\Doctrine\MongoDB;
use FOQ\ElasticaBundle\Doctrine\AbstractListener; use FOS\ElasticaBundle\Doctrine\AbstractListener;
use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs; use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;
use Doctrine\Common\EventSubscriber; use Doctrine\Common\EventSubscriber;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine\MongoDB; namespace FOS\ElasticaBundle\Doctrine\MongoDB;
use FOQ\ElasticaBundle\Doctrine\AbstractProvider; use FOS\ElasticaBundle\Doctrine\AbstractProvider;
class Provider extends AbstractProvider class Provider extends AbstractProvider
{ {

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine\ORM; namespace FOS\ElasticaBundle\Doctrine\ORM;
use FOQ\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer; use FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer;
use Elastica_Document; use Elastica_Document;
use Doctrine\ORM\Query; use Doctrine\ORM\Query;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine\ORM; namespace FOS\ElasticaBundle\Doctrine\ORM;
use FOQ\ElasticaBundle\Doctrine\AbstractListener; use FOS\ElasticaBundle\Doctrine\AbstractListener;
use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\Common\EventSubscriber; use Doctrine\Common\EventSubscriber;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Doctrine\ORM; namespace FOS\ElasticaBundle\Doctrine\ORM;
use FOQ\ElasticaBundle\Doctrine\AbstractProvider; use FOS\ElasticaBundle\Doctrine\AbstractProvider;
class Provider extends AbstractProvider class Provider extends AbstractProvider
{ {

View file

@ -1,13 +1,13 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
use FOQ\ElasticaBundle\DependencyInjection\Compiler\AddProviderPass; use FOS\ElasticaBundle\DependencyInjection\Compiler\AddProviderPass;
use FOQ\ElasticaBundle\DependencyInjection\Compiler\TransformerPass; use FOS\ElasticaBundle\DependencyInjection\Compiler\TransformerPass;
class FOQElasticaBundle extends Bundle class FOSElasticaBundle extends Bundle
{ {
public function build(ContainerBuilder $container) public function build(ContainerBuilder $container)
{ {

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Finder; namespace FOS\ElasticaBundle\Finder;
interface FinderInterface interface FinderInterface
{ {

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Finder; namespace FOS\ElasticaBundle\Finder;
use Pagerfanta\Pagerfanta; use Pagerfanta\Pagerfanta;

View file

@ -1,11 +1,11 @@
<?php <?php
namespace FOQ\ElasticaBundle\Finder; namespace FOS\ElasticaBundle\Finder;
use FOQ\ElasticaBundle\Finder\FinderInterface; use FOS\ElasticaBundle\Finder\FinderInterface;
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface; use FOS\ElasticaBundle\Finder\PaginatedFinderInterface;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use FOQ\ElasticaBundle\Paginator\TransformedPaginatorAdapter; use FOS\ElasticaBundle\Paginator\TransformedPaginatorAdapter;
use Pagerfanta\Pagerfanta; use Pagerfanta\Pagerfanta;
use Elastica_Searchable; use Elastica_Searchable;
use Elastica_Query; use Elastica_Query;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use Elastica_Result; use Elastica_Result;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use InvalidArgumentException; use InvalidArgumentException;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Logger; namespace FOS\ElasticaBundle\Logger;
use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface;

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Manager; namespace FOS\ElasticaBundle\Manager;
use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Annotations\Reader;
use FOQ\ElasticaBundle\Finder\FinderInterface; use FOS\ElasticaBundle\Finder\FinderInterface;
use RuntimeException; use RuntimeException;
/** /**
* @author Richard Miller <info@limethinking.co.uk> * @author Richard Miller <info@limethinking.co.uk>
@ -58,14 +58,14 @@ class RepositoryManager implements RepositoryManagerInterface
} }
$refClass = new \ReflectionClass($entityName); $refClass = new \ReflectionClass($entityName);
$annotation = $this->reader->getClassAnnotation($refClass, 'FOQ\\ElasticaBundle\\Configuration\\Search'); $annotation = $this->reader->getClassAnnotation($refClass, 'FOS\\ElasticaBundle\\Configuration\\Search');
if ($annotation) { if ($annotation) {
$this->entities[$entityName]['repositoryName'] $this->entities[$entityName]['repositoryName']
= $annotation->repositoryClass; = $annotation->repositoryClass;
return $annotation->repositoryClass; return $annotation->repositoryClass;
} }
return 'FOQ\ElasticaBundle\Repository'; return 'FOS\ElasticaBundle\Repository';
} }
private function createRepository($entityName) private function createRepository($entityName)

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Manager; namespace FOS\ElasticaBundle\Manager;
use FOQ\ElasticaBundle\Finder\FinderInterface; use FOS\ElasticaBundle\Finder\FinderInterface;
/** /**
* @author Richard Miller <info@limethinking.co.uk> * @author Richard Miller <info@limethinking.co.uk>

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use Elastica_Type; use Elastica_Type;
use InvalidArgumentException; use InvalidArgumentException;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Paginator; namespace FOS\ElasticaBundle\Paginator;
use Pagerfanta\Adapter\AdapterInterface; use Pagerfanta\Adapter\AdapterInterface;
use Elastica_Searchable; use Elastica_Searchable;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Paginator; namespace FOS\ElasticaBundle\Paginator;
/** /**
* Implements the Pagerfanta\Adapter\AdapterInterface for use with Zend\Paginator\Paginator * Implements the Pagerfanta\Adapter\AdapterInterface for use with Zend\Paginator\Paginator

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Paginator; namespace FOS\ElasticaBundle\Paginator;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use Elastica_Searchable; use Elastica_Searchable;
use Elastica_Query; use Elastica_Query;

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Persister; namespace FOS\ElasticaBundle\Persister;
use FOQ\ElasticaBundle\Provider\ProviderInterface; use FOS\ElasticaBundle\Provider\ProviderInterface;
use FOQ\ElasticaBundle\Transformer\ModelToElasticaTransformerInterface; use FOS\ElasticaBundle\Transformer\ModelToElasticaTransformerInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Elastica_Type; use Elastica_Type;
use Elastica_Document; use Elastica_Document;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Persister; namespace FOS\ElasticaBundle\Persister;
/** /**
* Inserts, replaces and deletes single documents in an elastica type * Inserts, replaces and deletes single documents in an elastica type

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use FOQ\ElasticaBundle\Provider\ProviderInterface; use FOS\ElasticaBundle\Provider\ProviderInterface;
use Closure; use Closure;
class Populator class Populator

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Propel; namespace FOS\ElasticaBundle\Propel;
use FOQ\ElasticaBundle\HybridResult; use FOS\ElasticaBundle\HybridResult;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use Elastica_Document; use Elastica_Document;
/** /**

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Propel; namespace FOS\ElasticaBundle\Propel;
use FOQ\ElasticaBundle\Provider\ProviderInterface; use FOS\ElasticaBundle\Provider\ProviderInterface;
use FOQ\ElasticaBundle\Persister\ObjectPersisterInterface; use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
use Elastica_Type; use Elastica_Type;
use Elastica_Document; use Elastica_Document;
use Closure; use Closure;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Provider; namespace FOS\ElasticaBundle\Provider;
use Closure; use Closure;

112
README.md
View file

@ -43,25 +43,25 @@ Use the master branch with Symfony2 master only, use the 2.0 branch with Symfony
**With submodule** **With submodule**
`git submodule add git://github.com/Exercise/FOQElasticaBundle vendor/bundles/FOQ/ElasticaBundle` `git submodule add git://github.com/Exercise/FOSElasticaBundle vendor/bundles/FOS/ElasticaBundle`
**With clone** **With clone**
`git clone git://github.com/Exercise/FOQElasticaBundle vendor/bundles/FOQ/ElasticaBundle` `git clone git://github.com/Exercise/FOSElasticaBundle vendor/bundles/FOS/ElasticaBundle`
**With the vendors script** **With the vendors script**
Add the following lines to your deps file: Add the following lines to your deps file:
[FOQElasticaBundle] [FOSElasticaBundle]
git=git://github.com/Exercise/FOQElasticaBundle.git git=git://github.com/Exercise/FOSElasticaBundle.git
target=bundles/FOQ/ElasticaBundle target=bundles/FOS/ElasticaBundle
For the 2.0 branch for use with Symfony2.0.x releases add the following: For the 2.0 branch for use with Symfony2.0.x releases add the following:
[FOQElasticaBundle] [FOSElasticaBundle]
git=git://github.com/Exercise/FOQElasticaBundle.git git=git://github.com/Exercise/FOSElasticaBundle.git
target=bundles/FOQ/ElasticaBundle target=bundles/FOS/ElasticaBundle
version=origin/2.0 version=origin/2.0
Run the vendors script: Run the vendors script:
@ -75,7 +75,7 @@ $ php bin/vendors install
$loader->registerNamespaces(array( $loader->registerNamespaces(array(
... ...
'FOQ' => __DIR__.'/../vendor/bundles', 'FOS' => __DIR__.'/../vendor/bundles',
)); ));
#### Register the bundle #### Register the bundle
@ -86,7 +86,7 @@ $ php bin/vendors install
{ {
return array( return array(
// ... // ...
new FOQ\ElasticaBundle\FOQElasticaBundle(), new FOS\ElasticaBundle\FOSElasticaBundle(),
// ... // ...
); );
} }
@ -99,7 +99,7 @@ Elasticsearch client is comparable to a database connection.
Most of the time, you will need only one. Most of the time, you will need only one.
#app/config/config.yml #app/config/config.yml
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
@ -108,7 +108,7 @@ Most of the time, you will need only one.
Elasticsearch index is comparable to Doctrine entity manager. Elasticsearch index is comparable to Doctrine entity manager.
Most of the time, you will need only one. Most of the time, you will need only one.
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:
@ -117,13 +117,13 @@ Most of the time, you will need only one.
Here we created a "website" index, that uses our "default" client. Here we created a "website" index, that uses our "default" client.
Our index is now available as a service: `foq_elastica.index.website`. It is an instance of `Elastica_Index`. Our index is now available as a service: `fos_elastica.index.website`. It is an instance of `Elastica_Index`.
#### Declare a type #### Declare a type
Elasticsearch type is comparable to Doctrine entity repository. Elasticsearch type is comparable to Doctrine entity repository.
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:
@ -137,11 +137,11 @@ Elasticsearch type is comparable to Doctrine entity repository.
lastName: { boost: 3 } lastName: { boost: 3 }
aboutMe: aboutMe:
Our type is now available as a service: `foq_elastica.index.website.user`. It is an instance of `Elastica_Type`. Our type is now available as a service: `fos_elastica.index.website.user`. It is an instance of `Elastica_Type`.
### Populate the types ### Populate the types
php app/console foq:elastica:populate php app/console fos:elastica:populate
This command deletes and creates the declared indexes and types. This command deletes and creates the declared indexes and types.
It applies the configured mappings to the types. It applies the configured mappings to the types.
@ -156,7 +156,7 @@ Or, for complete flexibility, go for manual provider.
If we want to index the entities from a Doctrine repository or a Propel query, If we want to index the entities from a Doctrine repository or a Propel query,
some configuration will let ElasticaBundle do it for us. some configuration will let ElasticaBundle do it for us.
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:
@ -213,20 +213,20 @@ You can change this value in the provider configuration.
#### Manual provider #### Manual provider
Create a service with the tag "foq_elastica.provider". Create a service with the tag "fos_elastica.provider".
<service id="acme.search_provider.user" class="Acme\UserBundle\Search\UserProvider"> <service id="acme.search_provider.user" class="Acme\UserBundle\Search\UserProvider">
<tag name="foq_elastica.provider" /> <tag name="fos_elastica.provider" />
<argument type="service" id="foq_elastica.index.website.user" /> <argument type="service" id="fos_elastica.index.website.user" />
</service> </service>
Its class must implement `FOQ\ElasticaBundle\Provider\ProviderInterface`. Its class must implement `FOS\ElasticaBundle\Provider\ProviderInterface`.
<?php <?php
namespace Acme\UserBundle\Provider; namespace Acme\UserBundle\Provider;
use FOQ\ElasticaBundle\Provider\ProviderInterface; use FOS\ElasticaBundle\Provider\ProviderInterface;
use Elastica_Type; use Elastica_Type;
class UserProvider implements ProviderInterface class UserProvider implements ProviderInterface
@ -253,14 +253,14 @@ Its class must implement `FOQ\ElasticaBundle\Provider\ProviderInterface`.
} }
} }
You will find a more complete implementation example in `src/FOQ/ElasticaBundle/Doctrine/AbstractProvider.php`. You will find a more complete implementation example in `src/FOS/ElasticaBundle/Doctrine/AbstractProvider.php`.
### Search ### Search
You can just use the index and type Elastica objects, provided as services, to perform searches. You can just use the index and type Elastica objects, provided as services, to perform searches.
/** var Elastica_Type */ /** var Elastica_Type */
$userType = $this->container->get('foq_elastica.index.website.user'); $userType = $this->container->get('fos_elastica.index.website.user');
/** var Elastica_ResultSet */ /** var Elastica_ResultSet */
$resultSet = $userType->search('bob'); $resultSet = $userType->search('bob');
@ -271,7 +271,7 @@ If your elasticsearch type is bound to a Doctrine entity repository or a Propel
you can get your entities instead of Elastica results when you perform a search. you can get your entities instead of Elastica results when you perform a search.
Declare that you want a Doctrine/Propel finder in your configuration: Declare that you want a Doctrine/Propel finder in your configuration:
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:
@ -287,10 +287,10 @@ Declare that you want a Doctrine/Propel finder in your configuration:
provider: provider:
finder: finder:
You can now use the `foq_elastica.finder.website.user` service: You can now use the `fos_elastica.finder.website.user` service:
/** var FOQ\ElasticaBundle\Finder\TransformedFinder */ /** var FOS\ElasticaBundle\Finder\TransformedFinder */
$finder = $container->get('foq_elastica.finder.website.user'); $finder = $container->get('fos_elastica.finder.website.user');
/** var array of Acme\UserBundle\Entity\User */ /** var array of Acme\UserBundle\Entity\User */
$users = $finder->find('bob'); $users = $finder->find('bob');
@ -307,7 +307,7 @@ You can also get both the Elastica results and the entities together from the fi
YOu can then access the score, highlights etc. from the Elastica_Result whilst YOu can then access the score, highlights etc. from the Elastica_Result whilst
still also getting the entity. still also getting the entity.
/** var array of FOQ\ElasticaBundle\HybridResult */ /** var array of FOS\ElasticaBundle\HybridResult */
$hybridResults = $finder->findHybrid('bob'); $hybridResults = $finder->findHybrid('bob');
foreach ($hybridResults as $hybridResult) { foreach ($hybridResults as $hybridResult) {
@ -324,16 +324,16 @@ still also getting the entity.
You can also define a finder that will work on the entire index. Adjust your index You can also define a finder that will work on the entire index. Adjust your index
configuration as per below: configuration as per below:
foq_elastica: fos_elastica:
indexes: indexes:
website: website:
client: default client: default
finder: finder:
You can now use the index wide finder service `foq_elastica.finder.website`: You can now use the index wide finder service `fos_elastica.finder.website`:
/** var FOQ\ElasticaBundle\Finder\MappedFinder */ /** var FOS\ElasticaBundle\Finder\MappedFinder */
$finder = $container->get('foq_elastica.finder.website'); $finder = $container->get('fos_elastica.finder.website');
// Returns a mixed array of any objects mapped // Returns a mixed array of any objects mapped
$results = $finder->find('bob'); $results = $finder->find('bob');
@ -345,10 +345,10 @@ can use a manager service for each driver and get a repository for an entity to
against. This allows you to use the same service rather than the particular finder. For against. This allows you to use the same service rather than the particular finder. For
example: example:
/** var FOQ\ElasticaBundle\Manager\RepositoryManager */ /** var FOS\ElasticaBundle\Manager\RepositoryManager */
$repositoryManager = $container->get('foq_elastica.manager.orm'); $repositoryManager = $container->get('fos_elastica.manager.orm');
/** var FOQ\ElasticaBundle\Repository */ /** var FOS\ElasticaBundle\Repository */
$repository = $repositoryManager->getRepository('UserBundle:User'); $repository = $repositoryManager->getRepository('UserBundle:User');
/** var array of Acme\UserBundle\Entity\User */ /** var array of Acme\UserBundle\Entity\User */
@ -356,7 +356,7 @@ example:
You can also specify the full name of the entity instead of the shortcut syntax: You can also specify the full name of the entity instead of the shortcut syntax:
/** var FOQ\ElasticaBundle\Repository */ /** var FOS\ElasticaBundle\Repository */
$repository = $repositoryManager->getRepository('Application\UserBundle\Entity\User'); $repository = $repositoryManager->getRepository('Application\UserBundle\Entity\User');
> The **2.0** branch doesn't support using `UserBundle:User` style syntax and you must use the full name of the entity. . > The **2.0** branch doesn't support using `UserBundle:User` style syntax and you must use the full name of the entity. .
@ -364,21 +364,21 @@ You can also specify the full name of the entity instead of the shortcut syntax:
##### Default Manager ##### Default Manager
If you are only using one driver then its manager service is automatically aliased If you are only using one driver then its manager service is automatically aliased
to `foq_elastica.manager`. So the above example could be simplified to: to `fos_elastica.manager`. So the above example could be simplified to:
/** var FOQ\ElasticaBundle\Manager\RepositoryManager */ /** var FOS\ElasticaBundle\Manager\RepositoryManager */
$repositoryManager = $container->get('foq_elastica.manager'); $repositoryManager = $container->get('fos_elastica.manager');
/** var FOQ\ElasticaBundle\Repository */ /** var FOS\ElasticaBundle\Repository */
$repository = $repositoryManager->getRepository('UserBundle:User'); $repository = $repositoryManager->getRepository('UserBundle:User');
/** var array of Acme\UserBundle\Entity\User */ /** var array of Acme\UserBundle\Entity\User */
$users = $finder->find('bob'); $users = $finder->find('bob');
If you use multiple drivers then you can choose which one is aliased to `foq_elastica.manager` If you use multiple drivers then you can choose which one is aliased to `fos_elastica.manager`
using the `default_manager` parameter: using the `default_manager` parameter:
foq_elastica: fos_elastica:
default_manager: mongodb #defauults to orm default_manager: mongodb #defauults to orm
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
@ -387,7 +387,7 @@ using the `default_manager` parameter:
##### Custom Repositories ##### Custom Repositories
As well as the default repository you can create a custom repository for an entity and add As well as the default repository you can create a custom repository for an entity and add
methods for particular searches. These need to extend `FOQ\ElasticaBundle\Repository` to have methods for particular searches. These need to extend `FOS\ElasticaBundle\Repository` to have
access to the finder: access to the finder:
``` ```
@ -395,7 +395,7 @@ access to the finder:
namespace Acme\ElasticaBundle\SearchRepository; namespace Acme\ElasticaBundle\SearchRepository;
use FOQ\ElasticaBundle\Repository; use FOS\ElasticaBundle\Repository;
class UserRepository extends Repository class UserRepository extends Repository
{ {
@ -409,7 +409,7 @@ class UserRepository extends Repository
To use the custom repository specify it in the mapping for the entity: To use the custom repository specify it in the mapping for the entity:
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:
@ -428,10 +428,10 @@ To use the custom repository specify it in the mapping for the entity:
Then the custom queries will be available when using the repository returned from the manager: Then the custom queries will be available when using the repository returned from the manager:
/** var FOQ\ElasticaBundle\Manager\RepositoryManager */ /** var FOS\ElasticaBundle\Manager\RepositoryManager */
$repositoryManager = $container->get('foq_elastica.manager'); $repositoryManager = $container->get('fos_elastica.manager');
/** var FOQ\ElasticaBundle\Repository */ /** var FOS\ElasticaBundle\Repository */
$repository = $repositoryManager->getRepository('UserBundle:User'); $repository = $repositoryManager->getRepository('UserBundle:User');
/** var array of Acme\UserBundle\Entity\User */ /** var array of Acme\UserBundle\Entity\User */
@ -444,7 +444,7 @@ Alternatively you can specify the custom repository using an annotation in the e
namespace Application\UserBundle\Entity; namespace Application\UserBundle\Entity;
use FOQ\ElasticaBundle\Configuration\Search; use FOS\ElasticaBundle\Configuration\Search;
/** /**
* @Search(repositoryClass="Acme\ElasticaBundle\SearchRepository\UserRepository") * @Search(repositoryClass="Acme\ElasticaBundle\SearchRepository\UserRepository")
@ -463,7 +463,7 @@ If you use the Doctrine integration, you can let ElasticaBundle update the index
when an object is added, updated or removed. It uses Doctrine lifecycle events. when an object is added, updated or removed. It uses Doctrine lifecycle events.
Declare that you want to update the index in real time: Declare that you want to update the index in real time:
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:
@ -495,7 +495,7 @@ You can also choose to only listen for some of the events:
Any setting can be specified when declaring a type. For example, to enable a custom analyzer, you could write: Any setting can be specified when declaring a type. For example, to enable a custom analyzer, you could write:
foq_elastica: fos_elastica:
indexes: indexes:
doc: doc:
settings: settings:
@ -524,7 +524,7 @@ issuing a request will result in an `Elastica_Exception_Client` being thrown.
Depending on your needs, it may be desirable to suppress these exceptions and Depending on your needs, it may be desirable to suppress these exceptions and
allow searches to fail silently. allow searches to fail silently.
One way to achieve this is to override the `foq_elastica.client.class` service One way to achieve this is to override the `fos_elastica.client.class` service
container parameter with a custom class. In the following example, we override container parameter with a custom class. In the following example, we override
the `Client::request()` method and return the equivalent of an empty search the `Client::request()` method and return the equivalent of an empty search
response if an exception occurred. response if an exception occurred.
@ -534,7 +534,7 @@ response if an exception occurred.
namespace Acme\ElasticaBundle; namespace Acme\ElasticaBundle;
use FOQ\ElasticaBundle\Client as BaseClient; use FOS\ElasticaBundle\Client as BaseClient;
class Client extends BaseClient class Client extends BaseClient
{ {
@ -560,7 +560,7 @@ Results must match at least one specified `categoryIds`, and should match the
apply to queries against the `title` field. apply to queries against the `title` field.
```php ```php
$finder = $this->container->get('foq_elastica.finder.website.article'); $finder = $this->container->get('fos_elastica.finder.website.article');
$boolQuery = new \Elastica_Query_Bool(); $boolQuery = new \Elastica_Query_Bool();
$fieldQuery = new \Elastica_Query_Text(); $fieldQuery = new \Elastica_Query_Text();
@ -582,7 +582,7 @@ $data = $finder->find($boolQuery);
Configuration: Configuration:
```yaml ```yaml
foq_elastica: fos_elastica:
clients: clients:
default: { host: localhost, port: 9200 } default: { host: localhost, port: 9200 }
indexes: indexes:

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
/** /**
* @author Richard Miller <info@limethinking.co.uk> * @author Richard Miller <info@limethinking.co.uk>

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle; namespace FOS\ElasticaBundle;
use Elastica_Exception_Response; use Elastica_Exception_Response;

View file

@ -5,64 +5,64 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters> <parameters>
<parameter key="foq_elastica.client.class">FOQ\ElasticaBundle\Client</parameter> <parameter key="fos_elastica.client.class">FOS\ElasticaBundle\Client</parameter>
<parameter key="foq_elastica.index.class">Elastica_Index</parameter> <parameter key="fos_elastica.index.class">Elastica_Index</parameter>
<parameter key="foq_elastica.type.class">Elastica_Type</parameter> <parameter key="fos_elastica.type.class">Elastica_Type</parameter>
<parameter key="foq_elastica.logger.class">FOQ\ElasticaBundle\Logger\ElasticaLogger</parameter> <parameter key="fos_elastica.logger.class">FOS\ElasticaBundle\Logger\ElasticaLogger</parameter>
<parameter key="foq_elastica.data_collector.class">FOQ\ElasticaBundle\DataCollector\ElasticaDataCollector</parameter> <parameter key="fos_elastica.data_collector.class">FOS\ElasticaBundle\DataCollector\ElasticaDataCollector</parameter>
<parameter key="foq_elastica.manager.class">FOQ\ElasticaBundle\Manager\RepositoryManager</parameter> <parameter key="fos_elastica.manager.class">FOS\ElasticaBundle\Manager\RepositoryManager</parameter>
<parameter key="foq_elastica.elastica_to_model_transformer.collection.class">FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection</parameter> <parameter key="fos_elastica.elastica_to_model_transformer.collection.class">FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection</parameter>
</parameters> </parameters>
<services> <services>
<service id="foq_elastica.logger" class="%foq_elastica.logger.class%"> <service id="fos_elastica.logger" class="%fos_elastica.logger.class%">
<argument type="service" id="logger" on-invalid="null" /> <argument type="service" id="logger" on-invalid="null" />
<argument>%kernel.debug%</argument> <argument>%kernel.debug%</argument>
<tag name="monolog.logger" channel="elastica" /> <tag name="monolog.logger" channel="elastica" />
</service> </service>
<service id="foq_elastica.data_collector" class="%foq_elastica.data_collector.class%" public="true"> <service id="fos_elastica.data_collector" class="%fos_elastica.data_collector.class%" public="true">
<tag name="data_collector" template="FOQElasticaBundle:Collector:elastica" id="elastica" /> <tag name="data_collector" template="FOSElasticaBundle:Collector:elastica" id="elastica" />
<argument type="service" id="foq_elastica.logger" /> <argument type="service" id="fos_elastica.logger" />
</service> </service>
<service id="foq_elastica.client" class="%foq_elastica.client.class%"> <service id="fos_elastica.client" class="%fos_elastica.client.class%">
<argument /> <!-- config --> <argument /> <!-- config -->
<call method="setLogger"> <call method="setLogger">
<argument type="service" id="foq_elastica.logger" /> <argument type="service" id="fos_elastica.logger" />
</call> </call>
</service> </service>
<service id="foq_elastica.index_manager" class="FOQ\ElasticaBundle\IndexManager"> <service id="fos_elastica.index_manager" class="FOS\ElasticaBundle\IndexManager">
<argument /> <!-- indexes --> <argument /> <!-- indexes -->
<argument /> <!-- default index --> <argument /> <!-- default index -->
</service> </service>
<service id="foq_elastica.populator" class="FOQ\ElasticaBundle\Populator"> <service id="fos_elastica.populator" class="FOS\ElasticaBundle\Populator">
<argument /> <!-- providers --> <argument /> <!-- providers -->
</service> </service>
<service id="foq_elastica.reseter" class="FOQ\ElasticaBundle\Reseter"> <service id="fos_elastica.reseter" class="FOS\ElasticaBundle\Reseter">
<argument /> <!-- index configs --> <argument /> <!-- index configs -->
</service> </service>
<service id="foq_elastica.object_persister.prototype" class="FOQ\ElasticaBundle\Persister\ObjectPersister" abstract="true"> <service id="fos_elastica.object_persister.prototype" class="FOS\ElasticaBundle\Persister\ObjectPersister" abstract="true">
<argument /> <!-- type --> <argument /> <!-- type -->
<argument /> <!-- model to elastica transformer --> <argument /> <!-- model to elastica transformer -->
<argument /> <!-- model --> <argument /> <!-- model -->
<argument /> <!-- properties mapping --> <argument /> <!-- properties mapping -->
</service> </service>
<service id="foq_elastica.finder.prototype" class="FOQ\ElasticaBundle\Finder\TransformedFinder" public="true" abstract="true"> <service id="fos_elastica.finder.prototype" class="FOS\ElasticaBundle\Finder\TransformedFinder" public="true" abstract="true">
<argument /> <!-- searchable --> <argument /> <!-- searchable -->
<argument /> <!-- transformer --> <argument /> <!-- transformer -->
</service> </service>
<service id="foq_elastica.model_to_elastica_transformer.prototype.auto" class="FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer" public="false" abstract="true"> <service id="fos_elastica.model_to_elastica_transformer.prototype.auto" class="FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer" public="false" abstract="true">
<argument /> <!-- options --> <argument /> <!-- options -->
</service> </service>
<service id="foq_elastica.elastica_to_model_transformer.collection.prototype" class="%foq_elastica.elastica_to_model_transformer.collection.class%" public="true" abstract="true"> <service id="fos_elastica.elastica_to_model_transformer.collection.prototype" class="%fos_elastica.elastica_to_model_transformer.collection.class%" public="true" abstract="true">
<argument type="collection" /> <!-- transformers --> <argument type="collection" /> <!-- transformers -->
</service> </service>

View file

@ -6,7 +6,7 @@
<services> <services>
<service id="foq_elastica.provider.prototype.mongodb" class="FOQ\ElasticaBundle\Doctrine\MongoDB\Provider" public="false" abstract="true"> <service id="fos_elastica.provider.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\Provider" public="false" abstract="true">
<argument /> <!-- type --> <argument /> <!-- type -->
<argument type="service" id="doctrine.odm.mongodb.document_manager" /> <argument type="service" id="doctrine.odm.mongodb.document_manager" />
<argument /> <!-- object persister --> <argument /> <!-- object persister -->
@ -14,20 +14,20 @@
<argument type="collection" /> <!-- options --> <argument type="collection" /> <!-- options -->
</service> </service>
<service id="foq_elastica.listener.prototype.mongodb" class="FOQ\ElasticaBundle\Doctrine\MongoDB\Listener" public="false" abstract="true"> <service id="fos_elastica.listener.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\Listener" public="false" abstract="true">
<argument /> <!-- object persister --> <argument /> <!-- object persister -->
<argument /> <!-- model --> <argument /> <!-- model -->
<argument type="collection" /> <!-- events --> <argument type="collection" /> <!-- events -->
<argument/> <!-- identifier --> <argument/> <!-- identifier -->
</service> </service>
<service id="foq_elastica.elastica_to_model_transformer.prototype.mongodb" class="FOQ\ElasticaBundle\Doctrine\MongoDB\ElasticaToModelTransformer" public="false"> <service id="fos_elastica.elastica_to_model_transformer.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\ElasticaToModelTransformer" public="false">
<argument type="service" id="doctrine.odm.mongodb.document_manager" /> <argument type="service" id="doctrine.odm.mongodb.document_manager" />
<argument /> <!-- model --> <argument /> <!-- model -->
<argument type="collection" /> <!-- options --> <argument type="collection" /> <!-- options -->
</service> </service>
<service id="foq_elastica.manager.mongodb" class="%foq_elastica.manager.class%"> <service id="fos_elastica.manager.mongodb" class="%fos_elastica.manager.class%">
<argument type="service" id="annotation_reader"/> <argument type="service" id="annotation_reader"/>
</service> </service>

View file

@ -6,7 +6,7 @@
<services> <services>
<service id="foq_elastica.provider.prototype.orm" class="FOQ\ElasticaBundle\Doctrine\ORM\Provider" public="false" abstract="true"> <service id="fos_elastica.provider.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\Provider" public="false" abstract="true">
<argument /> <!-- type --> <argument /> <!-- type -->
<argument type="service" id="doctrine.orm.entity_manager" /> <argument type="service" id="doctrine.orm.entity_manager" />
<argument /> <!-- object persister --> <argument /> <!-- object persister -->
@ -14,20 +14,20 @@
<argument type="collection" /> <!-- options --> <argument type="collection" /> <!-- options -->
</service> </service>
<service id="foq_elastica.listener.prototype.orm" class="FOQ\ElasticaBundle\Doctrine\ORM\Listener" public="false" abstract="true"> <service id="fos_elastica.listener.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\Listener" public="false" abstract="true">
<argument /> <!-- object persister --> <argument /> <!-- object persister -->
<argument /> <!-- model --> <argument /> <!-- model -->
<argument type="collection" /> <!-- events --> <argument type="collection" /> <!-- events -->
<argument/> <!-- identifier --> <argument/> <!-- identifier -->
</service> </service>
<service id="foq_elastica.elastica_to_model_transformer.prototype.orm" class="FOQ\ElasticaBundle\Doctrine\ORM\ElasticaToModelTransformer" public="false"> <service id="fos_elastica.elastica_to_model_transformer.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\ElasticaToModelTransformer" public="false">
<argument type="service" id="doctrine.orm.entity_manager" /> <argument type="service" id="doctrine.orm.entity_manager" />
<argument /> <!-- model --> <argument /> <!-- model -->
<argument type="collection" /> <!-- options --> <argument type="collection" /> <!-- options -->
</service> </service>
<service id="foq_elastica.manager.orm" class="%foq_elastica.manager.class%"> <service id="fos_elastica.manager.orm" class="%fos_elastica.manager.class%">
<argument type="service" id="annotation_reader"/> <argument type="service" id="annotation_reader"/>
</service> </service>

View file

@ -5,19 +5,19 @@
<services> <services>
<service id="foq_elastica.provider.prototype.propel" class="FOQ\ElasticaBundle\Propel\Provider" public="false" abstract="true"> <service id="fos_elastica.provider.prototype.propel" class="FOS\ElasticaBundle\Propel\Provider" public="false" abstract="true">
<argument /> <!-- type --> <argument /> <!-- type -->
<argument /> <!-- object persister --> <argument /> <!-- object persister -->
<argument /> <!-- model --> <argument /> <!-- model -->
<argument type="collection" /> <!-- options --> <argument type="collection" /> <!-- options -->
</service> </service>
<service id="foq_elastica.elastica_to_model_transformer.prototype.propel" class="FOQ\ElasticaBundle\Propel\ElasticaToModelTransformer" public="false"> <service id="fos_elastica.elastica_to_model_transformer.prototype.propel" class="FOS\ElasticaBundle\Propel\ElasticaToModelTransformer" public="false">
<argument /> <!-- model --> <argument /> <!-- model -->
<argument type="collection" /> <!-- options --> <argument type="collection" /> <!-- options -->
</service> </service>
<service id="foq_elastica.manager.propel" class="%foq_elastica.manager.class%"> <service id="fos_elastica.manager.propel" class="%fos_elastica.manager.class%">
<argument type="service" id="annotation_reader"/> <argument type="service" id="annotation_reader"/>
</service> </service>

View file

@ -12,7 +12,7 @@
{% block menu %} {% block menu %}
<span class="label"> <span class="label">
<span class="icon"><img src="{{ asset('bundles/foqelastica/images/elastica.png') }}" alt="" /></span> <span class="icon"><img src="{{ asset('bundles/foselastica/images/elastica.png') }}" alt="" /></span>
<strong>Elastica</strong> <strong>Elastica</strong>
<span class="count"> <span class="count">
<span>{{ collector.querycount }}</span> <span>{{ collector.querycount }}</span>

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\DataCollector; namespace FOS\ElasticaBundle\Tests\DataCollector;
use FOQ\ElasticaBundle\DataCollector\ElasticaDataCollector; use FOS\ElasticaBundle\DataCollector\ElasticaDataCollector;
/** /**
* @author Richard Miller <info@limethinking.co.uk> * @author Richard Miller <info@limethinking.co.uk>
@ -20,7 +20,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger') $loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -45,7 +45,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger') $loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Doctrine\MongoDB; namespace FOS\ElasticaBundle\Tests\Doctrine\MongoDB;
use FOQ\ElasticaBundle\Doctrine\MongoDB\Listener; use FOS\ElasticaBundle\Doctrine\MongoDB\Listener;
class Document{} class Document{}
@ -20,7 +20,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectInsertedOnPersist() public function testObjectInsertedOnPersist()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -28,7 +28,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
$document = new Document(); $document = new Document();
$eventArgsMock->expects($this->once()) $eventArgsMock->expects($this->once())
@ -45,7 +45,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectReplacedOnUpdate() public function testObjectReplacedOnUpdate()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -53,7 +53,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
$document = new Document(); $document = new Document();
$eventArgsMock->expects($this->once()) $eventArgsMock->expects($this->once())
@ -70,7 +70,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectDeletedOnRemove() public function testObjectDeletedOnRemove()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -86,7 +86,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
$document = new Document(); $document = new Document();
$documentId = 78; $documentId = 78;
@ -118,7 +118,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectWithNonStandardIdentifierDeletedOnRemove() public function testObjectWithNonStandardIdentifierDeletedOnRemove()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -134,7 +134,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
$document = new Document(); $document = new Document();
$documentIdentifier = 826; $documentIdentifier = 826;
$identifierField = 'identifier'; $identifierField = 'identifier';

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Doctrine\ORM; namespace FOS\ElasticaBundle\Tests\Doctrine\ORM;
use FOQ\ElasticaBundle\Doctrine\ORM\Listener; use FOS\ElasticaBundle\Doctrine\ORM\Listener;
class Entity{} class Entity{}
@ -20,7 +20,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectInsertedOnPersist() public function testObjectInsertedOnPersist()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -28,7 +28,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
$entity = new Entity; $entity = new Entity;
$eventArgsMock->expects($this->once()) $eventArgsMock->expects($this->once())
@ -45,7 +45,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectReplacedOnUpdate() public function testObjectReplacedOnUpdate()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -53,7 +53,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
$entity = new Entity; $entity = new Entity;
$eventArgsMock->expects($this->once()) $eventArgsMock->expects($this->once())
@ -70,7 +70,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectDeletedOnRemove() public function testObjectDeletedOnRemove()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -86,7 +86,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
$entity = new Entity; $entity = new Entity;
$entityId = 21; $entityId = 21;
@ -118,7 +118,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
public function testObjectWithNonStandardIdentifierDeletedOnRemove() public function testObjectWithNonStandardIdentifierDeletedOnRemove()
{ {
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface') $persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -134,7 +134,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity'; $objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
$entity = new Entity; $entity = new Entity;
$entityIdentifier = 924; $entityIdentifier = 924;
$identifierField = 'identifier'; $identifierField = 'identifier';

View file

@ -1,13 +1,13 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\IndexManager; namespace FOS\ElasticaBundle\Tests\IndexManager;
use FOQ\ElasticaBundle\IndexManager; use FOS\ElasticaBundle\IndexManager;
class IndexManagerTest extends \PHPUnit_Framework_TestCase class IndexManagerTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @var FOQ\ElasticaBundle\Tests\IndexManager * @var FOS\ElasticaBundle\Tests\IndexManager
*/ */
private $indexManager = null; private $indexManager = null;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Logger; namespace FOS\ElasticaBundle\Tests\Logger;
use FOQ\ElasticaBundle\Logger\ElasticaLogger; use FOS\ElasticaBundle\Logger\ElasticaLogger;
/** /**
* @author Richard Miller <info@limethinking.co.uk> * @author Richard Miller <info@limethinking.co.uk>

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Manager; namespace FOS\ElasticaBundle\Tests\Manager;
use FOQ\ElasticaBundle\Manager\RepositoryManager; use FOS\ElasticaBundle\Manager\RepositoryManager;
class CustomRepository{} class CustomRepository{}
@ -16,7 +16,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
public function testThatGetRepositoryReturnsDefaultRepository() public function testThatGetRepositoryReturnsDefaultRepository()
{ {
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -24,17 +24,17 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
$manager = new RepositoryManager($readerMock); $manager = new RepositoryManager($readerMock);
$manager->addEntity($entityName, $finderMock); $manager->addEntity($entityName, $finderMock);
$repository = $manager->getRepository($entityName); $repository = $manager->getRepository($entityName);
$this->assertInstanceOf('FOQ\ElasticaBundle\Repository', $repository); $this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository);
} }
public function testThatGetRepositoryReturnsCustomRepository() public function testThatGetRepositoryReturnsCustomRepository()
{ {
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -42,12 +42,12 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
$manager = new RepositoryManager($readerMock); $manager = new RepositoryManager($readerMock);
$manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\Manager\CustomRepository'); $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\Manager\CustomRepository');
$repository = $manager->getRepository($entityName); $repository = $manager->getRepository($entityName);
$this->assertInstanceOf('FOQ\ElasticaBundle\Tests\Manager\CustomRepository', $repository); $this->assertInstanceOf('FOS\ElasticaBundle\Tests\Manager\CustomRepository', $repository);
} }
/** /**
@ -55,7 +55,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
*/ */
public function testThatGetRepositoryThrowsExceptionIfEntityNotConfigured() public function testThatGetRepositoryThrowsExceptionIfEntityNotConfigured()
{ {
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -63,7 +63,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
$manager = new RepositoryManager($readerMock); $manager = new RepositoryManager($readerMock);
$manager->addEntity($entityName, $finderMock); $manager->addEntity($entityName, $finderMock);
@ -75,7 +75,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
*/ */
public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound() public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound()
{ {
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -83,10 +83,10 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
$manager = new RepositoryManager($readerMock); $manager = new RepositoryManager($readerMock);
$manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\MissingRepository'); $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository');
$manager->getRepository('Missing Entity'); $manager->getRepository('Missing Entity');
} }

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\MappingRegistry; namespace FOS\ElasticaBundle\Tests\MappingRegistry;
use FOQ\ElasticaBundle\MappingRegistry; use FOS\ElasticaBundle\MappingRegistry;
use Elastica_Type; use Elastica_Type;
use Elastica_Index; use Elastica_Index;

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\ObjectPersister; namespace FOS\ElasticaBundle\Tests\ObjectPersister;
use FOQ\ElasticaBundle\Persister\ObjectPersister; use FOS\ElasticaBundle\Persister\ObjectPersister;
use FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer; use FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer;
class POPO class POPO
{ {

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Populator; namespace FOS\ElasticaBundle\Tests\Populator;
use FOQ\ElasticaBundle\Populator; use FOS\ElasticaBundle\Populator;
use FOQ\ElasticaBundle\Provider\ProviderInterface; use FOS\ElasticaBundle\Provider\ProviderInterface;
use Closure; use Closure;
class PopulatorMock extends Populator class PopulatorMock extends Populator
@ -15,23 +15,23 @@ class PopulatorTest extends \PHPUnit_Framework_TestCase
{ {
public function testThatWeCanAddProvider() public function testThatWeCanAddProvider()
{ {
$provider = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface', array('populate')); $provider = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface', array('populate'));
$populator = new PopulatorMock(array()); $populator = new PopulatorMock(array());
$populator->addProvider('l3l0Provider', $provider); $populator->addProvider('l3l0Provider', $provider);
$this->assertEquals(count($populator->providers), 1); $this->assertEquals(count($populator->providers), 1);
$this->assertArrayHasKey('l3l0Provider', $populator->providers); $this->assertArrayHasKey('l3l0Provider', $populator->providers);
$this->assertInstanceOf('FOQ\ElasticaBundle\Provider\ProviderInterface', $populator->providers['l3l0Provider']); $this->assertInstanceOf('FOS\ElasticaBundle\Provider\ProviderInterface', $populator->providers['l3l0Provider']);
} }
public function testThatPopulateThroughProviders() public function testThatPopulateThroughProviders()
{ {
$provider = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface', array('populate')); $provider = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface', array('populate'));
$provider->expects($this->once()) $provider->expects($this->once())
->method('populate'); ->method('populate');
$provider2 = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface', array('populate')); $provider2 = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface', array('populate'));
$provider2->expects($this->once()) $provider2->expects($this->once())
->method('populate'); ->method('populate');

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests; namespace FOS\ElasticaBundle\Tests;
use FOQ\ElasticaBundle\Repository; use FOS\ElasticaBundle\Repository;
/** /**
* @author Richard Miller <info@limethinking.co.uk> * @author Richard Miller <info@limethinking.co.uk>
@ -14,7 +14,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
{ {
$testQuery = 'Test Query'; $testQuery = 'Test Query';
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$finderMock->expects($this->once()) $finderMock->expects($this->once())
@ -30,7 +30,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
$testQuery = 'Test Query'; $testQuery = 'Test Query';
$testLimit = 20; $testLimit = 20;
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$finderMock->expects($this->once()) $finderMock->expects($this->once())
@ -45,7 +45,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
{ {
$testQuery = 'Test Query'; $testQuery = 'Test Query';
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$finderMock->expects($this->once()) $finderMock->expects($this->once())
@ -61,7 +61,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
$testQuery = 'Test Query'; $testQuery = 'Test Query';
$testLimit = 20; $testLimit = 20;
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$finderMock->expects($this->once()) $finderMock->expects($this->once())

View file

@ -1,9 +1,9 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Reseter; namespace FOS\ElasticaBundle\Tests\Reseter;
use FOQ\ElasticaBundle\Reseter; use FOS\ElasticaBundle\Reseter;
use FOQ\ElasticaBundle\IndexManager; use FOS\ElasticaBundle\IndexManager;
use Elastica_Exception_Response; use Elastica_Exception_Response;
use Elastica_Response; use Elastica_Response;

View file

@ -1,32 +1,32 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Transformer; namespace FOS\ElasticaBundle\Tests\Transformer;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection; use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection;
class ElasticaToModelTransformerCollectionTest extends \PHPUnit_Framework_TestCase class ElasticaToModelTransformerCollectionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @var \FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection * @var \FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection
*/ */
protected $collection; protected $collection;
protected $transformers = array(); protected $transformers = array();
protected function collectionSetup() protected function collectionSetup()
{ {
$transformer1 = $this->getMock('FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface'); $transformer1 = $this->getMock('FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface');
$transformer1->expects($this->any()) $transformer1->expects($this->any())
->method('getObjectClass') ->method('getObjectClass')
->will($this->returnValue('FOQ\ElasticaBundle\Tests\Transformer\POPO')); ->will($this->returnValue('FOS\ElasticaBundle\Tests\Transformer\POPO'));
$transformer1->expects($this->any()) $transformer1->expects($this->any())
->method('getIdentifierField') ->method('getIdentifierField')
->will($this->returnValue('id')); ->will($this->returnValue('id'));
$transformer2 = $this->getMock('FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface'); $transformer2 = $this->getMock('FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface');
$transformer2->expects($this->any()) $transformer2->expects($this->any())
->method('getObjectClass') ->method('getObjectClass')
->will($this->returnValue('FOQ\ElasticaBundle\Tests\Transformer\POPO2')); ->will($this->returnValue('FOS\ElasticaBundle\Tests\Transformer\POPO2'));
$transformer2->expects($this->any()) $transformer2->expects($this->any())
->method('getIdentifierField') ->method('getIdentifierField')
@ -44,8 +44,8 @@ class ElasticaToModelTransformerCollectionTest extends \PHPUnit_Framework_TestCa
$objectClasses = $this->collection->getObjectClass(); $objectClasses = $this->collection->getObjectClass();
$this->assertEquals(array( $this->assertEquals(array(
'type1' => 'FOQ\ElasticaBundle\Tests\Transformer\POPO', 'type1' => 'FOS\ElasticaBundle\Tests\Transformer\POPO',
'type2' => 'FOQ\ElasticaBundle\Tests\Transformer\POPO2' 'type2' => 'FOS\ElasticaBundle\Tests\Transformer\POPO2'
), $objectClasses); ), $objectClasses);
} }

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Tests\Transformer\ModelToElasticaAutoTransformer; namespace FOS\ElasticaBundle\Tests\Transformer\ModelToElasticaAutoTransformer;
use FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer; use FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer;
class POPO class POPO
{ {

View file

@ -7,7 +7,7 @@ if (file_exists($file = __DIR__.'/../vendor/autoload.php')) {
} }
spl_autoload_register(function($class) { spl_autoload_register(function($class) {
if (0 === strpos($class, 'FOQ\\ElasticaBundle\\')) { if (0 === strpos($class, 'FOS\\ElasticaBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) { if (!stream_resolve_include_path($path)) {
return false; return false;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace FOQ\ElasticaBundle\Transformer; namespace FOS\ElasticaBundle\Transformer;
use FOQ\ElasticaBundle\HybridResult; use FOS\ElasticaBundle\HybridResult;
/** /**
* Holds a collection of transformers for an index wide transformation. * Holds a collection of transformers for an index wide transformation.

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Transformer; namespace FOS\ElasticaBundle\Transformer;
/** /**
* Maps Elastica documents with model objects * Maps Elastica documents with model objects

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Transformer; namespace FOS\ElasticaBundle\Transformer;
/** /**
* Maps Elastica documents with model objects * Maps Elastica documents with model objects

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Transformer; namespace FOS\ElasticaBundle\Transformer;
use Elastica_Document; use Elastica_Document;
use Traversable; use Traversable;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace FOQ\ElasticaBundle\Transformer; namespace FOS\ElasticaBundle\Transformer;
/** /**
* Maps Elastica documents with model objects * Maps Elastica documents with model objects

View file

@ -1,9 +1,9 @@
{ {
"name": "exercise/elastica-bundle", "name": "friendsofsymfony/elastica-bundle",
"type": "symfony-bundle", "type": "symfony-bundle",
"description": "Elasticsearch PHP integration for your Symfony2 project using Elastica", "description": "Elasticsearch PHP integration for your Symfony2 project using Elastica",
"keywords": ["doctrine2", "elastica", "elasticsearch", "mongodb", "propel", "search"], "keywords": ["doctrine2", "elastica", "elasticsearch", "mongodb", "propel", "search"],
"homepage": "https://github.com/Exercise/FOQElasticaBundle", "homepage": "https://github.com/FriendsOfSymfony/FOSElasticaBundle",
"license": "MIT", "license": "MIT",
"authors": [ "authors": [
{ "name": "Thibault Duplessis", "email": "thibault.duplessis@gmail.com" }, { "name": "Thibault Duplessis", "email": "thibault.duplessis@gmail.com" },
@ -27,7 +27,7 @@
"propel/propel1": "1.6.*" "propel/propel1": "1.6.*"
}, },
"autoload": { "autoload": {
"psr-0": { "FOQ\\ElasticaBundle": "" } "psr-0": { "FOS\\ElasticaBundle": "" }
}, },
"target-dir": "FOQ/ElasticaBundle" "target-dir": "FOS/ElasticaBundle"
} }

View file

@ -2,7 +2,7 @@
<phpunit bootstrap="./Tests/bootstrap.php" colors="true"> <phpunit bootstrap="./Tests/bootstrap.php" colors="true">
<testsuites> <testsuites>
<testsuite name="FOQElasticaBundle Test Suite"> <testsuite name="FOSElasticaBundle Test Suite">
<directory>./Tests</directory> <directory>./Tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>