<commit_before>REST API server-side tutorial. How to do it easy with Symfony 2.8.

```
#!sh

git clone https://bitbucket.org/onekit/rest-tutorial.git

cd rest-tutorial
```

## Docker way ##
Download & Install: [https://docker.com](https://docker.com)  
Enter to project directory and run: ```docker-compose up -d```  
It will create and launch three containeres: PHP, Nginx and MySQL.  
If you prefer PostgreSQL, type ```docker-compose -f docker-compose-pgsql.yml up -d``` instead of previous command.  

## Manual ##

Get commands from https://getcomposer.org/download/
and execute:

```
#!sh

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```
It will put *composer.phar* file in your project directory.  

Then install dependencies:


```
#!sh

php composer.phar install
```


Answer on questions after downloading. It will configure connections to database and let choose own parameters.  


```
#!sh

php app/console doctrine:database:create
php app/console doctrine:schema:create
php app/console assets:install web --symlink
php app/console assetic:dump
php app/console doctrine:fixtures:load --no-interaction
```



If you launch it locally, then can test fast with internal http-server.

```
#!sh

php app/console server:run localhost:8080

```

### P.S.: ###
Docker installation on video: https://www.youtube.com/watch?v=a3IFkmxmzFk
Manual installation on video: https://www.youtube.com/watch?v=nz1qudAh5hk<commit_msg>README.md edited online with Bitbucket<commit_after>REST API server-side tutorial. How to do it easy with Symfony 2.8.

```
#!sh

git clone https://bitbucket.org/onekit/rest-tutorial.git

cd rest-tutorial
```

## Docker way ##
[Docker install video](https://www.youtube.com/watch?v=a3IFkmxmzFk).  
Download & Install: [https://docker.com](https://docker.com)  
Enter to project directory and run: ```docker-compose up -d```  
It will create and launch three containeres: PHP, Nginx and MySQL.  
If you prefer PostgreSQL, type ```docker-compose -f docker-compose-pgsql.yml up -d``` instead of previous command.  

## Manual ##
[Manual install video](https://www.youtube.com/watch?v=nz1qudAh5hk).  
Get commands from https://getcomposer.org/download/
and execute:

```
#!sh

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```
It will put *composer.phar* file in your project directory.  

Then install dependencies:


```
#!sh

php composer.phar install
```


Answer on questions after downloading. It will configure connections to database and let choose own parameters.  


```
#!sh

php app/console doctrine:database:create
php app/console doctrine:schema:create
php app/console assets:install web --symlink
php app/console assetic:dump
php app/console doctrine:fixtures:load --no-interaction
```



If you launch it locally, then can test fast with internal http-server.

```
#!sh

php app/console server:run localhost:8080

```
{'fraction_non_alphanumeric': 0.13266162888329136, 'fraction_numerical': 0.037503498460677305, 'mean_word_length': 4.830342577487765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '693691', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1204, 'n_words': 336}