Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ Copy the created `shopware-installer.phar.php` file to the root directory of you

Request that page in your browser with /shopware-installer.phar.php and the Installer will decide if you need to install or update Shopware.

## Running the Web Installer for development
## Local Development

Change the files of this repository as needed, then compile and copy afterwards:
`composer run build-phar && cp -f shopware-installer.phar.php your/directory/`
Start the local Docker environment, install dependencies, and build the phar:

composer local:up

The installer will be available at `http://localhost:8000/shopware-installer.phar.php`.

After making changes, rebuild and copy the phar into the running container:

composer local:build

To stop and remove the containers:

composer local:down

## Running update against an unreleased Shopware version

Expand Down
1 change: 1 addition & 0 deletions Resources/public/assets/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ table .notice-text td p {
background-color: var(--color-white);
border: 1px solid var(--color-border);
border-radius: var(--border-radius-default);
align-self: start;
}

.card__title {
Expand Down
13 changes: 10 additions & 3 deletions Services/TrackingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ class TrackingService
{
private const DEFAULT_TRACKING_DOMAIN = 'udp.usage.shopware.io';

private \Socket|false $socket;
/** @var \Socket|false|null */
private $socket = null;

private string $domain;

public function __construct()
{
$this->socket = @socket_create(\AF_INET, \SOCK_DGRAM, \SOL_UDP);
if (\function_exists('socket_create')) {
$this->socket = @socket_create(\AF_INET, \SOCK_DGRAM, \SOL_UDP);
}

$domain = Platform::getEnv('SHOPWARE_TRACKING_DOMAIN');
$this->domain = $domain !== false ? $domain : self::DEFAULT_TRACKING_DOMAIN;
Expand All @@ -34,7 +37,11 @@ public function track(TrackingEvent $eventName, string $userId, array $tags = []
return;
}

if ($this->socket === false) {
if (Platform::getEnv('SW_RECOVERY_NEXT_VERSION') !== false || Platform::getEnv('SW_RECOVERY_NEXT_BRANCH') !== false) {
return;
}

if (!$this->socket instanceof \Socket) {
return;
}

Expand Down
35 changes: 35 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
web:
image: webdevops/php-apache-dev:8.4
ports:
- "8000:80"
volumes:
- ./:/installer

database:
image: mariadb:latest
environment:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: shopware
command:
- --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
- --log_bin_trust_function_creators=1
- --binlog_cache_size=16M
- --key_buffer_size=0
- --join_buffer_size=1024M
- --innodb_log_file_size=128M
- --innodb_buffer_pool_size=1024M
- --innodb_buffer_pool_instances=1
- --group_concat_max_len=320000
- --default-time-zone=+00:00
- --max_binlog_size=512M
- --binlog_expire_logs_seconds=86400
tmpfs:
- /var/lib/mysql
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-h", "localhost", "-proot"]
start_interval: 3s
start_period: 10s
interval: 5s
timeout: 1s
retries: 10
15 changes: 14 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,23 @@
},
"scripts": {
"build-phar": [
"curl -qL -o box.phar https://github.com/box-project/box/releases/download/4.6.6/box.phar",
"curl -qL -o box.phar https://github.com/box-project/box/releases/download/4.6.10/box.phar",
"@php -d phar.readonly=0 box.phar compile",
"rm box.phar"
],
"local:up": [
"docker compose up -d",
"docker compose exec -w /installer web composer install",
"@local:build",
"echo 'Installer available at http://localhost:8000/shopware-installer.phar.php'"
],
"local:build": [
"docker compose exec -w /installer web composer build-phar",
"docker compose exec -w /installer web sh -c 'cp shopware-installer.phar.php /app/shopware-installer.phar.php'"
],
"local:down": [
"docker compose down -v"
],
"test": [
"../../vendor/bin/phpunit"
],
Expand Down
Loading