<commit_before>BasicFormsTutorial
==================

Step-by-step tutorial for building basic forms in Symfony 2.1.x<commit_msg>Added installation steps to documentation<commit_after>BasicFormsTutorial
==================

Step-by-step tutorial for building basic forms in Symfony 2.1.x. The level required is beginner

This tutorial starts with a raw Symfony 2.1.3 project and a few Enitites created to be used during the guide.
On each step we are going to extend our forms system adding a new feature to create a fully functional project with
complex forms including collections, several widgets, data transformers, validation ...

Each feature will be included in a new branch and includes the former ones. So the branches will be named according to
*step-feature*

But, first of all, here are the steps to install the project:

## Installation

1. First download the repository code to your local:

``` bash
    cd /path/to/workspace
    git clone <EMAIL>:nass600/BasicFormsTutorial.git
```

2. Create the vhost file in `/etc/apache2/sites-available` directory. We will name it `basic-forms-tutorial`:

``` xml
    <VirtualHost *:80>
        DocumentRoot "/path/to/workspace/basic-forms-tutorial/web"
        ServerName basic-forms-tutorial.localhost
        DirectoryIndex app.php

        <Directory "/path/to/workspace/basic-forms-tutorial/web">
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
```

3. Enable the new site in Apache:

``` bash
    sudo a2ensite basic-forms-tutorial
```

4. Add the ServerName to /etc/hosts file to be accesible via browser:

    127.0.0.1	basic-forms-tutorial.localhost

5. Restart Apache:

``` bash
    sudo service apache2 restart
```

5. Run composer to install symfony in your project:

``` bash
    cd /path/to/workspace/basic-forms-tutorial
    composer install
```

6. Give permissions to your user and Apache to clean the cache and logs directories:

``` bash
    sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
    sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
```

7. Now you should be able to see the welcome page of Symfony2 in the browser on this direction:

    http://basic-forms-tutorial.localhost/app_dev.php


{'fraction_non_alphanumeric': 0.09469214437367304, 'fraction_numerical': 0.012738853503184714, 'mean_word_length': 3.379182156133829, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '693970', 'n_tokens_mistral': 724, 'n_tokens_neox': 668, 'n_words': 269}