Run Mailhog in Docker and use it in PHP

Run Mailhog in Docker and use it in PHP

This post describes how you can install and configure Mailhog as SMTP Server for your local PHP development environment. This is useful to catch all outgoing emails. A running PHP and Docker environment is required to follow the instructions. Install Mailhog On my local machine, I have docker-compose.yml file which contains a lot of services (e.g MySQL, Elastic, Redis) which I use during the daily development. For our mailhog example we need only one service. Please create a docker-compose.yml with…

Read More Read More

Sequence of Magento 2 Install / Upgrade / Recurring scripts

Sequence of Magento 2 Install / Upgrade / Recurring scripts

Preamble In one of my last tasks I had to write an upgrade script in which an assignment of a newly created frontend theme to some of the stores should be implemented. The following code-part describes what I did here:

As I already had an InstallData Script in the module and it already has run on some dev machines and staging systems, I put the following code to the newly created UpgradeData script. The problem The code in the…

Read More Read More

PSR-7 Standard – Part 3 – Response

PSR-7 Standard – Part 3 – Response

This post is part of series: Part 1: Overview Part 2: Request and URI Part 3: Response Part 4: File Uploads Part 5: HTTP-Client Part 6: Server Request Part 7: Middleware Part 8: Usage in a Magento module In the last blog post we described the RequestInterface of PSR-7. Every application will process this request and returns a response to the calling client. The response is the part where a backend sends a result of an server operation back to the client. Let’s view…

Read More Read More

Get PDF files by Magento Webapi

Get PDF files by Magento Webapi

Magento 2 comes with a modern REST interface. One of the advantages of the REST interface is that it can handle multiple response types. A client can request data from the server with a list of acceptable response formats. Out of the box Magento 2 supports two types. It comes with JSON and XML support. You can test it with a simple call to your local store.

If you omit the accept header the server will return JSON as…

Read More Read More

Think outside the box (1/4): Magento 2 as API framework

Think outside the box (1/4): Magento 2 as API framework

As the title of this article may indicate, it’s the first article in a series of four. Each one of them will focus on one topic, that covers unusual approaches, that could be handled with Magento 2 – if you think outside the box. In this article, we will cover the web-API and how to use Magento 2 as a standalone API-framework. If the web-API is new to you, I recommend to read the development documentation of it first: Magento…

Read More Read More

PSR-7 Standard – Part 2 – Request and URI

PSR-7 Standard – Part 2 – Request and URI

This post is part of series: Part 1: Overview Part 2: Request and URI Part 3: Response Part 4: File Uploads Part 5: HTTP-Client Part 6: Server Request Part 7: Middleware Part 8: Usage in a Magento module In the last blog post we described the history of PSR-7. The standard contains only interfaces. Today we start with the first two interfaces. The RequestInterface and the UriInterface. What is a HTTP Request? To start we create a little server simulation script with this content:…

Read More Read More

Recap Meet Magento 2017 Germany

Recap Meet Magento 2017 Germany

After attending my 10th Meet Magento in Germany (yes I missed one) and coming back to work, I think it is time for a short recap. This years Meet Magento probably was the biggest one in terms of number of attendants (800, according to the organizers). The location was at it’s limits for that amount of people. Luckily the weather was sunny so people could get outside and get some space. The next years Meet Magento will probably / hopefully…

Read More Read More