Getting Started with Symfony (part 1)

I'm about to make a change in my career and go back into development.  To help me do that I've started a course on Udemy for getting up and running with Symfony 4.  I figured that if I was going to be working with frameworks, I might as well get used to them.

My choices came down to Symfony or Laravel to start with, simply because those are two of the biggest ones out there.  I know Laravel borrows a lot from Symfony, so I resolved to work with Symfony to reduce the overheads on the requests.

Here's what I found...

Not all namespaces in tutorials are relevant

Missing service, despite being in the tutorial, and no instructions to install it

The tutorial I was using wanted the code to use the BrowserKit Request class to allow use of the request variables ($_POST, $_GET, $_FILES etc.).  The class existed within the vendor folder, and PhpStorm said everything was fine.  Until it went to run.

Upon running, this would hit the autowire issue every time.  Frustrating seeing as it was the first page being generated by Symfony as part of the tutorial.  Not a great experience, but easily resolvable.  This simply needed:

use Symfony\Component\BrowserKit\Request;

Replacing with:

use Symfony\Component\HttpFoundation\Request;

Actually, that's not true.  I also needed to go into Vagrant and run

composer update

If that wasn't done, then every request would time out, and I'd be forever presented with:

Time outs when developing with Symfony on Windows

I've yet to find a way around that, but I'm looking into it alongside how to speed it up out of the box with the tutorial.  I can see a lot of hacking being required to get through the tutorial though.

Show Comments