I installed the YooTheme master template (yoo-master2) and activated it directly. The only thing I got was a blank page. I had to remove the template folder to get the default template back again and started debugging.

The following error was thrown:

PHP Fatal error: Class 'DOMDocument' not found in /var/www/mysite/current/public/wp-content/themes/mytheme/warp/src/Warp/Dom/Document.php on line 15, referer: http://www.mysite.nl/wp-admin/update.php?action=upload-theme

The problem was that PHP’s xml library was not installed on my VPS. To install it I had to run:

Lately I was struggling with the environment detection in Laravel 4.1. I am using one VPS for my staging and production environment. So environment detection based on the hostname won’t work for my situation because they are the same. URL detection has been removed in 4.1 due to security issues.

I found a blog post which almost suits my needs. The problem with this approach was that every time I do a deployment (via Rocketeer) I had to create a new environment.php to specify which environment it should use.

Rocketeer pulls a Github repository into a releases folders and creates a symlink from the ‘current’ directory to the right release. Rocketeer has also a ‘shared’ section which will remain (logs / sessions / settings (PhilF)) on deployment. So that would be a nice location for the environment.php

app/storage/settings/environment.php

<?php
return 'staging'; //or 'production'

So what you should do is to change the detectEnvironment (bootstrap/start.php) file like this:

Note 1: Make sure bindInstallPaths is called before detectEnvironment.

Note 2: I am using ‘include’ instead of ‘required’, because the environment.php is optional. Required will stop the application. When the file is not found it will default to the ‘local’ configuration (for development).

Additional info:
The app/storage/settings directory is a symlink to /var/www/mysite/staging/shared/app/storage/settings

Currently I am building an application where we can fill in live scores and I needed something to update all my visitors whenever a score has been updated by one of the admins.

Whenever an admin updates the score via the Laravel 4 backend I fire an event and publish it to Redis. I’ve setup a simple NodeJS server which listens to Redis for incoming changes. NodeJS will redirect the message to all Socket.IO clients.

A couple of days ago I was setting up VSFTP on my CentOS 6.4 installation. I followed a tutorial and was able to connect to my server via FTP but however I did not see any contents. No error, nothing. My FTP users are bound to their home dir.

Did some searching on the internet and a lot of people turned off Selinux which causes the issue! Not a ‘real’ solution IMHO. To fix this first run the following command:

getsebool -a|grep ftp

Now check the values: ‘ftp_home_dir’ and ‘allow_ftpd_full_access’. Those should be set to ‘on’.

I want to store all dates in UTC format into the database. To use HTML5 datetime-local element you have to do some conversion of datetimes. The HTML5 element expects a format of ‘2013-08-14T18:55’ (Y-m-d*H:i). In this post I’ll show you how I solved this.

The best way to redirect a user who is not logged in is to use the ‘Redirect::guest(..)’ method. This method will store the intended url in the session of the user. After logging in he can be be redirected back to the intended url via ‘Redirect:intended(..)’.

When you are using the CButtonColumn or TbButtonColumn and you want to hide a particular link you have to set the template attribute. You can also use this approach to change the order of the icons. See example below:

This page describes how to do page mounting in Wicket in an OSGi environment. A resource/page/etc. can be registered to Wicket’s WebApplication via a couple of ‘mount’ methods. This example only shows how to mount a page (to keep it simple) but can be extended for IRequestMapper/resource/package as well.

CKEditor was working properly in Internet Explorer while developing our Wicket application. After deployment to our demo server it wasn’t working anymore. We had no issues with FireFox/Chrome or Safari. First we thought it had to do with some timing issues but after a lot of debugging we found out the issue (and of course the solution 😉 ).