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
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: [php] ini_set(‘pcre.backtrack_limit’, ‘100000000’); [/php] Just increase the default value of 1.000.000. Maybe you have to increase …
zf2 – translatePlural example with Poedit
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: [php] echo $this->translate(‘example.key’); [/php] After parsing …
Subdomain based mobile versions in zf2 projects
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 …