ExtensionUpdateCommand.php 790 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Dcat\Admin\Console;
  3. use Dcat\Admin\Admin;
  4. use Illuminate\Console\Command;
  5. class ExtensionUpdateCommand extends Command
  6. {
  7. protected $signature = 'admin:ext-update
  8. {name : The name of the extension. Eg: author-name/extension-name}
  9. {--ver= : If this parameter is specified, the process will stop on the specified version, if not, it will update to the latest version. Example: 1.3.9}';
  10. protected $description = 'Update an existing extension';
  11. public function handle()
  12. {
  13. $name = $this->argument('name');
  14. $version = ltrim($this->option('ver'), 'v');
  15. Admin::extension()->load();
  16. Admin::extension()
  17. ->updateManager()
  18. ->setOutPut($this->output)
  19. ->update($name, $version);
  20. }
  21. }