Book Image

Mastering Symfony

Book Image

Mastering Symfony

Overview of this book

In this book, you will learn some lesser known aspects of development with Symfony, and you will see how to use Symfony as a framework to create reliable and effective applications. You might have developed some impressive PHP libraries in other projects, but what is the point when your library is tied to one particular project? With Symfony, you can turn your code into a service and reuse it in other projects. This book starts with Symfony concepts such as bundles, routing, twig, doctrine, and more, taking you through the request/response life cycle. You will then proceed to set up development, test, and deployment environments in AWS. Then you will create reliable projects using Behat and Mink, and design business logic, cover authentication, and authorization steps in a security checking process. You will be walked through concepts such as DependencyInjection, service containers, and services, and go through steps to create customized commands for Symfony's console. Finally, the book covers performance optimization and the use of Varnish and Memcached in our project, and you are treated with the creation of database agnostic bundles and best practices.
Table of Contents (17 chapters)
Mastering Symfony
Credits
About the Author
About the Reviewers
Index

Installing PHP tools


We installed some plugins in our Jenkins, but to make these plugins work, we need to install some PHP tools on our EC2 instance. We can install these tools via Composer on our Symfony project, but this is not a good practice. They will sit in the vendor/ directory and make our Symfony project big and heavy.

Instead, we are going to install them in the CI server itself and benefit from them for every project we define in Jenkins:

  1. Assuming that the SSH connection to our EC2 instance is still live, open a terminal window and add the following PEAR channels to the system:

    $ sudo pear channel-discover pear.pdepend.org
    $ sudo pear channel-discover pear.phpmd.org
    
    $ sudo pear channel-discover pear.phpdoc.org
    
    $ sudo pear channel-discover pear.symfony-project.com
    
  2. Now install PHP tools as follows:

    $ sudo pear install pdepend/PHP_Depend 
    $ sudo pear install phpmd/PHP_PMD
    $ sudo pear install phpunit/phpcpd
    $ sudo pear install phpunit/phploc
    $ sudo pear install --alldeps phpunit/PHP_CodeBrowser...