Running Symfony on Heroku

If you’re a PHP-only developer, odds are that you’ve never heard of Heroku. It’s one of the popular SAAS providers out there, but was targeting Ruby applications in the beginning. Nowadays they support almost everything with help of so-called buildpacks. They currently don’t have an official PHP buildpack (yet), but thanks to Christoph Hochstrasser you can deploy your PHP applications to Heroku.

Keep reading

Install the INTL PHP extension in MAMP

As a Symfony developer you run into translations sooner or later. This is a very powerful component of the framework. But requires some additional configuration of your MAMP environment before you can start using it. I’ll explain to you in short how.

Keep reading

Mock Guzzle responses in Symfony tests

Most of the web applications out there have at least one integration with an external service. Like with Twitter for pulling in tweets for example. On the other hand, most of the web applications have (or should have) functional testing setup to be less error prone when deploying new releases. You want these tests to be executed as quick as possible and test every possible scenario that could happen with your external service integration.

Keep reading

Using Drush in a MAMP environment

Drush is a very powerful instrument in the toolbox of a Drupal developer. But it can give you a little headache when trying to install in your local MAMP setup. Also because I had forgotten how to do it within my fresh installation of MAMP Pro, a quick and relatively simple tutorial on how to install Drush.

Keep reading

From A till Z in PHP

Today I discovered a very handy piece of code I wasn’t aware of till now. With this code, it’s very easy to get an array filled with all characters in the alphabet.

range('a', 'z');

Upgrade MAMP's phpMyAdmin

My current MAMP version ships with phpMyAdmin version But there is already a higher version available, version Upgrading the shipped phpMyAdmin to the latest version appears to be very easy. Just downloading and extracting it to the correct folder.

At first, download the latest available version from phpMyAdmin’s download page. If you have MAMP, extract the files to the following directory (backup the old files first just in case): /Applications/MAMP/bin/phpMyAdmin. If you restart MAMP and go to http://localhost/phpMyAdmin, you’ll see that your phpMyAdmin interface is upgraded.

For everybody who has MAMP Pro, the correct location of your phpMyAdmin files is /Library/Application Support/appsolute/MAMP PRO/phpMyAdmin.

Add your own styles to Drupal's WYSIWYG module

For a better user experience on node crud actions, I’ve installed the WYSIWYG module with the CKEditor plugin. It adds the CKEditor interface as a filter for large textfields. And by default it loads in CKEditor’s predefined styles. Very nice for beginners, but what if you want to include your own theme styles? The WYSIWYG editor supports loading your stylesheets, but works a bit buggy on the latest version (2.1 on time of writing this) in combination with the CKEditor. Luckily I found a very quick fix for this issue.

Keep reading

Remove Drupal stylesheets with hook_css_alter

When you start developing themes, you’ll find out that there will be a lot of stylesheets loaded in by default. To remove those stylesheets from your own theme’s template.php, you have to overwrite hook_css_alter and remove the stylesheets from the array.

Keep reading