Skip to content

Add router resource type option to FrameworkExtension #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
199e6bf
[BrowserKit] removed annotation in a unit test to fix coverage
fabpot Feb 5, 2011
f9138d3
[FrameworkBundle] Implemented single-pass config loading with intelli…
jmikola Jan 24, 2011
575b75a
[DependencyInjection] Fix fixture class loaded twice during dumper tests
ornicar Feb 5, 2011
743f25a
[DependencyInjection] Create explicit factoryClass property for Defin…
jmikola Feb 2, 2011
80b03f9
[HttpKernel] Throw exception when SQLite statement execution failed
ornicar Feb 5, 2011
bfe701a
fixed code coverage
fabpot Feb 5, 2011
523e652
[FrameworkBundle] fixed the way profiler configuration works
fabpot Feb 5, 2011
e540349
removed the need to define getNamespace() and getPath() in bundles
fabpot Feb 5, 2011
f56a6ef
[HttpFoundation] File/File full coverage
pborreli Feb 5, 2011
562ebd5
[CssSelector] Added PHPDoc blocks to first-level classes.
ncuesta Feb 5, 2011
bd97471
[HttpKernel] Add test coverage for cache warming
ornicar Feb 5, 2011
4f6256b
[FrameworkBundle] fixed invalid template filename
kriswallsmith Feb 6, 2011
c251a36
[HttpFoundation] Add tests for Cookie
johnkary Feb 6, 2011
9ba2943
[HttpKernel] Add unit tests for Kernel. Also slightly modify Kernel t…
ornicar Feb 6, 2011
f08c948
[CssSelector] Fixed PHPDoc blocks.
ncuesta Feb 5, 2011
39ed62d
translated validators resources into Japanese
hidenorigoto Feb 6, 2011
42a3e40
translated validators resources into Spanish
javiereguiluz Feb 6, 2011
6ff4120
[Form] Added Form option "by_reference" so that objects received from…
Feb 6, 2011
bd3e6c6
[Form] Fixed: Form::bind() throws an exception if form is anonymous
Feb 6, 2011
74d0ac8
[Form] Cleaned up ValueTransformerInterface
Feb 6, 2011
c5fb96b
[HttpKernel] Add more unit tests for Kernel
ornicar Feb 6, 2011
0b8fef2
[Security/DependencyInjection] adds support for merging security conf…
schmittjoh Feb 4, 2011
c7ef8d9
[DependencyInjection] append new elements for prototype nodes without…
schmittjoh Feb 6, 2011
2316c90
[Security] fixes a regression
schmittjoh Feb 6, 2011
cdff8b2
[FrameworkBundle] fixed error message for template as an array
fabpot Feb 6, 2011
2b256a0
[DependencyInjection] allow null for scalar nodes
schmittjoh Feb 6, 2011
099b9de
[FrameworkBundle] Integrate Configuration\Builder class for config me…
jmikola Feb 6, 2011
7cb42d2
Revert "[TwigBundle] fixed error messages when an error occurs during…
fabpot Feb 6, 2011
86631a9
[FrameworkBundle] fixed template loaders in configuration
fabpot Feb 6, 2011
afad113
[HttpKernel] Fix notice in Kernel
ornicar Feb 6, 2011
44e6a5d
added exception_controller config option
lsmith77 Feb 6, 2011
33c8d12
[FrameworkBundle] fixed XSD for the new exception-controller option
fabpot Feb 6, 2011
7ad4f99
[HttpFoundation] File/UploadedFile, MimeTest, Exception full coverage
pborreli Feb 6, 2011
b9ed739
fixed RedirectController - removed parmanent attribute before generat…
marphi Feb 6, 2011
69672ba
Added phpdoc to BrowserKit
merk Feb 6, 2011
108efc6
Classloader PHPDoc
merk Feb 6, 2011
0d6a6b7
PHPDoc fixes
merk Feb 6, 2011
803cc91
[FrameworkBundle] Fix TemplateNameParser template name exception message
ornicar Feb 6, 2011
93fd935
PHPDoc style fix
merk Feb 6, 2011
2201382
[HttpKernel] Fix issue in SQLite profiler storage when PDO fails to p…
ornicar Feb 7, 2011
bebdcb2
[HttpKernel] Added response cache-control modification if page is com…
marcw Feb 7, 2011
ea4ab77
[HttpKernel] HttpCache now sends maxage=0 cache-control directive in …
marcw Feb 7, 2011
4252680
[HttpKernel] Catch exception when SQLite profiler storage fails to cl…
ornicar Feb 7, 2011
f3b6e1a
PHPDoc for Console
merk Feb 7, 2011
41bf849
[HttpFoundation] Request coverage
pborreli Feb 7, 2011
9f30e42
added --debug/-d and --env/-d to console
fabpot Feb 7, 2011
4c65161
[Yaml] Added PHPDoc on getTimestampRegex()
DuoSRX Feb 7, 2011
2f9b9f5
[Templating] Added some missing PHPDoc
DuoSRX Feb 7, 2011
734be81
[DoctrineMongoDBBundle] fixed UniqueValidatorTest to mark skipped if …
avalanche123 Feb 8, 2011
d447d22
[DoctrineBundle, DoctrineAbstractBundle, DoctrineMongoDBBundle] added…
avalanche123 Feb 8, 2011
97679e5
[DoctrineAbstractBundle] added test for new Loader
avalanche123 Feb 8, 2011
ef43b22
[HttpFoundation] fixed test cleanup
kriswallsmith Feb 7, 2011
59bf50b
[Form] Disabled by reference handling for arrays
Feb 7, 2011
09a50c3
[Form] Fixed: "by_reference" option is ignored if reading from/writin…
Feb 7, 2011
5b95805
[Form] Added option "data_constructor" to Form. When a Form is initia…
Feb 7, 2011
f51dafc
[Form] Fixed: "data_constructor" option is used even if "data_class" …
Feb 7, 2011
9f52333
[HttpKernel] Fixed DataCollector Request attributes when attributes h…
marcw Feb 8, 2011
f35f1e1
[FrameworkBundle] fixed init:bundle command
fabpot Feb 8, 2011
7e0ed27
[HttpKernel] fixed phpdoc
fabpot Feb 8, 2011
fae8a55
[Console] fixed typo
fabpot Feb 8, 2011
9f77cab
[TwigBundle] Cast non-array resources argument to array in form_field…
jmikola Feb 8, 2011
76e9b6e
[Console] PHPDoc fixes
merk Feb 9, 2011
06e2c01
[CssSelector] PHPDoc additions
merk Feb 9, 2011
5d87d83
optimize duplication of Request objects
subsven Feb 8, 2011
56dc128
[DoctrineBundle] use namespace and fix double variable declaration
Feb 8, 2011
d076ee4
[DoctrineMongoDBBundle] use namespace in MongoDB data fixtures command
Feb 8, 2011
643647f
[FrameworkBundle/Routing] Add "type" option for main Router resource …
jmikola Feb 10, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<exclude>
<directory>./src/Symfony/Bundle/*/Resources</directory>
<directory>./src/Symfony/Component/*/Resources</directory>
<file>./src/Symfony/Component/HttpKernel/bootstrap*</file>
<file>./src/Symfony/Component/HttpKernel/bootstrap.php</file>
<file>./src/Symfony/Component/HttpKernel/bootstrap_cache.php</file>
</exclude>
</whitelist>
</filter>
Expand Down
15 changes: 0 additions & 15 deletions src/Symfony/Bundle/CompatAssetsBundle/CompatAssetsBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,4 @@
*/
class CompatAssetsBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\Loader as BaseLoader;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class Loader extends BaseLoader
{
private $container;

public function __construct(ContainerInterface $container)
{
$this->container = $container;
}

public function addFixture(FixtureInterface $fixture)
{
if ($fixture instanceof ContainerAwareInterface) {
$fixture->setContainer($this->container);
}

parent::addFixture($fixture);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Symfony\Bundle\DoctrineAbstractBundle\Tests\Common;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class ContainerAwareFixture implements FixtureInterface, ContainerAwareInterface
{
public $container;

public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}

public function load($manager)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Symfony\Bundle\DoctrineAbstractBundle\Tests\Common\DataFixtures;

use Symfony\Bundle\DoctrineAbstractBundle\Tests\TestCase;
use Symfony\Bundle\DoctrineAbstractBundle\Tests\Common\ContainerAwareFixture;
use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader;

class LoaderTest extends TestCase
{
public function testShouldSetContainerOnContainerAwareFixture()
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$loader = new Loader($container);
$fixture = new ContainerAwareFixture();

$loader->addFixture($fixture);

$this->assertSame($container, $fixture->container);
}
}
13 changes: 13 additions & 0 deletions src/Symfony/Bundle/DoctrineAbstractBundle/Tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Symfony\Bundle\DoctrineAbstractBundle\Tests;

class TestCase extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!class_exists('Doctrine\Common\DataFixtures\Loader')) {
$this->markTestSkipped('Doctrine Data Fixtures is not available.');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Finder\Finder;
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader as DataFixturesLoader;
use Doctrine\Common\Cli\Configuration;
use Doctrine\Common\Cli\CliController as DoctrineCliController;
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Internal\CommitOrderCalculator;
use Doctrine\ORM\Mapping\ClassMetadata;
Expand Down Expand Up @@ -72,15 +75,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

$loader = new \Doctrine\Common\DataFixtures\Loader();
$loader = new DataFixturesLoader($this->container);
foreach ($paths as $path) {
if (is_dir($path)) {
$loader->loadFromDirectory($path);
}
}
$fixtures = $loader->getFixtures();
$purger = new \Doctrine\Common\DataFixtures\Purger\ORMPurger($em);
$executor = new \Doctrine\Common\DataFixtures\Executor\ORMExecutor($em, $purger);
$purger = new ORMPurger($em);
$executor = new ORMExecutor($em, $purger);
$executor->setLogger(function($message) use ($output) {
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $
new Reference(sprintf('doctrine.orm.%s_configuration', $entityManager['name']))
);
$ormEmDef = new Definition('%doctrine.orm.entity_manager_class%', $ormEmArgs);
$ormEmDef->setFactoryClass('%doctrine.orm.entity_manager_class%');
$ormEmDef->setFactoryMethod('create');
$ormEmDef->addTag('doctrine.orm.entity_manager');
$container->setDefinition($entityManagerService, $ormEmDef);
Expand Down
16 changes: 0 additions & 16 deletions src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,4 @@ public function registerExtensions(ContainerBuilder $container)

$container->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
}

/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public function testDependencyInjectionConfigurationDefaults()

$definition = $container->getDefinition('doctrine.orm.default_entity_manager');
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getClass());
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getFactoryClass());
$this->assertEquals('create', $definition->getFactoryMethod());
$this->assertArrayHasKey('doctrine.orm.entity_manager', $definition->getTags());

Expand Down Expand Up @@ -198,6 +199,7 @@ public function testSingleEntityManagerConfiguration()

$definition = $container->getDefinition('doctrine.orm.default_entity_manager');
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getClass());
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getFactoryClass());
$this->assertEquals('create', $definition->getFactoryMethod());
$this->assertArrayHasKey('doctrine.orm.entity_manager', $definition->getTags());

Expand Down Expand Up @@ -239,6 +241,7 @@ public function testLoadSimpleSingleConnection()

$definition = $container->getDefinition('doctrine.orm.default_entity_manager');
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getClass());
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getFactoryClass());
$this->assertEquals('create', $definition->getFactoryMethod());
$this->assertArrayHasKey('doctrine.orm.entity_manager', $definition->getTags());

Expand Down Expand Up @@ -279,6 +282,7 @@ public function testLoadSingleConnection()

$definition = $container->getDefinition('doctrine.orm.default_entity_manager');
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getClass());
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getFactoryClass());
$this->assertEquals('create', $definition->getFactoryMethod());
$this->assertArrayHasKey('doctrine.orm.entity_manager', $definition->getTags());

Expand Down Expand Up @@ -313,6 +317,7 @@ public function testLoadMultipleConnections()

$definition = $container->getDefinition('doctrine.orm.dm1_entity_manager');
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getClass());
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getFactoryClass());
$this->assertEquals('create', $definition->getFactoryMethod());
$this->assertArrayHasKey('doctrine.orm.entity_manager', $definition->getTags());

Expand All @@ -334,6 +339,7 @@ public function testLoadMultipleConnections()

$definition = $container->getDefinition('doctrine.orm.dm2_entity_manager');
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getClass());
$this->assertEquals('%doctrine.orm.entity_manager_class%', $definition->getFactoryClass());
$this->assertEquals('create', $definition->getFactoryMethod());
$this->assertArrayHasKey('doctrine.orm.entity_manager', $definition->getTags());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,4 @@

class AnnotationsBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,4 @@

class AnnotationsBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,4 @@

class XmlBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,4 @@

class YamlBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,4 @@
*/
class DoctrineMigrationsBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Finder\Finder;
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
use Symfony\Bundle\DoctrineAbstractBundle\Common\DataFixtures\Loader as DataFixturesLoader;
use Doctrine\Common\Cli\Configuration;
use Doctrine\Common\Cli\CliController as DoctrineCliController;
use Doctrine\Common\DataFixtures\Executor\MongoDBExecutor;
use Doctrine\Common\DataFixtures\Purger\MongoDBPurger;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Internal\CommitOrderCalculator;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
Expand Down Expand Up @@ -72,15 +75,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

$paths = array_filter($paths, 'is_dir');

$loader = new \Doctrine\Common\DataFixtures\Loader();
$loader = new DataFixturesLoader($this->container);
foreach ($paths as $path) {
$loader->loadFromDirectory($path);
if (is_dir($path)) {
$loader->loadFromDirectory($path);
}
}
$fixtures = $loader->getFixtures();
$purger = new \Doctrine\Common\DataFixtures\Purger\MongoDBPurger($dm);
$executor = new \Doctrine\Common\DataFixtures\Executor\MongoDBExecutor($dm, $purger);
$purger = new MongoDBPurger($dm);
$executor = new MongoDBExecutor($dm, $purger);
$executor->setLogger(function($message) use ($output) {
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ protected function loadDocumentManager(array $documentManager, ContainerBuilder
new Reference($eventManagerId),
);
$odmDmDef = new Definition('%doctrine.odm.mongodb.document_manager_class%', $odmDmArgs);
$odmDmDef->setFactoryClass('%doctrine.odm.mongodb.document_manager_class%');
$odmDmDef->setFactoryMethod('create');
$odmDmDef->addTag('doctrine.odm.mongodb.document_manager');
$container->setDefinition(sprintf('doctrine.odm.mongodb.%s_document_manager', $documentManager['name']), $odmDmDef);
Expand Down
16 changes: 0 additions & 16 deletions src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,4 @@ public function registerExtensions(ContainerBuilder $container)
$container->addCompilerPass(new CreateProxyDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
$container->addCompilerPass(new CreateHydratorDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
}

/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}

/**
* {@inheritdoc}
*/
public function getPath()
{
return __DIR__;
}
}
Loading