Monatsspruch der ÖAB als Startseiten-Kachel für Inhaus (ab 0.12.0): automatischer Abruf von oeab.de, eigene Angaben je Monat, Admin-Seite, Packskript für das installierbare ZIP, Tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
26 lines
893 B
PHP
Executable file
26 lines
893 B
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
// Baut das installierbare ZIP: dist/monatsspruch-<version>.zip
|
|
// Hochladen unter Administration → Plugins → „Plugin hochladen“, dann aktivieren.
|
|
|
|
$root = dirname(__DIR__);
|
|
$manifest = json_decode(file_get_contents("$root/plugin.json"), true);
|
|
@mkdir("$root/dist");
|
|
$target = "$root/dist/{$manifest['slug']}-{$manifest['version']}.zip";
|
|
@unlink($target);
|
|
|
|
$zip = new ZipArchive;
|
|
$zip->open($target, ZipArchive::CREATE);
|
|
|
|
foreach (['plugin.json', 'README.md'] as $file) {
|
|
$zip->addFile("$root/$file", "{$manifest['slug']}/$file");
|
|
}
|
|
|
|
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("$root/src", FilesystemIterator::SKIP_DOTS));
|
|
|
|
foreach ($files as $file) {
|
|
$zip->addFile($file->getPathname(), $manifest['slug'].'/src/'.substr($file->getPathname(), strlen("$root/src/")));
|
|
}
|
|
|
|
$zip->close();
|
|
echo 'dist/'.basename($target).PHP_EOL;
|