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

Backport of the StorageAdapterFactory to v2 #86

Merged

Conversation

boesing
Copy link
Member

@boesing boesing commented Apr 3, 2021

Q A
Documentation yes
New Feature yes

Description

This is a backport of #49 to provide forward compatibility to the 3.0 release of laminas-cache

@boesing boesing added this to the 2.11.0 milestone Apr 3, 2021
@boesing boesing modified the milestones: 2.11.0, 2.12.0 Apr 29, 2021
@boesing boesing changed the base branch from 2.11.x to 2.12.x May 2, 2021 14:03
@boesing boesing linked an issue May 8, 2021 that may be closed by this pull request
@boesing boesing force-pushed the feature/storage-adapter-factory-backport-v2 branch from 7bcedf7 to b6ad68b Compare May 10, 2021 20:49
This interface can be used to create storage plugins from either an configuration array (`StoragePluginFactoryInterface::createFromArrayConfiguration`) or directly ( `StoragePluginFactoryInterface::create`).

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This interface can be used to create storage adapters from either an configuration array (`StorageAdapterFactoryInterface::createFromArrayConfiguration`) or directly ( `StorageAdapterFactoryInterface::create`).

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing force-pushed the feature/storage-adapter-factory-backport-v2 branch from b6ad68b to 0cf2e14 Compare May 10, 2021 20:51
…ctoryInterface` implementations

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
…and `StoragePluginFactoryInterface`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing force-pushed the feature/storage-adapter-factory-backport-v2 branch from de9bad7 to 2977430 Compare May 10, 2021 21:51
'adapter' => 'apc',
]);
/** @var ContainerInterface $container */
$container = null; // can be any configured PSR-11 container
Copy link
Member Author

@boesing boesing May 10, 2021

Choose a reason for hiding this comment

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

@froschdesign Should I refer to the Standalone section to provide a way how the container could be "retrieved"?

Maybe by adding something like:

> ### Unsure How to Retrieve a Container Instance?
>
> Check out the [installation page](https://docs.laminas.dev/laminas-cache/installation/)

In most scenarios I am working with the laminas-cache, I have to retrieve a storage from within a factory which already passes the ContainerInterface.
But for those who are not working in a MVC or Mezzio project, that must not be the case.

Copy link
Member

Choose a reason for hiding this comment

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

@boesing

Should I refer to the Standalone section to provide a way how the container could be "retrieved"?

Stand-alone is correct because the component can be used outside of laminas-mvc or Mezzio based application. The basic usage and all other examples should follow this fact.

The integration in a laminas-mvc, Mezzio or other application must be described under the section "Application Integration". (laminas-mvc controller plugins and similar packages are clear exceptions)

Copy link
Member Author

@boesing boesing May 16, 2021

Choose a reason for hiding this comment

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

@froschdesign

Hm, I still dont really know how to provide proper examples for the "config-driven" creations of the storage adapters.

Starting with v3.0+, the config-driven approach wont work without having a PSR-11 container with the new StorageAdapterFactoryInterface configured, e.g. Manual instantiation will ofc still work.

How could I address that properly? I also don't get how an "Application Integration" section might look like.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing requested a review from froschdesign July 8, 2021 23:02
@boesing
Copy link
Member Author

boesing commented Jul 11, 2021

@froschdesign I'll go for this now and if we can improve documentation, I think we can do this in an additional PR/Release.

In v3, we have to adjust the basic-usage anyways as any cache adapter which is used will have its own ConfigProvider which then has to be added to the ConfigAggregator as well.
In v2, this is not necessary.

@boesing boesing merged commit e419f8b into laminas:2.12.x Jul 11, 2021
@boesing boesing deleted the feature/storage-adapter-factory-backport-v2 branch July 11, 2021 11:41
@boesing boesing changed the title storage adapter factory backport to v2 Backport of the StorageAdapterFactory to v2 Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Marking static factories as deprecated
2 participants