Skip to content

Commit

Permalink
#71 rename to FOSMessageBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
zocimek committed Sep 19, 2012
1 parent a2a5c91 commit a2485c5
Show file tree
Hide file tree
Showing 118 changed files with 653 additions and 649 deletions.
12 changes: 6 additions & 6 deletions Command/MongoDBMigrateMetadataCommand.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ornicar\MessageBundle\Command;
namespace FOS\MessageBundle\Command;

use Doctrine\Common\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
Expand Down Expand Up @@ -72,7 +72,7 @@ protected function configure()
<info>*</info> thread.datesOfLastMessageWrittenByOtherParticipant
<info>*</info> thread.datesOfLastMessageWrittenByParticipant
<info>*</info> thread.isDeletedByParticipant
The following new fields will be created:
<info>*</info> message.metadata <comment>(array of embedded metadata documents)</comment>
Expand All @@ -98,8 +98,8 @@ protected function initialize(InputInterface $input, OutputInterface $output)
{
$registry = $this->getContainer()->get('doctrine.odm.mongodb');

$this->messageCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('ornicar_message.message_class'));
$this->threadCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('ornicar_message.thread_class'));
$this->messageCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('fos_message.message_class'));
$this->threadCollection = $this->getMongoCollectionForClass($registry, $this->getContainer()->getParameter('fos_message.thread_class'));
$this->participantCollection = $this->getMongoCollectionForClass($registry, $input->getArgument('participantClass'));

$this->updateOptions = array(
Expand Down Expand Up @@ -253,7 +253,7 @@ private function createMessageMetadata(array &$message)
/**
* Sets the unreadForParticipants array on the message.
*
* @see Ornicar\MessageBundle\Document\Message::doEnsureUnreadForParticipantsArray()
* @see FOS\MessageBundle\Document\Message::doEnsureUnreadForParticipantsArray()
* @param array &$message
*/
private function createMessageUnreadForParticipants(array &$message)
Expand Down Expand Up @@ -331,7 +331,7 @@ private function createThreadLastMessageDate(array &$thread)
/**
* Sets the active participant arrays on the thread.
*
* @see Ornicar\MessageBundle\Document\Thread::doEnsureActiveParticipantArrays()
* @see FOS\MessageBundle\Document\Thread::doEnsureActiveParticipantArrays()
* @param array $thread
*/
private function createThreadActiveParticipantArrays(array &$thread)
Expand Down
16 changes: 8 additions & 8 deletions Composer/Composer.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Ornicar\MessageBundle\Composer;

use Ornicar\MessageBundle\ModelManager\MessageManagerInterface;
use Ornicar\MessageBundle\Sender\SenderInterface;
use Ornicar\MessageBundle\Model\ThreadInterface;
use Ornicar\MessageBundle\ModelManager\ThreadManagerInterface;
use Ornicar\MessageBundle\MessageBuilder\NewThreadMessageBuilder;
use Ornicar\MessageBundle\MessageBuilder\ReplyMessageBuilder;
namespace FOS\MessageBundle\Composer;

use FOS\MessageBundle\ModelManager\MessageManagerInterface;
use FOS\MessageBundle\Sender\SenderInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\ModelManager\ThreadManagerInterface;
use FOS\MessageBundle\MessageBuilder\NewThreadMessageBuilder;
use FOS\MessageBundle\MessageBuilder\ReplyMessageBuilder;

/**
* Factory for message builders
Expand Down
4 changes: 2 additions & 2 deletions Composer/ComposerInterface.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Ornicar\MessageBundle\Composer;
namespace FOS\MessageBundle\Composer;

use Ornicar\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Model\ThreadInterface;

/**
* Factory for message builders
Expand Down
38 changes: 19 additions & 19 deletions Controller/MessageController.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Ornicar\MessageBundle\Controller;
namespace FOS\MessageBundle\Controller;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Ornicar\MessageBundle\Provider\ProviderInterface;
use FOS\MessageBundle\Provider\ProviderInterface;

class MessageController extends ContainerAware
{
Expand All @@ -18,7 +18,7 @@ public function inboxAction()
{
$threads = $this->getProvider()->getInboxThreads();

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:inbox.html.twig', array(
return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:inbox.html.twig', array(
'threads' => $threads
));
}
Expand All @@ -32,7 +32,7 @@ public function sentAction()
{
$threads = $this->getProvider()->getSentThreads();

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:sent.html.twig', array(
return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:sent.html.twig', array(
'threads' => $threads
));
}
Expand All @@ -46,16 +46,16 @@ public function sentAction()
public function threadAction($threadId)
{
$thread = $this->getProvider()->getThread($threadId);
$form = $this->container->get('ornicar_message.reply_form.factory')->create($thread);
$formHandler = $this->container->get('ornicar_message.reply_form.handler');
$form = $this->container->get('fos_message.reply_form.factory')->create($thread);
$formHandler = $this->container->get('fos_message.reply_form.handler');

if ($message = $formHandler->process($form)) {
return new RedirectResponse($this->container->get('router')->generate('ornicar_message_thread_view', array(
return new RedirectResponse($this->container->get('router')->generate('fos_message_thread_view', array(
'threadId' => $message->getThread()->getId()
)));
}

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:thread.html.twig', array(
return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:thread.html.twig', array(
'form' => $form->createView(),
'thread' => $thread
));
Expand All @@ -68,16 +68,16 @@ public function threadAction($threadId)
*/
public function newThreadAction()
{
$form = $this->container->get('ornicar_message.new_thread_form.factory')->create();
$formHandler = $this->container->get('ornicar_message.new_thread_form.handler');
$form = $this->container->get('fos_message.new_thread_form.factory')->create();
$formHandler = $this->container->get('fos_message.new_thread_form.handler');

if ($message = $formHandler->process($form)) {
return new RedirectResponse($this->container->get('router')->generate('ornicar_message_thread_view', array(
return new RedirectResponse($this->container->get('router')->generate('fos_message_thread_view', array(
'threadId' => $message->getThread()->getId()
)));
}

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:newThread.html.twig', array(
return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:newThread.html.twig', array(
'form' => $form->createView(),
'data' => $form->getData()
));
Expand All @@ -91,10 +91,10 @@ public function newThreadAction()
public function deleteAction($threadId)
{
$thread = $this->getProvider()->getThread($threadId);
$this->container->get('ornicar_message.deleter')->markAsDeleted($thread);
$this->container->get('ornicar_message.thread_manager')->saveThread($thread);
$this->container->get('fos_message.deleter')->markAsDeleted($thread);
$this->container->get('fos_message.thread_manager')->saveThread($thread);

return new RedirectResponse($this->container->get('router')->generate('ornicar_message_inbox'));
return new RedirectResponse($this->container->get('router')->generate('fos_message_inbox'));
}

/**
Expand All @@ -104,10 +104,10 @@ public function deleteAction($threadId)
*/
public function searchAction()
{
$query = $this->container->get('ornicar_message.search_query_factory')->createFromRequest();
$threads = $this->container->get('ornicar_message.search_finder')->find($query);
$query = $this->container->get('fos_message.search_query_factory')->createFromRequest();
$threads = $this->container->get('fos_message.search_finder')->find($query);

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:search.html.twig', array(
return $this->container->get('templating')->renderResponse('FOSMessageBundle:Message:search.html.twig', array(
'query' => $query,
'threads' => $threads
));
Expand All @@ -120,6 +120,6 @@ public function searchAction()
*/
protected function getProvider()
{
return $this->container->get('ornicar_message.provider');
return $this->container->get('fos_message.provider');
}
}
16 changes: 8 additions & 8 deletions Deleter/Deleter.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Ornicar\MessageBundle\Deleter;
namespace FOS\MessageBundle\Deleter;

use Ornicar\MessageBundle\Security\AuthorizerInterface;
use Ornicar\MessageBundle\Model\ThreadInterface;
use Ornicar\MessageBundle\Security\ParticipantProviderInterface;
use Ornicar\MessageBundle\Event\OrnicarMessageEvents;
use Ornicar\MessageBundle\Event\ThreadEvent;
use FOS\MessageBundle\Security\AuthorizerInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Security\ParticipantProviderInterface;
use FOS\MessageBundle\Event\FOSMessageEvents;
use FOS\MessageBundle\Event\ThreadEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

Expand Down Expand Up @@ -57,7 +57,7 @@ public function markAsDeleted(ThreadInterface $thread)
}
$thread->setIsDeletedByParticipant($this->getAuthenticatedParticipant(), true);

$this->dispatcher->dispatch(OrnicarMessageEvents::POST_DELETE, new ThreadEvent($thread));
$this->dispatcher->dispatch(FOSMessageEvents::POST_DELETE, new ThreadEvent($thread));
}

/**
Expand All @@ -72,7 +72,7 @@ public function markAsUndeleted(ThreadInterface $thread)
}
$thread->setIsDeletedByParticipant($this->getAuthenticatedParticipant(), false);

$this->dispatcher->dispatch(OrnicarMessageEvents::POST_UNDELETE, new ThreadEvent($thread));
$this->dispatcher->dispatch(FOSMessageEvents::POST_UNDELETE, new ThreadEvent($thread));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Deleter/DeleterInterface.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Ornicar\MessageBundle\Deleter;
namespace FOS\MessageBundle\Deleter;

use Ornicar\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Model\ThreadInterface;

/**
* Marks threads as deleted
Expand Down
48 changes: 24 additions & 24 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ornicar\MessageBundle\DependencyInjection;
namespace FOS\MessageBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
Expand All @@ -19,51 +19,51 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('ornicar_message');
$rootNode = $treeBuilder->root('fos_message');

$rootNode
->children()
->scalarNode('db_driver')->cannotBeOverwritten()->isRequired()->cannotBeEmpty()->end()
->scalarNode('thread_class')->isRequired()->cannotBeEmpty()->end()
->scalarNode('message_class')->isRequired()->cannotBeEmpty()->end()
->scalarNode('message_manager')->defaultValue('ornicar_message.message_manager.default')->cannotBeEmpty()->end()
->scalarNode('thread_manager')->defaultValue('ornicar_message.thread_manager.default')->cannotBeEmpty()->end()
->scalarNode('sender')->defaultValue('ornicar_message.sender.default')->cannotBeEmpty()->end()
->scalarNode('composer')->defaultValue('ornicar_message.composer.default')->cannotBeEmpty()->end()
->scalarNode('provider')->defaultValue('ornicar_message.provider.default')->cannotBeEmpty()->end()
->scalarNode('participant_provider')->defaultValue('ornicar_message.participant_provider.default')->cannotBeEmpty()->end()
->scalarNode('authorizer')->defaultValue('ornicar_message.authorizer.default')->cannotBeEmpty()->end()
->scalarNode('message_reader')->defaultValue('ornicar_message.message_reader.default')->cannotBeEmpty()->end()
->scalarNode('thread_reader')->defaultValue('ornicar_message.thread_reader.default')->cannotBeEmpty()->end()
->scalarNode('deleter')->defaultValue('ornicar_message.deleter.default')->cannotBeEmpty()->end()
->scalarNode('spam_detector')->defaultValue('ornicar_message.noop_spam_detector')->cannotBeEmpty()->end()
->scalarNode('twig_extension')->defaultValue('ornicar_message.twig_extension.default')->cannotBeEmpty()->end()
->scalarNode('message_manager')->defaultValue('fos_message.message_manager.default')->cannotBeEmpty()->end()
->scalarNode('thread_manager')->defaultValue('fos_message.thread_manager.default')->cannotBeEmpty()->end()
->scalarNode('sender')->defaultValue('fos_message.sender.default')->cannotBeEmpty()->end()
->scalarNode('composer')->defaultValue('fos_message.composer.default')->cannotBeEmpty()->end()
->scalarNode('provider')->defaultValue('fos_message.provider.default')->cannotBeEmpty()->end()
->scalarNode('participant_provider')->defaultValue('fos_message.participant_provider.default')->cannotBeEmpty()->end()
->scalarNode('authorizer')->defaultValue('fos_message.authorizer.default')->cannotBeEmpty()->end()
->scalarNode('message_reader')->defaultValue('fos_message.message_reader.default')->cannotBeEmpty()->end()
->scalarNode('thread_reader')->defaultValue('fos_message.thread_reader.default')->cannotBeEmpty()->end()
->scalarNode('deleter')->defaultValue('fos_message.deleter.default')->cannotBeEmpty()->end()
->scalarNode('spam_detector')->defaultValue('fos_message.noop_spam_detector')->cannotBeEmpty()->end()
->scalarNode('twig_extension')->defaultValue('fos_message.twig_extension.default')->cannotBeEmpty()->end()
->arrayNode('search')
->addDefaultsIfNotSet()
->children()
->scalarNode('query_factory')->defaultValue('ornicar_message.search_query_factory.default')->cannotBeEmpty()->end()
->scalarNode('finder')->defaultValue('ornicar_message.search_finder.default')->cannotBeEmpty()->end()
->scalarNode('query_factory')->defaultValue('fos_message.search_query_factory.default')->cannotBeEmpty()->end()
->scalarNode('finder')->defaultValue('fos_message.search_finder.default')->cannotBeEmpty()->end()
->scalarNode('query_parameter')->defaultValue('q')->cannotBeEmpty()->end()
->end()
->end()
->arrayNode('new_thread_form')
->addDefaultsIfNotSet()
->children()
->scalarNode('factory')->defaultValue('ornicar_message.new_thread_form.factory.default')->cannotBeEmpty()->end()
->scalarNode('type')->defaultValue('ornicar_message.new_thread_form.type.default')->cannotBeEmpty()->end()
->scalarNode('handler')->defaultValue('ornicar_message.new_thread_form.handler.default')->cannotBeEmpty()->end()
->scalarNode('factory')->defaultValue('fos_message.new_thread_form.factory.default')->cannotBeEmpty()->end()
->scalarNode('type')->defaultValue('fos_message.new_thread_form.type.default')->cannotBeEmpty()->end()
->scalarNode('handler')->defaultValue('fos_message.new_thread_form.handler.default')->cannotBeEmpty()->end()
->scalarNode('name')->defaultValue('message')->cannotBeEmpty()->end()
->scalarNode('model')->defaultValue('Ornicar\MessageBundle\FormModel\NewThreadMessage')->end()
->scalarNode('model')->defaultValue('FOS\MessageBundle\FormModel\NewThreadMessage')->end()
->end()
->end()
->arrayNode('reply_form')
->addDefaultsIfNotSet()
->children()
->scalarNode('factory')->defaultValue('ornicar_message.reply_form.factory.default')->cannotBeEmpty()->end()
->scalarNode('type')->defaultValue('ornicar_message.reply_form.type.default')->cannotBeEmpty()->end()
->scalarNode('handler')->defaultValue('ornicar_message.reply_form.handler.default')->cannotBeEmpty()->end()
->scalarNode('factory')->defaultValue('fos_message.reply_form.factory.default')->cannotBeEmpty()->end()
->scalarNode('type')->defaultValue('fos_message.reply_form.type.default')->cannotBeEmpty()->end()
->scalarNode('handler')->defaultValue('fos_message.reply_form.handler.default')->cannotBeEmpty()->end()
->scalarNode('name')->defaultValue('message')->cannotBeEmpty()->end()
->scalarNode('model')->defaultValue('Ornicar\MessageBundle\FormModel\ReplyMessage')->end()
->scalarNode('model')->defaultValue('FOS\MessageBundle\FormModel\ReplyMessage')->end()
->end()
->end()
->end();
Expand Down
Loading

0 comments on commit a2485c5

Please sign in to comment.