Skip to content
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

Register the bundle in the contrib recipes repositories #2704

Open
glickel opened this issue Jan 8, 2018 · 10 comments
Open

Register the bundle in the contrib recipes repositories #2704

glickel opened this issue Jan 8, 2018 · 10 comments

Comments

@glickel
Copy link

glickel commented Jan 8, 2018

Hello,
Have you planed to register the bundle in the contrib recipes repositories to install this with flex ?
There is already a pull request for that (here) but it's not finished and there is no update since 16 days.

I had already add this bundle in a project with Symfony 4, and it's work well, so I can do a new pull request on the recipes-contrib repositories to register the bundle and a pull request in this bundle to update the documentation.

@Tomsgu
Copy link

Tomsgu commented Jan 10, 2018

I think it's still in progress. See this PR #2707 from today.

@covex-nn
Copy link

@Tomsgu problem with session was solved with symfony/recipes#333, problem with templating and mailer will be solved with my PR from today. After there will be a problem with db_driver parameter. After that we will wait for stable 2.1.0 release. And only after release, may be next month, my be later, somebody will create a recipe =)

@Tomsgu
Copy link

Tomsgu commented Jan 10, 2018

@covex-nn thanks for clarifying it. I don't know why I thought that symfony/recipes-contrib#210 was created by you. That's why I thought that is in progress with your recent pull requests.

Anyway it's nice to hear that it's moving forward.

About the db_driver: Is an acceptable solution to make it optional and set fos_user.doctrine_registry according to what we have in container? Or is there any other better way e.g. in recipe itself (don't know what is really possible to do there)?

@covex-nn
Copy link

covex-nn commented Jan 10, 2018

@Tomsgu my solution is "use new default value for db_driver", a new "db_driver" will report about problems with configuration in runtime, without requirement for doctrine-bundle and etc.

See #2708

@Tomsgu
Copy link

Tomsgu commented Jan 10, 2018

@covex-nn I like your idea 👍 (with no hidden behavior). So than we should wait for PR revisions and the session/security fix.

Is there still something that can be done before a stable release?

@covex-nn
Copy link

covex-nn commented Jan 10, 2018

@Tomsgu we could create recipe right here! I've created a new branch in my FOSUserBundle fork and merged boths PRs into it. To start using it and test it you could complete the following steps:

  1. Execute composer create-project symfony/skeleton . inside empty directory

  2. Create file config/packages/fos_user.yaml with the following content:

    fos_user:
        firewall_name: main
        user_class: App\Entity\User
        from_email:
            address: "%env(MAILER_FROM_ADDRESS)%"
            sender_name: "%env(MAILER_FROM_NAME)%"
        registration:
            confirmation:
                enabled: false
        resetting: false
        service:
            mailer: fos_user.mailer.twig_swift
  3. Create file config/routes/fos_user.yaml with the following content:

    fos_user:
        resource: "@FOSUserBundle/Resources/config/routing/all.xml"
  4. Add repositories section to composer.json

        "repositories": [
            { "type": "vcs", "url": "https://github.com/covex-nn/FOSUserBundle" }
        ],
  5. 
    
  6. Add "friendsofsymfony/user-bundle": "no-db-driver-dev as 2.1.2.1" to require section of composer.json

  7. Execute composer update

  8. Execute php -S 127.0.0.1:8000 -t public and visit http://127.0.0.1:8000/register/

At this point we have installed, but not configured FOSUserBundle with "strange" behavior. We should help end-user to configure db_driver, security and (?) with post-install.txt, links, manifest.json, etc. But here my imagination ends, and even google translate cannot help me with it =)

@covex-nn
Copy link

covex-nn commented Jan 10, 2018

We could even create an instruction on a page http://127.0.0.1:8000/register/ with RuntimeException !

This how it looks now:

    public function getClass()
    {
        throw new \RuntimeException('The child node "db_driver" at path "fos_user" must be configured.');
    }

This how it could be:

    protected function throwExceptionWithInstructionBelow()
    {
        throw new \RuntimeException('The child node "db_driver" at path "fos_user" must be configured.');
        // to configure ...
        // second line
        // line 3
        // line 4
        // last line; we have five lines for instructions

@covex-nn
Copy link

Also we cound discuss new recipe here in comments and depelop recipe itself in symfony/recipes-contrib fork in https://github.com/covex-nn/recipes-contrib/tree/fosub/friendsofsymfony/user-bundle/2.1 (it is just an experiment, described in symfony/recipes#299):

Use this commands to install application with FOSUserBundle:

git clone git@github.com:covex-nn/recipes-contrib.git .
git checkout fosub
cd friendsofsymfony/user-bundle/2.1
composer install
rm -rf .git
git checkout .gitignore
php -S 127.0.0.1:8000 -t public

Then visit http://127.0.0.1:8000/register/

@Tomsgu
Copy link

Tomsgu commented Jan 11, 2018

The steps from #2704 (comment) works well with the forked version.

About the security and db_driver, I don't think we should put more things to the exception. We can make fos_user_security.yaml.dist file or leave it as it is and put instructions to the post-install.txt.

To make a recipe we should probably still wait since there is no stable release. Neither your changes were merged. @XWB is there still anything with we can help before a new release?

@maxhelias
Copy link

What is the status of this issue ?
I do not know this package well but if you need help, with an explanation I could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants