Categories
Server

Hackers came along…

There I was, minding my own business… Coding… drinking coffee… and you know… working 🙂 Then some hackers came along and ruined all the fun. Digitalocean were fast to take action and closed all the eth-interfaces on the server and contacted me. Fortunately it’s a redundant setup, so closing down one server didn’t cause any issues for […]

Continue reading

Categories
php

Using a Zend view helper inside a partial

When rendering a page using one or more partials, I often need to call a helper to do some extra stuff for me. One caveat I found was, that the view variables was not available in my helper. After some research it seems that the partial acts as the new view.So in order to access […]

Continue reading

Categories
MySQL Server

Problems connecting to unix:///var/mysql/mysql.sock

In a previous post I talked about MySQL 5.5 and Mac OSX. In this post I’ll go through fixing the problems with PHP and connecting to your local mysql install, using “localhost”. The problems began a while back, with lots of errors in my apache error log saying: [error] [client ::1] PHP Warning: mysql_connect(): [2002] No such […]

Continue reading

Categories
Ruby On Rails

Using rails and respond_to to include nested data

I want to display data from a nested table in my XML output using respond_to. I searched google a bit and it seems :include was the way to go. However I had some problems getting this to work properly. I have two models (customer and user) that are linked together. When I fetch the data for a […]

Continue reading

Categories
php Server

Handle different environments with PHP

Being both a Rails and PHP developer, I’m often lacking a few things when I’m switching from Rails to PHP. One of the things I miss the most, is the different environments that Rails has, which makes testing, developing, staging and production environments easy.However, I found a way to do this in PHP as well, […]

Continue reading