Flexible architecture is the most notable feature of Symfony2 framework. It helps this PHP framework to stand out and allows developers to quickly create functional applications. This topic deserves a separate article so here we’re going to delve into some details of Symfony2 architecture.
I have been trying to write this Doctrine 2 ORM tutorial for a long time but just couldn’t get down to it. Finally, I pulled myself together and did it. So here I’m sharing some techniques for working with Doctrine2 ORM which will help to improve the site performance on Symfony2 (precisely any site that uses Doctrine2 ORM). I have created a project and put it on a GitHub as a visual guide so anyone can test my words in action now.
When working on my small home project on Symfony2, I needed to deploy it on staging for testing API from the outside. Sure, you need some hosting for this purpose: either have it already or buy it. Yet there is an alternative — the cloud services where you can host your site for free but with limited resources. There are a lot of such services now and they are competing with each other. Somehow I decided to try Heroku. I heard about it a long time ago and at that point it crossed my mind. I didn’t look on other services, this time I just wanted to try my luck with Heroku. Fortunately, Heroku still has a free web hosting option so I started to search all the information needed for Symfony2 application deployment.
PHP-framework Symfony2 has a very nice component ParamConverter, which allows to convert parameters from URL into PHP variables. When the functionality that comes out of box isn’t enough, you should extend it manually. In this post I’ll show how to write your custom Symfony2 ParamConverter.
Let's talk about writing a plug-in for the markItUp WYSIWYG editor. The task of the plug-in should be quick and easy loading of images to the server to be inserted into a text afterwards (in the form of img tag).
Capifony is a smart and convenient tool to deploy Symfony sites. It’s based on Capistrano and is written by Konstantin Kudryashov. Basic information on working with Capifony can be gleaned from the official site capifony.org and the short article "Deploy Your Symfony Application Painlessly with Capifony".
I advise you to start deploying symfony2 with capifony it on the server manually and make sure everything is configured and operating correctly (especially the script app / console). For example, I found some incorrect ways for the git sub modules and failed to deploy the site from the first turn.
Below the cut is a Capifony config to deploy this site and my comments to it.