Bilder in vier Breiten, Releasearchiv fuer Hosting ohne Composer
CMS quality / php (8.2) (push) Canceled after 0s
CMS quality / php (8.4) (push) Canceled after 0s
CMS quality / browser (push) Canceled after 0s
CMS quality / mysql (push) Canceled after 0s

Uploads werden weiterhin nach WebP umgewandelt, jetzt in vier statt drei
Breiten (480/960/1600/2400) und ohne Hochskalieren. Hintergrundbilder
waehlen ihre Variante je Geraet, weil CSS kein srcset kennt.

Dabei kam ein Fehler heraus, den erst der Browsertest zeigte: der
Dokumentpruefer erlaubte drei sources je Bild, also war mit der vierten
Variante jedes Dokument mit einem Bild ungueltig - ohne sichtbare Meldung.
Die Grenze haengt jetzt an MediaLibrary::WIDTHS.

Geteiltes Hosting hat meistens keinen Composer. scripts/build-release.php
baut deshalb auf einem Build-Rechner ein Archiv mit fertigem vendor/ ohne
Entwicklungspakete, samt SHA-256. Der Updater bricht ab, wenn ein Update
composer.lock aendert und Composer auf dem Server nicht aufrufbar ist,
statt mit einem unpassenden vendor/ weiterzulaufen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
kantarciandClaude Opus 5 committed 2026-09-12 22:39:08 +02:00
1 parent c046681302
commit c3bff7d936
17 files changed
+414 -26

No files matched your search

+30 -1
View File
@@ -136,6 +136,34 @@ final class UpdaterTest extends TestCase
self::assertStringContainsString('FEHLER v1.2.0', $updater->log()[0]);
}
public function testAnUpdateThatChangesDependenciesStopsWhenComposerIsMissing(): void
{
// The installation carries the lock of 1.0.0; the new version brings a different one. On
// hosting without Composer that cannot be resolved: vendor/ is outside Git and stays old.
$this->release('1.3.0', true, 'neu');
$updater = $this->updater();
$result = $updater->update();
self::assertFalse($result['ok'], $this->explain($result));
$failed = $this->firstFailed($result);
self::assertSame('Abhängigkeiten', $failed['step']);
self::assertStringContainsString('Releasearchiv', $failed['detail']);
// Rolled back, and the site is online again on the previous version.
self::assertSame('1.0.0', $updater->version());
self::assertFalse(is_file($this->work.'/'.Updater::MAINTENANCE_FILE));
}
public function testAnUpdateWithUnchangedDependenciesRunsWithoutComposer(): void
{
// Same dependencies as the installed version, so vendor/ stays valid.
$this->release('1.4.0', true, 'alt');
$result = $this->updater()->update();
self::assertTrue($result['ok'], $this->explain($result));
self::assertStringContainsString('composer.lock ist unverändert', $this->named($result['steps'], 'Abhängigkeiten', 'step')['detail']);
}
public function testADryRunChangesNothing(): void
{
$this->release('1.1.0', true);
@@ -189,8 +217,9 @@ final class UpdaterTest extends TestCase
* Publishes a release: VERSION, a .gitignore that keeps the installation out of Git, and the
* two stub commands the updater calls. `$healthy` decides whether they succeed.
*/
private function release(string $version, bool $healthy): void
private function release(string $version, bool $healthy, string $lock = 'alt'): void
{
file_put_contents($this->author.'/composer.lock', json_encode(['packages' => [$lock]]));
file_put_contents($this->author.'/VERSION', $version."\n");
file_put_contents($this->author.'/README.md', 'KantSites '.$version."\n");
// Only the installation is kept out of Git here: the stub commands live under vendor/