This task can be little bit scary at first, but it is really, really simple to do…
Disclaimer: This is more of a reminder for me then what you might call “tutorial”…
- Download latest version of EasyPHP, install it and then start it.
- In order to add php to your path follow these steps.
- Download latest version of Symfony 2.
- Open administration page of EasyPHP.
- Extract Symfony 2 zip(or tgz) file and place it somewhere. Then create alias in EasyPHP for that folder where you extracted Symfony 2 archive.
- If you open that alias now in your localhost and go to web/config.php you will see some warnings.
- You need to download php_apc.dll file and then copy it to %EasyPHP%/php/ext folder. Now right click on EasyPHP icon in taskbar and click on Configuration->PHP extension.
- Locate php_apc.dll and php_intl.dll and enable both of them. After that just restart EasyPHP.
- Open Apache folder inside %EasyPHP% and copy php.ini to C:/Windows
Now when you go to web/config.php you won’t see any warnings and you can easily follow instructions in The Book and you can even use all those commands to auto generate bundles and whatnot in those examples…
After you complete step #9 you can do these commands:
- Generate getters and setters for your entities:
php app/console doctrine:generate:entities Acme
- Create database based on your settings:
php app/console doctrine:database:create
- Create tables in your database based on your schema(if you want to drop already existing table before creating new one):
php app/console doctrine:schema:create (--dump-sql)
Use “Doctrine Fixtures extension and bundle” to generate dummy content fast:
- Add following lines to “deps” file located in your project root:
[doctrine-fixtures] git=http://github.com/doctrine/data-fixtures.git [DoctrineFixturesBundle] git=http://github.com/symfony/DoctrineFixturesBundle.git target=/bundles/Symfony/Bundle/DoctrineFixturesBundle
- Run this command to update your vendors:
php bin/vendors install
- Open “app/autoloader.php” and above this line:
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
Add this line:
'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
- Open “app/AppKernel.php and register new bundle:
new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
After this you need to create your data fixtures file. You can see here how to that.