Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin installation command #1953

Merged
merged 7 commits into from
Sep 17, 2020
Merged

plugin installation command #1953

merged 7 commits into from
Sep 17, 2020

Conversation

kevinpapst
Copy link
Member

@kevinpapst kevinpapst commented Sep 5, 2020

Description

TODO

  • add example to DemoBundle

For devs only

  • added an abstract installation command to simplify process for plugin authors

Now your installation command could look like this:

namespace KimaiPlugin\SuperDuperBundle\Command;

use App\Command\AbstractBundleInstallerCommand;

class InstallCommand extends AbstractBundleInstallerCommand
{
    protected function getBundleCommandNamePart(): string
    {
        return 'superduper';
    }

    protected function hasAssets(): bool
    {
        return true;
    }

    protected function getMigrationsFilename(): ?string
    {
        return __DIR__ . '/../Migrations/config.yaml';
    }
}

Now running bin/console kimai:bundle:superduper:install would execute all available migrations and install bundle assets.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I verified that my code applies to the guidelines (composer code-check)
  • I updated the documentation (see here)
  • I agree that this code is used in Kimai and will be published under the MIT license

@kevinpapst kevinpapst added this to the 1.11 milestone Sep 5, 2020
@kevinpapst kevinpapst marked this pull request as draft September 5, 2020 13:53
@codecov
Copy link

codecov bot commented Sep 5, 2020

Codecov Report

Merging #1953 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1953      +/-   ##
============================================
- Coverage     93.39%   93.36%   -0.03%     
- Complexity     5430     5448      +18     
============================================
  Files           515      516       +1     
  Lines         16663    16725      +62     
============================================
+ Hits          15562    15616      +54     
- Misses         1101     1109       +8     
Impacted Files Coverage Δ Complexity Δ
src/Command/AbstractBundleInstallerCommand.php 87.09% <ø> (ø) 18.00 <0.00> (?)

@kevinpapst kevinpapst marked this pull request as ready for review September 6, 2020 14:42
@kevinpapst kevinpapst marked this pull request as draft September 8, 2020 18:33
@kevinpapst kevinpapst marked this pull request as ready for review September 17, 2020 22:53
@kevinpapst kevinpapst merged commit 38249e6 into master Sep 17, 2020
@kevinpapst kevinpapst deleted the plugin-install-cmd branch September 17, 2020 23:10
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant