#!/usr/bin/env php .zip zum Hochladen unter Administration → Plugins. * Enthält alles außer Quelltexten fürs Frontend-Build und node_modules. */ $root = dirname(__DIR__); $manifest = json_decode(file_get_contents("{$root}/plugin.json"), true); $target = "{$root}/chat-{$manifest['version']}.zip"; $skip = ['node_modules', '.git', 'inhaus-sdk', 'package.json', 'package-lock.json', 'vite.config.js', basename($target)]; @unlink($target); $zip = new ZipArchive; $zip->open($target, ZipArchive::CREATE); $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($root, FilesystemIterator::SKIP_DOTS)); foreach ($files as $file) { $relative = substr($file->getPathname(), strlen($root) + 1); if (in_array(explode(DIRECTORY_SEPARATOR, $relative)[0], $skip, true) || str_ends_with($relative, '.zip')) { continue; } $zip->addFile($file->getPathname(), 'chat/'.$relative); } $zip->close(); echo "Paket: {$target}\n";