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

PBC-3017 Added AppKernel documentation. #2239

Conversation

stereomon
Copy link
Contributor

PR Description

Added documentation for the new AppKernel.

https://spryker.atlassian.net/browse/PBC-3017

Checklist

  • I agree with the Code Contribution License Agreement in CONTRIBUTING.md

@stereomon stereomon self-assigned this Oct 11, 2023

### Configure

Add a class that implements `\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestValidatorPluginInterface` and add it to `\Pyz\Glue\AppKernel\AppKernelDependencyProvider::getRequestConfigureValidatorPlugins()` on the project level when needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we do this to set up the Configure action? Why do we say "on the project level when needed" Is it an optional step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's an optional step that might not be required by every App.


In some cases, you need to do additional things with the passed configuration e.g. sending a request to a third-party application, or manipulating the data before it gets saved into the database.

You can add two plugins:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where should they be added?

Copy link
Contributor Author

@stereomon stereomon Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\Pyz\Zed\AppKernel\AppKernelDependencyProvider::getConfigurationBeforeSavePlugin()
\Pyz\Zed\AppKernel\AppKernelDependencyProvider::getConfigurationAfterSavePlugin()

Already written here https://github.com/spryker/spryker-docs/pull/2239/files#diff-ea6d8614a903c2b155ec7b2e6be0e98fbfe9a4aa7e142669a0e6595057ea8894R69-R70


These plugins will be executed inside of the `\Spryker\Zed\AppKernel\Business\Writer\ConfigWriter::doSaveAppConfig()` method in a transaction. When you need to do some business logic for your App then you can use those plugins to do so and add them to the corresponding method in the \Pyz\Zed\AppKernel\AppKernelDependencyProvider on the project level when needed.

The following methods can be used to attach your plugins:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by "attach your plugins"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means adding them to the dependency provider.


In some cases, you need to do additional things before the Tenant gets disconnected from an App (configuration will be deleted).

You can add two plugins:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where should they be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\Pyz\Zed\AppKernel\AppKernelDependencyProvider::getConfigurationBeforeDeletePlugin()
\Pyz\Zed\AppKernel\AppKernelDependencyProvider::getConfigurationAfterDeletePlugin()

But this information is already written here https://github.com/spryker/spryker-docs/pull/2239/files#diff-ea6d8614a903c2b155ec7b2e6be0e98fbfe9a4aa7e142669a0e6595057ea8894R85-R86

@lenadoc lenadoc added the new PR contains a new document label Oct 19, 2023
@lenadoc lenadoc merged commit 3ea3c82 into master Oct 19, 2023
13 checks passed
@lenadoc lenadoc deleted the feature/pbc-3017/pbc-3029-res-write-and-publish-the-documentation branch October 19, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new PR contains a new document
Development

Successfully merging this pull request may close these issues.

2 participants