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

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: /** * */ protected function assignNewThemeToSelectedStores() { $storeIdsForNewTheme = []; foreach ($this->storesCodesWithNewTheme as $storeCode) { $storeIdsForNewTheme[] = $this->storeRepository->get($storeCode)->getId(); } /** @var \Magento\Theme\Model\ResourceModel\Theme\Collection $themes */ $themes = $this->themeCollectionFactory->create()->loadRegisteredThemes(); /** * @var \Magento\Theme\Model\Theme $theme */ foreach ($themes as $theme) { if ($theme->getCode()…

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. curl -X GET –header “Accept: application/json” “http://<store-baseurl>/rest/default/V1/categories” If you omit the accept header…

Read More Read More

Think outside the box: Magento 2 as API framework

Think outside the box: Magento 2 as API framework

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 2 API documentation Why should I do this? Short answer: Because you can! Not really, there is no reason why you shouldn’t try it at least and have some fun with it – you might get used to it 😉 With Magento 2, the…

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

Review of the Magento Imagine 2017 from a personal point of view and a frontend perspective

Review of the Magento Imagine 2017 from a personal point of view and a frontend perspective

The Imagine: The Magento event as such! To me as an USA newbie on the one hand interesting because the conference takes place in Las Vegas, to me as a frontend developer on the other hand interesting because you can learn much about how Magento itself, but the community as well – like other developers, agencies and webshop operators – are working with the e-commerce platform and continuously developing it further. Let’s start at the beginning: Las Vegas is truly…

Read More Read More

My personal recap of Magento Imagine 2017 in Las Vegas

My personal recap of Magento Imagine 2017 in Las Vegas

It was the second time that I attended the Magento Imagine. Last year the conference was characterized by the motto „We are Magento“. This year the word „E-Commerce Platform“ stays in my mind. Before I start my summary of the conference, I would like to tell a little bit about our trip … We startet our #RoadToImagine from Frankfurt/Main. After a 9h flight we (Maria, Ralf, Alex and me) arrived in Houston (Texas). There we had time to grab some pizzas after a…

Read More Read More