Skip to content

Test blog application on Symfony 2, Doctring ODM and MongoDB

License

Notifications You must be signed in to change notification settings

ignat-s/symfony_blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony Blog

This blog made as example of simple application based on Symfony 2, Doctring ODM and MongoDB.

Installation

Step 1: Install MongoDB and corresponding PHP extension

If you still don't have MongoDB installed it's time to get it. Follow this installation guide. You also have to enabled PHP extension for MongoDB. You can use this installation guide.

Step 2: Set configuration

Create file app/config/parameters.yml. You can copy it from app/config/parameters.yml.dist. Make sure that mongodb_server and mongodb_database database_paths are correct.

Also change secret parameter with other unique value.

Step 2: Get composer

Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

To install it globally on linux use these commands:

$ curl -s https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Step 3: Install vendors

Go to project root directory and run following command:

composer install

Configuring web server

For Apache virtual host configuration might look like that:

```
<VirtualHost *:80>
    DocumentRoot "/var/www/symfony_blog/web/" # in your environment path might differs
    ServerAdmin admin@localhost
    ServerName symfony-blog.local # in your environment server name might differs

    <Directory "/var/www/symfony_blog/web/"> # in your environment path might differs
        Options FollowSymLinks
        Options all
        AllowOverride All
    </Directory>
</VirtualHost>
```

Open URL http://symfony-blog.local/app_dev.php/ (your URL might be different). You should see blog start page.

Running tests

You need installed PHPUnit.

Create app/phpunit.xml file from app/phpunit.xml.dist. You can run all tests using command.

```
phpunit -c app/phpunit.xml
```

Enjoy!

About

Test blog application on Symfony 2, Doctring ODM and MongoDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages