-
Notifications
You must be signed in to change notification settings - Fork 9.4k
compiled interceptors module #22826
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
Open
fsw
wants to merge
74
commits into
magento:2.5-develop
Choose a base branch
from
fsw:2.3-develop
base: 2.5-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
compiled interceptors module #22826
Changes from 46 commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
2fb8f2a
Merge pull request #2 from magento/2.3-develop
fsw e0057b6
Merge pull request #3 from magento/2.3-develop
fsw 53709eb
add creatuity compiled interceptors module
36f069e
Merge remote-tracking branch 'origin/2.3-develop' into user-2.3-develop
7f499e1
added scope as constructor parameter and properties for plugins cache
d97dba0
Merge branch '2.3-develop' of github.com:fsw/magento2 into 2.3-develop
cb0a213
get object manager from DI
d19f4f9
clean up code repetition by extending core plugins list
32e3cca
static code check fixes
224dd4e
hotfic for production mode
000d0a5
Merge pull request #4 from magento/2.3-develop
fsw e57df09
removed unnecessary inheritance, fix for methods returning self
f08394d
Merge branch '2.3-develop' of github.com:fsw/magento2 into 2.3-develop
8071fb2
bugfix for methods returning void
4948604
void methods fix
75e65ac
void methods fix
5fc398c
refactor of CompiledInterceptor
1999072
fixes for coding standard
f30e9cf
coding standards fix
82dc39f
coding standard fixes
41ca3b0
coding standard fixes
944144a
cyclomatic complexity refactor
5227be0
Merge pull request #5 from magento/2.3-develop
fsw d64c89a
coding standards fixes
16add49
Merge branch '2.3-develop' of github.com:fsw/magento2 into 2.3-develop
1058be9
fixes for compiled mode
ecd9b54
bugfix for primary scope for compiled mode
6285273
generating interceptors performance fix
5cb7dc9
Merge pull request #6 from magento/2.3-develop
fsw 5b85a71
Merge branch '2.3-develop' of github.com:fsw/magento2 into 2.3-develop
d22a34e
optimise generation time from empty cache
5e62ebc
further optimisation and default scope fix
9c0aad8
Replaced preferences usage
YevSent bb6cc62
Merge pull request #7 from magento/2.3-develop
fsw c334bcf
Merge branch '2.3-develop' of github.com:fsw/magento2 into 2.3-develop
5665eec
Merge pull request #8 from joni-jones/interceptors
fsw c3019f3
Merge branch '2.3-develop' of github.com:fsw/magento2 into 2.3-develop
dfd3c28
manual backport of preferences usage fix
a7fc720
save plugins cache in generated code folder to simplify cache cleaning
1657b46
coding standards fix
07bfca9
move sompiledinterceptorsubstitution to avoid dependency issues, fix …
7f268ce
fix for plugins overriden by preferences
8b3cae6
Removed commented line
sidolov 2bc739d
magento/magento2#22826: Refactoring.
engcom-Foxtrot 29a6d8e
magento/magento2#22826: Static test fix.
engcom-Foxtrot dca21f7
magento/magento2#22826: Class level caching for compiled plugins remo…
engcom-Foxtrot 219382f
magento/magento2#22826: Admin infinite redirect loop fix.
engcom-Foxtrot f96d546
magento/magento2#22826: Compiled plugin list optimization.
engcom-Foxtrot 528408d
magento/magento2#22826: Static cache path update.
engcom-Foxtrot aa62a4d
magento/magento2#22826: Compiled interceptor return type fix.
engcom-Foxtrot eb1018b
magento/magento2#22826: Integration tests fix.
engcom-Foxtrot 1ef18eb
Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop
engcom-Foxtrot 53e1e8d
magento/magento2#22826: Enable compiled interceptors.
engcom-Foxtrot 75dea82
magento/magento2#22826: Remove ExecuteCommitCallbacks plugin.
engcom-Foxtrot b422bb1
magento/magento2#22826: Autoload fix.
engcom-Foxtrot b40eabe
magento/magento2#22826: Arguments resolving for interceptors fix.
engcom-Foxtrot 94a29c7
Merge remote-tracking branch 'mainline/2.3-develop' into 2.3-develop
engcom-Foxtrot 7fbcecd
Merge branch '2.3-develop' into 2.3-develop
engcom-Foxtrot 53fa5c4
magento/magento2#22826: After plugin calls generation fix.
engcom-Foxtrot 727cfc9
magento/magento2#22826: Tests fix.
engcom-Foxtrot 23bdd02
magento/magento2#22826: Refactoring.
engcom-Foxtrot c263481
magento/magento2#22826: Compiled interceptor constructors generation …
engcom-Foxtrot c082b69
magento/magento2#22826: Static test fix.
engcom-Foxtrot 5b57dbc
magento/magento2#22826: Compiled plugin list argument update.
engcom-Foxtrot de6e95b
magento/magento2#22826: Readme update.
engcom-Foxtrot 7bc9f69
magento/magento2#22826: Disable compiled interceptors.
engcom-Foxtrot d1b674e
Merge branch '2.4-develop' into 2.3-develop
f6dccdd
Merge branch '2.4-develop' into 2.3-develop
f6e7ac4
Fixed incorrectly resolved merge conflicts
9d1f67c
Fixed incorrectly resolved merge conflicts
3fb9422
Fixed tests failures
76864e0
Merge branch '2.4-develop' into 2.3-develop
8f80b6e
Merge branch '2.5-develop' of https://github.com/magento/magento2 int…
fsw c9f47ef
Merge branch 'magento-2.5-develop' into 2.3-develop
fsw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
lib/internal/Magento/Framework/CompiledInterception/Generator/AreasPluginList.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Framework\CompiledInterception\Generator; | ||
|
||
use Magento\Framework\App\ObjectManager; | ||
use Magento\Framework\Config\Scope; | ||
use Magento\Framework\Config\ScopeInterfaceFactory; | ||
|
||
/** | ||
* Class AreasPluginList | ||
*/ | ||
class AreasPluginList | ||
{ | ||
/** | ||
* @var Scope | ||
*/ | ||
private $scope; | ||
|
||
/** | ||
* @var ScopeInterfaceFactory | ||
*/ | ||
private $scopeInterfaceFactory; | ||
|
||
/** | ||
* @var CompiledPluginListFactory | ||
*/ | ||
private $compiledPluginListFactory; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private $plugins; | ||
|
||
/** | ||
* AreasPluginList constructor. | ||
* @param Scope $scope | ||
* @param ScopeInterfaceFactory $scopeInterfaceFactory | ||
* @param CompiledPluginListFactory $compiledPluginListFactory | ||
* @param array|null $plugins | ||
*/ | ||
public function __construct( | ||
Scope $scope, | ||
ScopeInterfaceFactory $scopeInterfaceFactory, | ||
CompiledPluginListFactory $compiledPluginListFactory, | ||
?array $plugins = null | ||
) { | ||
$this->scope = $scope; | ||
$this->scopeInterfaceFactory = $scopeInterfaceFactory; | ||
$this->plugins = $plugins; | ||
$this->compiledPluginListFactory = $compiledPluginListFactory; | ||
} | ||
|
||
/** | ||
* Get array of plugins config indexed by scope code | ||
* | ||
* @return array | ||
*/ | ||
public function getPluginsConfigForAllAreas() | ||
{ | ||
if ($this->plugins === null) { | ||
$this->plugins = []; | ||
//this is to emulate order M2 is reading scopes config to use scope cache | ||
//"global|primary" should be loaded first and then "global|primary|frontend" etc. | ||
$defaultScopePluginList = $defaultScope = null; | ||
$objectManager = ObjectManager::getInstance(); | ||
foreach ($this->scope->getAllScopes() as $scope) { | ||
$configScope = $this->scopeInterfaceFactory->create( | ||
[ | ||
'scope' => $scope, | ||
] | ||
); | ||
if ($defaultScopePluginList === null) { | ||
$defaultScopePluginList = $this->compiledPluginListFactory->create( | ||
[ | ||
'objectManager' => $objectManager, | ||
'scope' => $configScope | ||
] | ||
); | ||
$defaultScopePluginList->getNext('dummy', 'dummy'); | ||
$defaultScope = $scope; | ||
} else { | ||
$this->plugins[$scope] = clone $defaultScopePluginList; | ||
$this->plugins[$scope]->setScope($configScope); | ||
} | ||
} | ||
$this->plugins[$defaultScope] = $defaultScopePluginList; | ||
} | ||
return $this->plugins; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.