Sometimes it is necessary to compare a generated PDF file with a given one in PHP. Just to check with one PHPUnit test that your PDF generation works the expected way. But pretty often generated PDF files are identical, but there content isn't the same. For example if you use FPDF the following assertion can fail if the files have different meta data.

$pdfContent1 = file_get_contents('path_to_pdf1');
$pdfContent2 = file_get_contents('path_to_pdf2');
$this->assertSame($pdfContent1, $pdfContent2);

Continue reading

Magento2 has reduced the use of events. I guess the Magento plug-ins are more powerful. Today I would like to show, how to create a list of all dispatched events after visiting the product page for example. I have written a similar post a few years ago for older Magento versions.

Continue reading

Lesti_Fpc is internal full page cache for Magento. This Cache needs no varnish or any other extenal software and works with events. It is an internal cache and so it replaces dynamic blocks before sending response to customer. Here is little post that explains the workflow of Lesti_Fpc.

Continue reading

When developing with Magento2 you have maybe come to the question were is my logger for example. This was the way in Magento before.

Mage::log('Some log message', null, 'file.log');

Maybe you have already found the logger here for example in the class Magento\Backup\Controller\Adminhtml\Index\Rollback.

$this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage());

Today I don't want to show you the logger. More interesting for me are the shared instances inside of the Objectmanager that you can use with the fucntion get.

Continue reading

If you have started developing a Magento2 shop with Composer you should have noticed that you will need some authentication keys. Alan Kent is explaining in his post Magento 2 and Composer Authentication why Magento thinks this is necessary. It doesn't make much sense to me why it is necessary also to store the open source extensions and modules in a protected repository, but I guess Magento is a control freak.

This protection is really a problem for maintaining open source extensions with Composer in a public continous integration. Today I would like to show how to use Travis CI for open source extensions with the password protected repository repo.magento.com from Magento2.

Continue reading

I use a small Docker image for the development with Magento2. But unfortunately I got a 503 error after every start of the container.

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

The problem was really homemade. My setup script tries to install Magento on every start of the container. But that leads me to the point to take a small look at the maintenance mode of Magento2.

Continue reading

Finally I'm at the end. These are the tings I have done before I now can start installing ownCloud on my Raspberry Pi.

  1. Change default users on Raspberry Pi
  2. Mount ext4 USB flash drive to Raspberry Pi
The current version of ownCloud is 8.2.2 and this version would be better, cause it has full PHP7 support. But I will now install 8.1, cause there are some problems with 8.2.2 and the calendar app does not support PHP7 at the moment. But ownCloud 9 will come soon in 2016. The last time I have installed ownCloud is a while ago and so I will start with Manual Installation on Linux.

Continue reading

The artist Lesti (not me) will give his first exhibition with the title Wer-nie-sah, der kann doch fühlen in Berlin Neukölln.

Anticlimacus - Lesti

Continue reading

One more common tool that is fun to write and that I use pretty offen. A tool that converts timestamp to date.

Continue reading

This is just a shameless translation of the german post Raspberry Pi: USB-Stick und USB-Festplatte einbinden from Jan Karres. Jan is also mounting ntfs and fat drives, but I just need ext4 so we will skip his first step. I have also changed some small other things.

Continue reading