Sylius/docs/bundles/SyliusVariationBundle/installation.rst
Krzysztof Lechowski 2b159967ad Docs - fixing dependencies in AppKernel
As sugested by patie here: https://github.com/Sylius/Sylius/issues/1595

 #1595 - Resource bundle missing state machine
 #3750 - Merge Translation & TranslationBundle into Resource
 #3778 - Merge Translation into Resource + some clean ups
 #4633 - dependency on a non-existent service
2016-09-05 00:50:42 +02:00

86 lines
2.5 KiB
ReStructuredText

Installation
============
We assume you're familiar with `Composer <http://packagist.org>`_, a dependency manager for PHP.
Use the following command to add the bundle to your `composer.json` and download the package.
If you have `Composer installed globally <http://getcomposer.org/doc/00-intro.md#globally>`_.
.. code-block:: bash
$ composer require sylius/variation-bundle
Otherwise you have to download .phar file.
.. code-block:: bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar require sylius/variation-bundle
Adding required bundles to the kernel
-------------------------------------
You need to enable the bundle inside the kernel.
If you're not using any other Sylius bundles, you will also need to add `SyliusResourceBundle` and its dependencies to kernel.
Don't worry, everything was automatically installed via Composer.
.. code-block:: php
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Sylius\Bundle\VariationBundle\SyliusVariationBundle(),
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
// Other bundles...
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
);
}
.. note::
Please register the bundle before *DoctrineBundle*. This is important as we use listeners which have to be processed first.
Container configuration
-----------------------
Put this configuration inside your ``app/config/config.yml``.
.. code-block:: yaml
sylius_variation:
driver: doctrine/orm # Configure the doctrine orm driver used in the documentation.
And configure doctrine extensions which are used by the bundle.
.. code-block:: yaml
stof_doctrine_extensions:
orm:
default:
timestampable: true
Updating database schema
------------------------
Run the following command.
.. code-block:: bash
$ php app/console doctrine:schema:update --force
.. warning::
This should be done only in **dev** environment! We recommend using Doctrine migrations, to safely update your schema.
Congratulations! The bundle is now installed and ready to use.