Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

plugin by the name "exception_handler" was not found #97

Closed
Marat-Tanalin opened this issue Apr 21, 2016 · 4 comments
Closed

plugin by the name "exception_handler" was not found #97

Marat-Tanalin opened this issue Apr 21, 2016 · 4 comments

Comments

@Marat-Tanalin
Copy link

Marat-Tanalin commented Apr 21, 2016

When trying to use zend-cache downloaded separately via Composer (under Windows 7, fwiw), the following exception is thrown:

A plugin by the name "exception_handler" was not found in the plugin manager Zend\Cache\Storage\PluginManager

The relevant part of the stack trace:

0 ...\vendor\zendframework\zend-cache\src\StorageFactory.php(203): Zend\ServiceManager\AbstractPluginManager->get('exception_handl...')

composer.json used to download the package:

{
    "name": "test",
    "require": {
        "zendframework/zend-cache": "^2.5"
    }
}

In case of using zend-cache from ZF downloaded entirely ("zendframework/zendframework": "^2.5"), the issue is not reproduced.

Thanks.

@marc-mabe
Copy link
Member

Thanks for your bug report - I can reproduce this bug -> the bug was introduced in 2.6.0 /:
We'll check how to fix this.

@weierophinney @ezimuel I think is has something todo with the server manager v2 / v3 compatibility - see #22 #69

@Marat-Tanalin To fix your issue you should use camalCase or lower case but don't separate by _. exception_handler and exceptionHandler works fine

@marc-mabe
Copy link
Member

@weierophinney @ezimuel Should we add also all underscore variants to the list of aliases?
-> this could be a lot as we have already a lot.

Current snipped just for 5 storage plugins:

    protected $aliases = [
        'clearexpiredbyfactor' => Plugin\ClearExpiredByFactor::class,
        'clearExpiredByFactor' => Plugin\ClearExpiredByFactor::class,
        'ClearExpiredByFactor' => Plugin\ClearExpiredByFactor::class,
        'exceptionhandler'     => Plugin\ExceptionHandler::class,
        'exceptionHandler'     => Plugin\ExceptionHandler::class,
        'ExceptionHandler'     => Plugin\ExceptionHandler::class,
        'ignoreuserabort'      => Plugin\IgnoreUserAbort::class,
        'ignoreUserAbort'      => Plugin\IgnoreUserAbort::class,
        'IgnoreUserAbort'      => Plugin\IgnoreUserAbort::class,
        'optimizebyfactor'     => Plugin\OptimizeByFactor::class,
        'optimizeByFactor'     => Plugin\OptimizeByFactor::class,
        'OptimizeByFactor'     => Plugin\OptimizeByFactor::class,
        'serializer'           => Plugin\Serializer::class,
        'Serializer'           => Plugin\Serializer::class
    ];

@Marat-Tanalin
Copy link
Author

If plugin names with underscore-separated words cannot be used anymore, documentation should probably account for this. Namely, doc/book/storage/adapter.md contains exception_handler multiple times.

@weierophinney
Copy link
Member

Should we add also all underscore variants to the list of aliases?

If they're commonly used, yes, we should add aliases for them, @marc-mabe ; do you want to do this?

@Marat-Tanalin it's not that they cannot be used, but that zend-servicemanager v3 no longer does normalization. v2 would strip out non-alphanumeric characters from the service name to perform lookups, while v3 does strict literal matching. As such, if we create aliases using the most common separator characters, we can still use them.

weierophinney added a commit that referenced this issue May 12, 2016
fixed #97 by adding underline names to plugin manager
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants