Advanced Invoice Layout Extension
Über 1.000 Kunden nutzen diese Magento Extension für schönere PDF-Layouts von Rechnungen, Lieferscheinen und Gutschriften.
mehr erfahrenTime is money and therefore every developer should strive for an optimal setup in which he can operate the fastest. Since I began with Magento in 2008 a lot has changed tool-wise and I am constantly improving to find the optimum Magento local development setup.
Chris / / zuletzt aktualisiert amNow let's have a look at which software pieces do you need for fast and qualitative development of Magento Extensions:
As mentioned above Docker is a massive help in easily setting up a local Magento development environment and also switching between different PHP or Magento versions. Below you will find my perfect docker-compose.yml
that I use for each Magento project.
The setup has the following features:
Now let's have a look at the Docker Compose file:
version: "3.4"
services:
franken:
build: ./frankenphp
ports:
- "80:80"
- "443:443"
links:
- "mysql:mysql"
- "cache:cache"
- "mailhog:mailhog"
volumes:
- ../htdocs/:${WEBSERVER_DOCROOT}/htdocs
- ../src/:${WEBSERVER_DOCROOT}/src:delegated
- ../vendor/:${WEBSERVER_DOCROOT}/vendor
- ./magento/local.xml:${WEBSERVER_DOCROOT}/htdocs/app/etc/local.xml:ro
environment:
MAGE_IS_DEVELOPER_MODE: "1"
mysql:
image: mariadb:10.6
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MARIADB_AUTO_UPGRADE: 1
ports:
- "3306"
volumes:
- /var/lib/mysql
cache:
image: redis:latest
mailhog:
image: axllent/mailpit
ports:
- "1025:1025"
- "8025:8025"
At the moment I am exploring ddev for all of my development environments as it offers a very, very easy and quick setup - also across different operating systems. This saves yourself a lot of time dealing with Docker containers and comes with a lot of pre-build images out of the box.
If you have a Magento or OpenMage project all you have to do is ddev config
followed by a ddev start
to launch a fully working local development environment including Xdebug, Mailpit and many more features within minutes!
Next to ddev another indispensible tool is Magerun. As Magento 1 / OpenMage lacks a CLI tool this saves you a lot of clicking in the Magento backend and offers useful commands for e.g. for use cases like
In addition you can also easily add your own Magerun commands or use some of the community-provided ones.
In order to be able to call Magerun directly from your ddev host, we will create a custom ddev command for it.
Therefore all we have to do is create the file .ddev/commands/web/magerun
in our Magento project folder with the following content:
#!/bin/bash
## Description: Execute n98-magerun
## Usage: magerun
## Example: "ddev magerun"
php -d error_reporting="E_ALL ^E_DEPRECATED" /usr/local/bin/n98-magerun.phar "$@"
Then in order to make the Magerun phar file available in the Docker container, we have to create the file .ddev/web-build/Dockerfile
with this content:
RUN \
curl -sS -o n98-magerun.phar https://files.magerun.net/n98-magerun.phar && \
curl -sS -o n98-magerun.phar.sha256 https://files.magerun.net/sha256.php?file=n98-magerun.phar && \
shasum -a 256 -c n98-magerun.phar.sha256 && \
chmod +x n98-magerun.phar && \
mv n98-magerun.phar /usr/local/bin/n98-magerun.phar
And that's it! Then you can call all Magerun commands directly from the host simply by typing ddev magerun
.
Reaktionen auf "The ultimate Magento development environment"