1

I want to get a list of interceptors and the order that they are dispatched. I also need to get the module name of each interceptor. I'm thinking of logging straight from the Magento\Framework\Interception\Interceptor.php class, however this doesn't seem like the best way. Is there another, better approach to do this?

Thanks.

1

I want to get a list of interceptors and the order that they are dispatched.

Magento\Framework\Interception\PluginList; class PluginList Provides list of plugins configured for type.

You can log (By Magento log) the Sort information as well as List of Plugins.

Plug-in Sorting

protected function _sort($itemA, $itemB)
{
    if (isset($itemA['sortOrder'])) {
        if (isset($itemB['sortOrder'])) {
            return $itemA['sortOrder'] - $itemB['sortOrder'];
        }
        return $itemA['sortOrder'];
    } elseif (isset($itemB['sortOrder'])) {
        return (0 - (int)$itemB['sortOrder']);
    } else {
        return 0;
    }
}

List of Plugins by creating Magento Log

$this->_pluginInstances[$type][$code]

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.