diff --git a/README.md b/README.md index 65661d51d4..b0bd420ff9 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,20 @@ Documentation is available at [docs.sylius.org](http://docs.sylius.org). Quick Installation ------------------ -``` bash +```bash $ wget http://getcomposer.org/composer.phar $ php composer.phar create-project sylius/sylius -s dev $ cd sylius $ php app/console sylius:install ``` +To be able to use included fixtures, that make testing and development phases much easier, you may need +to run Composer tool with `--dev` option: + +```bash +$ php composer.phar install --dev +``` + [Behat](http://behat.org) scenarios ----------------------------------- @@ -38,12 +45,12 @@ $ vi behat.yml Then download [Selenium Server](http://seleniumhq.org/download/), and run it. ```bash -$ java -jar selenium-server-standalone-2.11.0.jar +$ java -jar selenium-server-standalone-2.39.0.jar ``` You can run Behat using the following command. -``` bash +```bash $ bin/behat ``` @@ -52,10 +59,10 @@ Troubleshooting If something goes wrong, errors & exceptions are logged at the application level. -```` -tail -f app/logs/prod.log -tail -f app/logs/dev.log -```` +```bash +$ tail -f app/logs/prod.log +$ tail -f app/logs/dev.log +``` Contributing ------------ diff --git a/app/AppKernel.php b/app/AppKernel.php index b32cd5a776..4d759890a3 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -52,7 +52,6 @@ class AppKernel extends Kernel // Core bundles. new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), - new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), @@ -76,10 +75,12 @@ class AppKernel extends Kernel new Payum\Bundle\PayumBundle\PayumBundle(), ); - if (in_array($this->environment, array('dev'))) { - $bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); + if ('dev' === $this->environment) { + $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); } + $bundles = $this->addFixturesBundle($bundles); + return $bundles; } @@ -141,10 +142,25 @@ class AppKernel extends Kernel } /** - * @return bool + * @return boolean */ private function isVagrantEnvironment() { return (getenv('HOME') === '/home/vagrant' || getenv('VAGRANT') === 'VAGRANT') && is_dir('/dev/shm'); } + + /** + * @param array $bundles + * @param array $environments + * + * @return array + */ + private function addFixturesBundle(array $bundles, array $environments = array('dev', 'test')) + { + if (in_array($this->environment, $environments) && class_exists('Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle')) { + $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); + } + + return $bundles; + } }