- Tools > Plugins…: "On jumphp.net" (search, Install, Update to x.y.z) and "Publish on jumphp.net" for the project's plugins (packed, sent with the sign-in token) - PluginPackage: a plugin into a zip (bin/jumphp plugin:pack uses it) and back (checked: one folder, safe paths) - docs/ide-plugins.md: sharing on jumphp.net/ide-plugins, its API Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01X3cUrpEPheHAT512jkSvAK
16 lines
725 B
PHP
16 lines
725 B
PHP
<?php
|
|
|
|
// bin/jumphp plugin:pack <plugin>: dist/<id>-<version>.zip of the plugin's folder (JumPHP\Ide\Plugin\PluginPackage:
|
|
// the folder at the zip's root, without vendor/, var/, tests/, dist/), what the IDE installs and jumphp.net publishes.
|
|
// Run in the plugin's folder (its vendor/ has jumphp/ide).
|
|
use JumPHP\Ide\Plugin\PluginPackage;
|
|
|
|
$dir = realpath($argv[1] ?? '.');
|
|
require "$dir/vendor/autoload.php";
|
|
try {
|
|
$zip = PluginPackage::pack($dir);
|
|
} catch (Throwable $e) {
|
|
fwrite(STDERR, $e->getMessage() . "\n");
|
|
exit(1);
|
|
}
|
|
printf("%s (%d files, %d KB)\nInstall it in the JumPHP IDE (Tools > Plugins…) or publish it there on jumphp.net.\n", $zip['file'], $zip['files'], intdiv($zip['size'] + 1023, 1024));
|