zendframework / zend-cache

BSD 3-Clause "New" or "Revised" License
69 stars 53 forks source link

Component split #93

Open marc-mabe opened 8 years ago

marc-mabe commented 8 years ago

I would like to get your opinions about splitting zend-cache into different components. The reason for that is simply a testing and dependency hell.

In my opinion it makes sense to split parts into it's own repository as long as the part requires a non standard extension or another currently optional dependency.

Thoughts ?

This is a structure how this could look like:

zendframework/zend-cache

weierophinney commented 8 years ago

This makes a ton of sense as far as I'm concerned; it's exactly what we're doing in zend-mvc currently.

I'd recommend:

With regards to the AdapterPluginManager, the new components should be made compatible with zend-component-installer. In doing so, you can have the Module class return configuration for the adapter plugin being exposed. (You should likely also do a ConfigProvider so folks can use it with Expressive!) I can provide more guidance on this aspect as needed.

neeckeloo commented 8 years ago

:+1: It's the logical continuation of the hard work done by @weierophinney.

marc-mabe commented 8 years ago

@weierophinney sorry for the late response. Nice to hear your ACK.

There are some details I like to discuss before:

Cheers

marc-mabe commented 7 years ago

@weierophinney @Ocramius Today I had some time and moved already a lot of repos from zend-cache into it's own. Could you please take a look if that's on a good way? Thanks!

Cheers

Ocramius commented 7 years ago

Sorry, I didn't join the discussion before.

Yes, this looks good, especially if we can manage to make the extension dependencies required when picking single packages (that would require requesting the single packages via composer, manually).

Unsure if the serializer needs to be extracted: probably worth keeping test, cache and serializer in a single package, while the adapters move each to a single component if they require particular extensions.

I'm also not sure if it's worth splitting out cache components that don't require extensions...

marc-mabe commented 7 years ago

@Ocramius Thanks for your comment!

I have moved the serializer plugin into another package as it requires the zend-serializer package. Same (will) happen to the session adapter which requires zend-session.

I'm also not sure if it's worth splitting out cache components that don't require extensions...

It's all about splitting out the parts require special dependencies. I have one exception only, the zend-cache-test package. This package contains some reusable / common tests and will be used by all other zend-cache* packages in development. The reason for that is that I want to have this dependency only for development require-dev and not on normal installations.

The following packages also needs to be moved:

Everything else should be kept in the main repo as it doesn't have special dependencies.

Right now I have one problem that I don't know how to solve: The component contains a factory StorageFactory used to instantiate storage adapters and plugins like

StorageFactory::factory([
    'adapter' => [
        'name'    => 'apc',
        'options' => ['ttl' => 3600],
    ],
    'plugins' => [
        'exception_handler' => ['throw_exceptions' => false],
    ],
]);

But how can I register the services on installation using the zend-component-installer?

Ocramius commented 7 years ago

I have moved the serializer plugin into another package as it requires the zend-serializer package. Same (will) happen to the session adapter which requires zend-session.

Makes sense

Yes that's basically all about. I have one exception only, the zend-cache-test package. This package contains some reusable / common tests and will be used by all other zend-cache* packages in development. The reason for that is that I want to have this dependency only for development require-dev and not on normal installations.

Can't we just use the .gitattributes, as we already did thus far?

marc-mabe commented 7 years ago

@Ocramius There are actually the following problems:

marc-mabe commented 7 years ago

@Ocramius Also moved the zend-server adapters to an own repo and after several hours I could make the tests run on travis by installing Zend-Server, rewriting phpunit start script and testing over HTTP call :)

@weierophinney Please could you take a look at https://github.com/marc-mabe/zend-cache-zendserver/blob/master/.travis.yml and validate if that is ok and allowed how I run the tests.

Thanks.

weierophinney commented 7 years ago

I love the idea of separating out the various storage adapters to their own repositories. That way users are only getting code related to the adapter(s) they use, and we can have much easier, more targeted instructions on contributing (typically via vagrant and/or docker).

I've looked at the zend-cache-zendserver Travis setup, and it looks reasonable.

Would this split target a v3 release, then? And I assume we'd want each adapter brought into the zendframework organization, and tagged with a stable 1.0.0 release before removing them here, correct?

marc-mabe commented 7 years ago

I've looked at the zend-cache-zendserver Travis setup, and it looks reasonable.

Thanks for review :smiley:

Would this split target a v3 release, then?

Yea, also I have one or two other things I want to archive for 3.0 because small BC break.

And I assume we'd want each adapter brought into the zendframework organization, and tagged with a stable 1.0.0 release before removing them here, correct?

Yes, of course before tagging a stable version of zend-cache with adapters removed the adapters have to have a stable version already and everything has to be in zendframework organization. I was planning to start with adapter versions with version 3.0 as the adapters had stable versions before within zend-cache.

marc-mabe commented 7 years ago

Does anyone have an idea or knows someone how would be able to test the WinCache adapter. I don't have a windows system at hand and even if so I would not like to fight setting up a microsoft webserver an windows in my free time.

weierophinney commented 7 years ago

@marc-mabe The only thing I can think of is to use a Windows vagrant image as a base, and then have the Vagrantfile download and install PHP to it. IIRC, Travis has windows images, too, which might make this possible there.

boesing commented 5 years ago

As the support for APC dropped years ago and there is no compatible PHP 7+ version, shouldn't we drop support for that extension at all?

weierophinney commented 5 years ago

@boesing We can when we bump to PHP 7.1.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-cache; a new issue has been opened at https://github.com/laminas/laminas-cache/issues/7.