Skip to content

thezendguy/php-symfony-populate-database

Repository files navigation

php-symfony-populate-database

A basic and lean recipe for loading the database with data in Symfony3.

This application will connect to the local mysql server, create a new database called symfony and a new table inside this called product.

Dependencies

git
php v5.5.9+
composer
MySQL

To install

$ mkdir -vp php-symfony-populate-database  
$ cd php-symfony-populate-database  
$ git clone https://github.com/benjaminvickers/php-symfony-populate-data.git .  
$ composer install

Enter the database connection details when prompted by composer. Otherwise you can edit the details in the app/config/parameters.yml file. Remember the database name should be set to symfony.

To setup

$ sudo service mysql start  
$ php bin/console doctrine:database:create  
$ php app/console doctrine:fixtures:load

To test in mysql

$ mysql -uroot -p  
$ use symfony;  
$ select * from product;

Resources

http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html

About

A basic and lean recipe for loading the database with data in Symfony3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published