Book Image

Symfony2 Essentials

Book Image

Symfony2 Essentials

Overview of this book

Table of Contents (17 chapters)
Symfony2 Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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