O'Reilly logo

Symfony2 Essentials by Wojciech Bancer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Command-line Operations

While developing a web application, we often have a requirement to process a large amount of data or to create some kind of repeatable automated job.

Symfony2 comes with a component, called the console component, to help us with such tasks. This component, just like Twig or Forms, can be installed as a standalone PHP library, and it is available in Symfony2 out of the box.

In fact, we have been using this component since the beginning—the Symfony2 app/console command is just a set of console component classes.

In this chapter, we will cover the following topics:

  • Adding our own command to the Symfony2 console
  • How to send e-mails with the swiftmailer component
  • How to write custom logs

Creating the console command

To create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required