Upload via GUI (30 Dateien)

This commit is contained in:
2026-11-01 11:17:41 +00:00
parent 53f8bf0577
commit c3b9948fa2
30 changed files with 5237 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
/**
* Packt das WordPress-Plugin als ZIP (nur der Ordner deskhub-tickets, ohne Tests und Werkzeuge) nach release/.
* php wordpress-plugin/tools/pack.php
*/
$root = dirname(__DIR__);
$src = $root . '/deskhub-tickets';
$main = (string) file_get_contents($src . '/deskhub-tickets.php');
if (!preg_match('/^\s*\*\s*Version:\s*(\S+)/m', $main, $m)) { fwrite(STDERR, "Version nicht gefunden.\n"); exit(1); }
$version = $m[1];
$outDir = dirname($root) . '/release';
@mkdir($outDir, 0777, true);
$out = $outDir . "/deskhub-tickets-wordpress-$version.zip";
@unlink($out);
$files = [];
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($src, FilesystemIterator::SKIP_DOTS));
foreach ($it as $f) {
$rel = str_replace(chr(92), '/', substr($f->getPathname(), strlen($src) + 1));
$files[$rel] = $f->getPathname();
}
ksort($files);
$zip = new ZipArchive();
if ($zip->open($out, ZipArchive::CREATE) !== true) { fwrite(STDERR, "ZIP lässt sich nicht anlegen.\n"); exit(1); }
foreach ($files as $rel => $path) {
$zip->addFile($path, 'deskhub-tickets/' . $rel); // immer mit /, im Ordner deskhub-tickets (WordPress verlangt das)
}
$zip->close();
echo count($files) . " Dateien -> $out (" . filesize($out) . " Bytes)\n";