Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.63 KB

README.md

File metadata and controls

60 lines (41 loc) · 1.63 KB

Installation

composer install

Create .env file in the root directory, near .env.dist

In .env file modify DATABASE_URL so that symfony could connect to your database. Pick a database name, you do not need to have it created.

Run

php bin/console doctrine:database:create

this will create database.

Create table:

php bin/console doctrine:migrations:migrate (choose yes answer).

Configure web server, example for apache:

<VirtualHost *:80>   
    DocumentRoot "E:/projektai/php projektai/htdocs/mokomieji/symfony_4_persons_demo/public"
    ServerName symfony-4-demo.com
	
   <Directory "E:/projektai/php projektai/htdocs/mokomieji/symfony_4_persons_demo/public">
        AllowOverride All
        Order Allow,Deny
        Allow from All

        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ index.php [QSA,L]
        </IfModule>
    </Directory>
</VirtualHost>

More web server configuration examples here: http://symfony.com/doc/current/setup/web_server_configuration.html

Login

To view list and details about person, you need to be logged in as admin. Use these hardcoded credentials: admin/kitten

(Password in plaintext is stored in security.yml, in real application it should be hashed).

Running tests:

vendor\bin\phpunit tests

What could be improved

  • UploadedFile should not be mocked if following rule "Don't mock what you do not own". That needs to refactor code. But the problem is that symfony form sets the UploadedFile object on person, and we do not influence symfony form. Or we should not use it?