devenv provides a reproducible and declarative local development environment for our Shopware projects. It uses the Nix package system to provide native packages for all our required services. This environment is tightly tailored to the needs of our team members working on various projects with Shopware 6.
- Overrides Shopware's default mailer configuration to use MailHog
- Provides helper functions to clear caches
- Enables Xdebug without a performance impact when not using it
- Easily configurable PHP Version
- Inherits all default devenv features and services
- Pre-installed shopware-cli
A description about the setup and usage can be found in the Wiki.
Copy all files from the example folder into a project and enter it (assuming you have direnv installed). Run direnv allow
if it asks you to.
Make sure to run the following command to accelerate the startup process:
cachix use devenv ; cachix use fossar ; cachix use shopware
Add the following files to the project .gitignore file:
- .devenv*
- devenv.local.nix
Allows to define the used PHP Version. For supported versions see Different PHP versions
Example
sportalliance.phpVersion = "php80";
Define shopware systemconfig values.
Example
sportalliance.systemConfig = {
"foo.bar.testString" = "false";
};
Define additional php.ini settings which are used for php-fpm and php-cli.
Example
sportalliance.additionalPhpConfig = ''
memory_limit = 200M
'';
Define additional PHP extensions that are included in php-fpm and php-cli.
Example
sportalliance.additionalPhpExtensions = [
"mailparse"
];
Define additional server aliases that are added to caddy.
Example
sportalliance.additionalServerAlias = [
"example.com"
];
Define additional vhost configurations that are appended to the general vhost configuration.
Example
sportalliance.additionalVhostConfig = ''
tls internal
'';
Enables the RabbitMQ message broker and amqp PHP extension. Can be used for the Symfony message queue.
Example
sportalliance.enableRabbitMq = true;
Enables the Elasticsearch service and configures Shopware to use Elasticsearch in addition to the default MySQL search.
Example
sportalliance.enableElasticsearch = true;
You can import a list of links of database dumps by using the command importdb
.
Define a list of links like in the example below.
Supported files:
- *.sql
- *.gz
- *.zip
Example
sportalliance.importDatabaseDumps = [
"http://localhost/dump.sql.gz"
"http://localhost/admin_logins.sql"
];
Changes the default document root (public
) of caddy to the specified value
Example for the current folder
sportalliance.documentRoot = ".";
Adjusts the defined matcher paths for caddy. You might want to adjust those to access/handle *.php
files.
NOTE: The path can not be empty!
Example
sportalliance.staticFilePaths = "myCustomFolder/*";
If you want to use a specific PHP version, you can set the following versions
in your project devenv.nix
file. The php.ini configuration is >php80 specific
and needs to be adjusted when using a lower version.
- php56
- php70
- php71
- php72
- php73
- php74
- php80
- php81
- php82
MIT