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

Orchestrating the build process


To automate the build process, we are going to use Apache Ant. Ant looks for a build.xml file in the root of the Symfony project, parses the contents, and based on what it finds, starts to run the PHP tools that we installed earlier.

So, in the root of your project, create the build.xml file with the following content (you can grab this file from the project's GitHub repository, https://github.com/Soolan/mava-project):

<?xml version="1.0" encoding="UTF-8"?>

<project name="Mava" default="build">
  <property name="workspace" value="${basedir}" />
  <property name="sourcedir" value="${basedir}/src" />
  <property name="builddir" value="${workspace}/app/build" />

  <target name="build"
    depends="prepare,vendors,parameters,lint,phploc,pdepend,phpcpd,phpmd-ci,phpcs-ci,phpdoc,phpunit,phpcb"/>

  <target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit,phpcb"/>

  <target name="tools-parallel" description...