-
Notifications
You must be signed in to change notification settings - Fork 45
[WIP] Persistence #55
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
Changes from all commits
e77a72b
c10ff18
4341d5a
1ff94e1
bbd5948
4c47714
b60b097
3e733a2
6361d56
c144f85
7361c29
a9b85f5
aa6c6d7
cb4f98c
4eb849a
c6d8498
2610d69
839945d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Symfony\Cmf\Bundle\SimpleCmsBundle\DataFixtures; | ||
namespace Symfony\Cmf\Bundle\SimpleCmsBundle\DataFixtures\Phpcr; | ||
|
||
use Doctrine\Common\DataFixtures\FixtureInterface; | ||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
|
@@ -12,11 +12,13 @@ | |
|
||
use Symfony\Cmf\Component\Routing\RouteObjectInterface; | ||
|
||
abstract class LoadCmsData extends ContainerAware implements FixtureInterface, OrderedFixtureInterface | ||
/** | ||
* @deprecated: To be removed in 1.1 | ||
*/ | ||
abstract class AbstractLoadPageData extends ContainerAware implements FixtureInterface, OrderedFixtureInterface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we shouldn't simply remove this class. Its a bit of a convenience hack, there are probably other libraries that do this sort of thing much better, and it isn't /that/ much harder to do this ad-hoc in the concrete class. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well it makes it very easy to get started. if we remove it we have to add it to the SE for example https://github.com/symfony-cmf/symfony-cmf-standard/blob/master/src/Acme/MainBundle/DataFixtures/PHPCR/LoadSimpleCmsData.php There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. however we could consider basing this on https://github.com/nelmio/alice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That looks like a really cool library, +1 for adopting it in the SE / Sandbox and dropping this, if possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fine for me |
||
{ | ||
protected $defaultClass = array( | ||
'multilangpage' => 'Symfony\Cmf\Bundle\SimpleCmsBundle\Document\MultilangPage', | ||
'page' => 'Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page' | ||
'page' => 'Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page' | ||
); | ||
|
||
abstract protected function getData(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,33 +13,47 @@ public function getConfigTreeBuilder() | |
|
||
$treeBuilder->root('cmf_simple_cms') | ||
->children() | ||
->enumNode('use_sonata_admin') | ||
->values(array(true, false, 'auto')) | ||
->defaultValue('auto') | ||
->end() | ||
->arrayNode('sonata_admin') | ||
|
||
->arrayNode('persistence') | ||
->children() | ||
->enumNode('sort') | ||
->values(array(false, 'asc', 'desc')) | ||
->defaultValue(false) | ||
->arrayNode('phpcr') | ||
->children() | ||
->scalarNode('enabled')->defaultNull()->end() | ||
->scalarNode('basepath')->defaultValue('/cms/simple')->end() | ||
->scalarNode('manager_registry')->defaultValue('doctrine_phpcr')->end() | ||
->scalarNode('manager_name')->defaultNull()->end() | ||
->scalarNode('document_class')->defaultValue('Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page')->end() | ||
|
||
->enumNode('use_sonata_admin') | ||
->values(array(true, false, 'auto')) | ||
->defaultValue('auto') | ||
->end() | ||
->arrayNode('sonata_admin') | ||
->children() | ||
->enumNode('sort') | ||
->values(array(false, 'asc', 'desc')) | ||
->defaultValue(false) | ||
->end() | ||
->end() | ||
->end() | ||
->end() | ||
->end() | ||
->end() | ||
->end() | ||
|
||
->enumNode('use_menu') | ||
->values(array(true, false, 'auto')) | ||
->defaultValue('auto') | ||
->end() | ||
->scalarNode('document_class')->defaultValue('Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page')->end() | ||
->scalarNode('generic_controller')->defaultValue('cmf_content.controller:indexAction')->end() | ||
->scalarNode('basepath')->defaultValue('/cms/simple')->end() | ||
->scalarNode('manager_registry')->defaultValue('doctrine_phpcr')->end() | ||
->scalarNode('manager_name')->defaultValue('default')->end() | ||
|
||
|
||
->arrayNode('routing') | ||
->fixXmlConfig('controller_by_alias', 'controllers_by_alias') | ||
->fixXmlConfig('controller_by_class', 'controllers_by_class') | ||
->fixXmlConfig('template_by_class', 'templates_by_class') | ||
->addDefaultsIfNotSet() | ||
->children() | ||
->scalarNode('generic_controller')->defaultValue('cmf_content.controller:indexAction')->end() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fine for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be exactly the same as in cmf_routing - otherwise its really confusing. is there a way we could expose a method in RoutingBundle Configuration class to generate what it has there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or -- is there a way we could simply use the RoutingBundles dynamic router and so just use the native There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need a separate instance of the service, as it might be configured |
||
->scalarNode('content_repository_id')->defaultValue('cmf_routing.content_repository')->end() | ||
->scalarNode('uri_filter_regexp')->defaultValue('')->end() | ||
->arrayNode('controllers_by_alias') | ||
|
@@ -56,14 +70,6 @@ public function getConfigTreeBuilder() | |
->end() | ||
->end() | ||
->end() | ||
->arrayNode('multilang') | ||
->fixXmlConfig('locale') | ||
->children() | ||
->arrayNode('locales') | ||
->prototype('scalar')->end() | ||
->end() | ||
->end() | ||
->end() | ||
->end() | ||
; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? I prefer each Bundle to have its own setting and rely on CoreBundle to ease handling for duplicate settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does SimpleCmsBundle itself still do anything with locales? if not, there is no need to configure them. but maybe the routes with the automatic locale prefixing need it to put a requirement on _locale?