Browsed by
Category: General

Request data through a proxy with GuzzleHttp – PSR-7 compliant

Request data through a proxy with GuzzleHttp – PSR-7 compliant

When a Magento shop – or any other PHP application – is required to request data from or transmit data to a remote server, it is often necessary to redirect the traffic through a Http-proxy server. In my case this was essential because the called endpoint allows only certain IP addresses to access the requested ressource. Since I am working from various locations, each having a different IP address, I had to find a way that certain Http-requests are routed…

Read More Read More

A visit at our friends of Atwix in Lviv/Ukraine

A visit at our friends of Atwix in Lviv/Ukraine

Last month we received an invitation by our friends of Atwix to attend their Barcamp in Lviv/Ukraine. My colleague Oleksandr and me were happy to join it. Oleksandr was the perfect mate, because he was grown up in Ukraine and so he knows everything about the traditions and local specialities. Our journey started in Frankfurt. After a stopover in Munich we arrived on site with enough energy to explore the beautiful city of Lviv. Oleksandr introduced me to the local…

Read More Read More

How to avoid security issues in Composer dependencies

How to avoid security issues in Composer dependencies

Composer is a great tool for requiring third party modules and software packages for your project. It’s an essential part of the current Magento 2 project structure. Because of the possibility to add more and more modules it is also getting more and more difficult to keep track of relevant security updates. That is especially the case when required modules have further requirements. Here are 3 tips how to improve your project’s security 1. Subscription of third party repositories (when…

Read More Read More

PSR-7 Standard – Part 6 – Server Requests

PSR-7 Standard – Part 6 – Server Requests

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 Part 3 we already discovered the RequestInterface which is used on client side. In this part, we have a more detailed look on the server side. The Server Request inherits all methods of the RequestInterface and has 13 additional methods. Six methods are available to…

Read More Read More

PSR-7 Standard – Part 5 – HTTP Client

PSR-7 Standard – Part 5 – HTTP Client

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 The fifth part of the PSR-7 series describes the HTTP Client. The HTTP client is tool which sends a request to a server and returns the response. Sadly PSR-7 does not contain an interface for the HTTP client. The Standard contains only the HTTP messages. The…

Read More Read More

Chrome 63 vs. dev domains

Chrome 63 vs. dev domains

With the recent update to version 63 for Chrome they introduced a feature, that redirects all *.dev  calls from HTTP to HTTPS. If you are using *.dev  domains to access your development machine, this behaviour is probably not what you want for all your local urls. Configuring dnsmasq At netz98 we are using dnsmasq to redirect all *.dev  calls to our localhost. dnsmasq has a setting where you can easily change this to another domain like *.localhost . First of locate…

Read More Read More

PSR-7 Standard – Part 4 – File Uploads

PSR-7 Standard – Part 4 – File Uploads

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 After we learned what a Request and a Response are, let’s now look how we can send files to the server. Then have a look on how we can process them with Guzzle on the server side. Client Side Script As you can see in the…

Read More Read More

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

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

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