Why Symfony?

Choosing the best framework for rapid development has been a topic that has been debated to death. Today, there is no longer “the best framework” because all modern day framework is scalable and robust, they learn from each other. They are all adapting very fast to new techniques of doing things.

At the time of writing, nodejs and rails continue to innovate with php chasing fast behind. They have all very similar development methodology, so knowing one framework well means you can jump between other modern day frameworks easily.

For php, its Laravel and Symfony. if you want to invest your time, I recommend symfony because it is more stable when compared to the rest. Symfony components have been used by many projects including Drupal and Laravel.

as for Django and Rails, I am leaning more towards rails.

Symfony 2 is a mature framework. A mature framework means information and libraries don’t get outdated quickly. Some framework moves so fast that the 3rd party libraries couldn’t catch up. Rails early days suffered from this. Nothing worked out of the box because googled information was often outdated. Choose a stable framework so that you don’t spend lots of time setting up the right environment and troubleshooting the libraries for example. You should be spending more productive time learning the software.

Symfony2: Installation

The official installation doc is http://symfony.com/doc/current/book/installation.html. As a best practice, don’t install symfony in MAC or Windows, install in Linux and use Linux for development because you will be using Linux for hosting. For consistency in development, develop in virtual machine. The spec of the virtual machine should be the same as the production server. … Continue reading

When is hardcoding good?

Hardcoding is always seen as a bad practice. It makes the code inflexible. For example, making the code aware of the environment itself is a good thing so that we can reuse the code and avoid code duplication. Here, we are trying to copy a file to a user directory. is better than If this … Continue reading

Important CPANEL logs

These cpanel logs are important when troubleshooting: apache: /usr/local/apache/logs/ exim, ssh and others: /var/log/ cpanel: /usr/local/cpanel/logs/

Speeding up vagrant virtualbox disk access

Virtualbox driver is very slow. You can google about this all over the internet. There are 2 ways to speed up vagrant disk access using nfs, one way is to use vagrant-bindfs plugin and another way is the traditional way to change permissions in vm. This method outlines the later. shutdown vagrant using “vagrant halt” … Continue reading

Disable postfix to send email to outside world

disabling postfix to send email to outside world is important especially in development environment. you don’t want client to receive emails when you are testing in the dev environment. Unless software is using external smtp server to send email, you can simply update postfix config (main.cf) relayhost = and restart postfix

Custom ajax call in woocommerce

sometimes you need to update database via ajax. wordpress has tools to make it easy. Well not that easy… here for example, we want to create a link that when clicked, automatically change the order status of a woocommerce order and insert some notes. In the template, Note that we have to use nonce to … Continue reading

Creating custom pages in woocommerce

what if you want to have a custom page in woocommerce? For example a page called abc under my-account best way is to use shortcodes. Create a new page under my-account, ie my-account/abc and put in the shortcode [abc_shortcode] then in functions.php now you need to create the abc.php file which can contain anything

Symfony: Quick way to change bundle name

You have generated a new bundle under src/Oldnamespace/oldbundle and decided to change the bundle name or move it to a new name space. Symfony doesn’t provide any tools to do that. Sounds like a tedious job… There is no short cut to this solution but some Bash scripting can save your lots of time. Use … Continue reading

Installing phpmyadmin in hhvm

when installing phpmyadmin under hhvm and nginx especially, you might get an error like so: “Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly” this is due to hhvm settings, got /etc/hhvm/php.ini and comment out all the php options like so: ; php options ;session.save_handler = … Continue reading