Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[POC/WIP] Start with a resource provider #314

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 1 commit into from

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Oct 31, 2015

Just to play around with fully implementing Puli in CMF 2.0. In the future, I think we can remove all persistence implementations and just only rely on resource (people will configure resource how to handle resources, e.g. with a filesystem, PHPCR, ORM, etc.).

This requires symfony-cmf/resource-bundle#16

Replaces #288. This PR uses Puli discovery to locate resources, this deprecates all basepath stuff (:tada:).

Example Config

cmf_resource:
    repositories:
        # configure CMF Resource to use a PHPCR ODM backend
        default:
            type: doctrine_phpcr_odm
    discovery:
        bindings:
            # bind the /cmf/simple resource and its children to the
            # cmf/routes type (discovered by the ResourceRouteProvider)
            - { path: /cms/simple, type: cmf/routes }
            - { path: /cms/simple/*, type: cmf/routes }

cmf_routing:
    dynamic:
        persistence:
            # PHPCR is required for mapping, this has to be refactored when we start developing CMF 2
            phpcr: true
            resource: true
        templates_by_class:
            Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page: AcmeDemoBundle:Page:index.html.twig

return;
}

foreach ($this->discovery->findBindings('cmf/routes') as $binding) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not so nice to do this every request, we should add some caching here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we eagerly load all the routes in the resource tree into memory? What about depth > 1 routes? e.g. /cms/simple/*/**

@wouterj wouterj changed the title [2.0][POC] Start with a resource provider [2.0][POC/WIP] Start with a resource provider Oct 31, 2015
@dantleech
Copy link
Member

This looks awesome :)

@wouterj wouterj mentioned this pull request Jun 14, 2016
@dbu
Copy link
Member

dbu commented Jun 14, 2016

does this block the 2.0 release? can it be added in 2.1 or is it too much of a BC break?

@wouterj
Copy link
Member Author

wouterj commented Jun 14, 2016

@dbu it's not a BC break at all, adding new providers isn't a BC break...

However, this feature requires Puli. All CMF 2.0 bundles require SonataDoctrinePhpcrAdminBundle 2.0, which requires Puli. So in some way, merging this feature in 2.0 or not, we all have to wait until Puli is stable to release CMF 2.0.

@dbu
Copy link
Member

dbu commented Jun 14, 2016

@dbu https://github.com/dbu it's not a BC break at all, adding new
providers isn't a BC break...

ah, i thought it replaces the existing providers. great, then no blocker.

All CMF 2.0 bundles require
SonataDoctrinePhpcrAdminBundle 2.0, which requires Puli. So in some way,
merging this feature in 2.0 or not, we all have to wait untill Puli to
release CMF 2.0.

i hope we can solve this with the effort by max to move all admins to
the admin integration bundle.

@wouterj
Copy link
Member Author

wouterj commented Jun 14, 2016

i hope we can solve this with the effort by max to move all admins to the admin integration bundle.

Yeah, but that means releasing CMF 2.0 without any stable admin integration. That seems a bit strange to me.

@dbu
Copy link
Member

dbu commented Jun 14, 2016

not everybody uses/needs sonata admin, i would think, so still better than not releasing a version that works with symfony 3.

@dantleech
Copy link
Member

we could also implement the resource repository / resource APIs natively in 2.0 until Puli stable, if we really had to - that would be enough for the tree browser / resource rest use case (although not for this PR which requires discovery etc).

@dbu
Copy link
Member

dbu commented Jan 19, 2017

what do we do with this? is it a blocker for 2.0 or not?

@wouterj
Copy link
Member Author

wouterj commented Jan 20, 2017

No, can be easily skipped and moved to 2.1.

@wouterj wouterj added this to the 2.1 milestone Jan 20, 2017
@dbu dbu changed the title [2.0][POC/WIP] Start with a resource provider [POC/WIP] Start with a resource provider Feb 21, 2017
@dbu dbu removed this from the 2.1 milestone Jun 11, 2018
@dbu
Copy link
Member

dbu commented Oct 7, 2021

given that we removed puli as it seems not active anymore, i close this.

@dbu dbu closed this Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.