Author Archives: Salminen

What interactive console commands never do

If you’ve ever used an interactive console task and screwed up some of the settings, the following kind of exchange should look familiar to you: [niko@localhost:~]$ animal-generator Welcome to the interactive stuff generator! Please give a latin name for an … Continue reading

Posted in Ideas, Usability | Leave a comment

Writing PHP the European way

I read about a rather brilliant PHP function today, one called __halt_compiler(). By brilliant I of course mean capable of causing all kinds of havoc. What it does is cause the PHP compiler to ignore everything after the function call, … Continue reading

Posted in Uncategorized | Leave a comment

CRUD with entities from multiple namespaces in Symfony 2 and Doctrine

Using the CRUD generator in Symfony 2 is a breeze, as long as your entities are all in the same database and namespace. In one of my current projects we do not, and ran into problems. We finally got it … Continue reading

Posted in PHP, Troubleshooting | Tagged , , , | 5 Comments

SVN repository relocation woes

After moving an SVN repository to another server, a strange problem surfaced when trying to relocate one of the servers. [root@whatever wwwroot]# svn sw –relocate svn: PROPFIND request failed on ‘/repos/importantproject’ svn: PROPFIND of ‘/repos/importantproject’: 301 Moved Permanently … Continue reading

Posted in Troubleshooting, Version control | Leave a comment

Fetch random rows faster with recycled IDs

Say you need to quickly fetch a random row from a database table. What’s your approach? If you answered: SELECT * FROM tablename ORDER BY rand() LIMIT 1 …you’re probably in the majority, and in many cases right. However, the … Continue reading

Posted in Ideas, Optimization, SQL | Leave a comment