Dive in to Symfony2 console

let’s take a look at the Symfony console script. We used it before to fire up the development server, but it offers more. Execute the following:

$ php app/console

You will see a list of supported commands. Each command has a short description. Each of the standard commands come with help, so I will not be describing each of them here, but it is worth to mention a few commonly used ones:

Command Description
app/console: cache:clear Symfonys in production uses a lot of caching. Therefore, if you need to change values within a template (Twig) or within configuration files while in production mode, you will need to clear the cache. Cache is also one of the reasons why it’s worth to work in the development mode.
app/console container:debug Displays all configured public services
app/console router:debug Displays all routing configuration along with method, scheme, host, and path.
app/console security:check Checks your composer and packages version against known security vulnerabilities. You should run this command regularly.

You can, of course, write your own Symfony2 commands and we will do this later

About the author

Deven Rathore

I'm Deven Rathore, a multidisciplinary & self-taught designer with 3 years of experience. I'm passionate about technology, music, coffee, traveling and everything visually stimulating. Constantly learning and experiencing new things.

Pin It on Pinterest

Shares