openHAB Raspberry Pi Arduino XBee Led Zeppelin Music Machine

Martin Zeller Arduino, openHAB, Raspberry Pi 1 Comment

For many years my daughter called me in the evening in her room: „Daddy, please play the barrel organ!“ I usually asked: „How fast?“ And she replied: „Full speed!“ Okay. After about ten years – my hands have become old and tired – I knew that I need a machine. I spoke to my daughter and we began to make plans. After hours of …

php preg_replace problem with large files/strings – fails silently

Martin Zeller php 0 Comments

If you have a problem with preg_replace or other PCRE functions in php, because they fail  silently, without error message or other feedback, especially with large strings, then have a look at this php.ini setting: pcre.backtrack_limit For example, modify the value in your php script: Just increase the default value of 1.000.000. Maybe you have to increase the value for memory_limit …

zf2 – translatePlural example with Poedit

Martin Zeller php, zf2 1 Comment

I’d like to explain how to use the translatePlural method along with the Zend Framework 2. (I’m assuming that you have been configured Poedit and the Zend Framework so that it works with the normal translate method) The use of translatePlural is actually quite simple. Let us first look at the normal translate method: After parsing your code files with …

Subdomain based mobile versions in zf2 projects

Martin Zeller php, zf2 0 Comments

A few weeks ago it was my job to extend an existing Zend Framework 2 project with a mobile version. The orderer wanted when calling mobile.example.com/path1 a for mobile clients optimized version of www.example.com/path1 should be delivered. Some mobile versions of pages should have only a changed layout, while others should provide additional content. These requirements (for requests with the …