diff --git a/README.md b/README.md index e5e7ae0..867a479 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Resources/public/assets/styles/style.css b/Resources/public/assets/styles/style.css index 38bf8e1..95b20b4 100644 --- a/Resources/public/assets/styles/style.css +++ b/Resources/public/assets/styles/style.css @@ -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 { diff --git a/Services/TrackingService.php b/Services/TrackingService.php index 8844fd5..783373d 100644 --- a/Services/TrackingService.php +++ b/Services/TrackingService.php @@ -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; @@ -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; } diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..4f7fc5f --- /dev/null +++ b/compose.yaml @@ -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 diff --git a/composer.json b/composer.json index 4c13e9a..a79bba7 100644 --- a/composer.json +++ b/composer.json @@ -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" ],