Skip to content

Commit

Permalink
add docs for non flex installation
Browse files Browse the repository at this point in the history
  • Loading branch information
kunicmarko20 committed Jan 26, 2018
1 parent a374dcf commit 271cf38
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions docs/reference/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,37 @@ are not already enabled:
Sonata\UserBundle\SonataUserBundle::class => ['all' => true],
];
.. note::
If you are not using Symfony Flex, you should enable bundles in your
``AppKernel.php``.

.. code-block:: php
<?php
// app/AppKernel.php
public function registerbundles()
{
return array(
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
// ...
new FOS\UserBundle\FOSUserBundle(),
new Sonata\UserBundle\SonataUserBundle(),
// ...
);
}
Configuration
-------------

.. note::
If you are not using Symfony Flex, all configuration in this section should
be added to ``app/config/config.yml``.

ACL Configuration
~~~~~~~~~~~~~~~~~
When using ACL, the ``UserBundle`` can prevent `normal` users to change
Expand Down Expand Up @@ -171,8 +199,15 @@ Add the related security routing information:
resource: '@SonataUserBundle/Resources/config/routing/admin_resetting.xml'
prefix: /admin/resetting
.. note::
If you are not using Symfony Flex, routes should be added to ``app/config/routing.yml``.

Then, add a new custom firewall handlers for the admin:

.. note::
If you are not using Symfony Flex, rest of this configuration should be
added to ``app/config/security.yml``.

.. code-block:: yaml
# config/packages/security.yaml
Expand Down Expand Up @@ -274,6 +309,9 @@ to generate the correct entities for the media:
bin/console sonata:easy-extends:generate SonataUserBundle --dest=src --namespace_prefix=App
.. note::
If you are not using Symfony Flex, use command without ``--namespace_prefix=App``.

With provided parameters, the files are generated in ``src/Application/SonataUserBundle``.

.. note::
Expand All @@ -284,6 +322,9 @@ With provided parameters, the files are generated in ``src/Application/SonataUse
point to a global namespace. For instance the user will be
``App\Application\Sonata\UserBundle\Entity\User``.

.. note::
If you are not using Symfony Flex, the namespace will be ``Application\Sonata\UserBundle\Entity\User``.

Now, add the new ``Application`` Bundle into the ``bundles.php``:

.. code-block:: php
Expand All @@ -297,9 +338,32 @@ Now, add the new ``Application`` Bundle into the ``bundles.php``:
App\Application\Sonata\UserBundle\ApplicationSonataUserBundle::class => ['all' => true],
];
.. note::
If you are not using Symfony Flex, add the new ``Application`` Bundle into your
``AppKernel.php``.

.. code-block:: php
<?php
// app/AppKernel.php
public function registerbundles()
{
return array(
// ...
new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
// ...
);
}
If you are not using auto-mapping in doctrine you will have to add it there
too:

.. note::
If you are not using Symfony Flex, next configuration should be added
to ``app/config/config.yml``.

.. code-block:: yaml
# config/packages/doctrine.yaml
Expand All @@ -316,6 +380,10 @@ too:
And configure FOSUserBundle and SonataUserBundle to use the newly generated
User and Group classes:

.. note::
If you are not using Symfony Flex, add classes without the ``App\``
part.

.. code-block:: php
# config/packages/fos_user.yaml
Expand Down

0 comments on commit 271cf38

Please sign in to comment.