Skip to content

Commit e01d54c

Browse files
Merge pull request #919 from magento-troll/MAGETWO-65293
Stories: - MAGETWO-65181: Remove serialize/unserialize in \Magento\Framework\Unserialize\Unserialize - MAGETWO-65183: Remove serialize/unserialize in \Magento\Framework\Acl\Cache
2 parents b14d70e + 7420e24 commit e01d54c

File tree

17 files changed

+40
-341
lines changed

17 files changed

+40
-341
lines changed

app/code/Magento/Authorization/Model/ResourceModel/Rules.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ class Rules extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
2121
*/
2222
protected $_rootResource;
2323

24-
/**
25-
* Acl object cache
26-
*
27-
* @var \Magento\Framework\Acl\CacheInterface
28-
* @deprecated since 2.2 due to native serialization elimination.
29-
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
30-
*/
31-
protected $_aclCache;
32-
3324
/**
3425
* @var \Magento\Framework\Acl\Builder
3526
*/
@@ -50,7 +41,6 @@ class Rules extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
5041
* @param \Magento\Framework\Acl\Builder $aclBuilder
5142
* @param \Psr\Log\LoggerInterface $logger
5243
* @param \Magento\Framework\Acl\RootResource $rootResource
53-
* @param \Magento\Framework\Acl\CacheInterface $aclCache
5444
* @param string $connectionName
5545
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
5646
*/
@@ -59,14 +49,12 @@ public function __construct(
5949
\Magento\Framework\Acl\Builder $aclBuilder,
6050
\Psr\Log\LoggerInterface $logger,
6151
\Magento\Framework\Acl\RootResource $rootResource,
62-
\Magento\Framework\Acl\CacheInterface $aclCache,
6352
$connectionName = null,
6453
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null
6554
) {
6655
$this->_aclBuilder = $aclBuilder;
6756
parent::__construct($context, $connectionName);
6857
$this->_rootResource = $rootResource;
69-
$this->_aclCache = $aclCache;
7058
$this->_logger = $logger;
7159
$this->aclDataCache = $aclDataCache ?: ObjectManager::getInstance()->get(
7260
\Magento\Framework\Acl\Data\CacheInterface::class

app/code/Magento/Authorization/Test/Unit/Model/ResourceModel/RulesTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ class RulesTest extends \PHPUnit_Framework_TestCase
4646
*/
4747
private $rootResourceMock;
4848

49-
/**
50-
* @var \Magento\Framework\Acl\CacheInterface|\PHPUnit_Framework_MockObject_MockObject
51-
*/
52-
private $aclCacheMock;
53-
5449
/**
5550
* @var \Magento\Framework\Acl\Data\CacheInterface|\PHPUnit_Framework_MockObject_MockObject
5651
*/
@@ -117,11 +112,6 @@ protected function setUp()
117112
->setMethods([])
118113
->getMock();
119114

120-
$this->aclCacheMock = $this->getMockBuilder(\Magento\Framework\Acl\CacheInterface::class)
121-
->disableOriginalConstructor()
122-
->setMethods([])
123-
->getMock();
124-
125115
$this->aclDataCacheMock = $this->getMockBuilder(\Magento\Framework\Acl\Data\CacheInterface::class)
126116
->disableOriginalConstructor()
127117
->setMethods([])
@@ -145,7 +135,6 @@ protected function setUp()
145135
$this->aclBuilderMock,
146136
$this->loggerMock,
147137
$this->rootResourceMock,
148-
$this->aclCacheMock,
149138
'connection',
150139
$this->aclDataCacheMock
151140
);

app/code/Magento/Authorization/etc/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<type name="Magento\Authorization\Model\ResourceModel\Rules">
1111
<arguments>
1212
<argument name="rootResource" xsi:type="object">Magento\Framework\Acl\RootResource\Proxy</argument>
13-
<argument name="aclCache" xsi:type="object">Magento\Framework\Acl\Cache\Proxy</argument>
1413
</arguments>
1514
</type>
1615
<type name="Magento\Framework\Acl\Builder">

app/code/Magento/Backend/etc/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@
8989
<argument name="resourceLoader" xsi:type="object">Magento\Framework\Acl\Loader\ResourceLoader</argument>
9090
</arguments>
9191
</type>
92-
<type name="Magento\Framework\Acl\Cache">
93-
<arguments>
94-
<argument name="cacheKey" xsi:type="string">backend_acl_resources</argument>
95-
</arguments>
96-
</type>
9792
<type name="Magento\Framework\Acl\RootResource">
9893
<arguments>
9994
<argument name="identifier" xsi:type="string">Magento_Backend::all</argument>

app/code/Magento/Store/etc/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@
202202
<argument name="default" xsi:type="string">frontend</argument>
203203
</arguments>
204204
</type>
205-
<type name="Magento\Framework\Acl\Cache">
206-
<arguments>
207-
<argument name="cacheKey" xsi:type="string">global_acl_resources</argument>
208-
</arguments>
209-
</type>
210205
<type name="Magento\Framework\App\Config\Initial\Converter">
211206
<arguments>
212207
<argument name="nodeMap" xsi:type="array">

app/code/Magento/User/Model/ResourceModel/User.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717
*/
1818
class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1919
{
20-
/**
21-
* @var \Magento\Framework\Acl\CacheInterface
22-
* @deprecated since 2.2 due to native serialization elimination.
23-
* Use data cache \Magento\Framework\Acl\Data\CacheInterface instead.
24-
*/
25-
protected $_aclCache;
26-
2720
/**
2821
* Role model
2922
*
@@ -45,22 +38,19 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
4538
* Construct
4639
*
4740
* @param \Magento\Framework\Model\ResourceModel\Db\Context $context
48-
* @param \Magento\Framework\Acl\CacheInterface $aclCache
4941
* @param \Magento\Authorization\Model\RoleFactory $roleFactory
5042
* @param \Magento\Framework\Stdlib\DateTime $dateTime
5143
* @param string $connectionName
5244
* @param \Magento\Framework\Acl\Data\CacheInterface $aclDataCache
5345
*/
5446
public function __construct(
5547
\Magento\Framework\Model\ResourceModel\Db\Context $context,
56-
\Magento\Framework\Acl\CacheInterface $aclCache,
5748
\Magento\Authorization\Model\RoleFactory $roleFactory,
5849
\Magento\Framework\Stdlib\DateTime $dateTime,
5950
$connectionName = null,
6051
\Magento\Framework\Acl\Data\CacheInterface $aclDataCache = null
6152
) {
6253
parent::__construct($context, $connectionName);
63-
$this->_aclCache = $aclCache;
6454
$this->_roleFactory = $roleFactory;
6555
$this->dateTime = $dateTime;
6656
$this->aclDataCache = $aclDataCache ?: \Magento\Framework\App\ObjectManager::getInstance()->get(

app/code/Magento/User/Test/Unit/Model/ResourceModel/UserTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class UserTest extends \PHPUnit_Framework_TestCase
2121
/** @var \Magento\User\Model\User|\PHPUnit_framework_MockObject_MockObject */
2222
protected $userMock;
2323

24-
/** @var \Magento\Framework\Acl\CacheInterface|\PHPUnit_Framework_MockObject_MockObject */
25-
protected $aclCacheMock;
26-
2724
/** @var \Magento\Framework\Model\ResourceModel\Db\Context|\PHPUnit_Framework_MockObject_MockObject */
2825
protected $contextMock;
2926

@@ -62,11 +59,6 @@ protected function setUp()
6259
->setMethods([])
6360
->getMock();
6461

65-
$this->aclCacheMock = $this->getMockBuilder(\Magento\Framework\Acl\CacheInterface::class)
66-
->disableOriginalConstructor()
67-
->setMethods([])
68-
->getMock();
69-
7062
$this->roleFactoryMock = $this->getMockBuilder(\Magento\Authorization\Model\RoleFactory::class)
7163
->disableOriginalConstructor()
7264
->setMethods(['create'])
@@ -102,7 +94,6 @@ protected function setUp()
10294
\Magento\User\Model\ResourceModel\User::class,
10395
[
10496
'resource' => $this->resourceMock,
105-
'aclCache' => $this->aclCacheMock,
10697
'roleFactory' => $this->roleFactoryMock,
10798
'dateTime' => $this->dateTimeMock,
10899
'aclDataCache' => $this->aclDataCacheMock,

app/code/Magento/User/etc/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9-
<type name="Magento\User\Model\ResourceModel\User">
10-
<arguments>
11-
<argument name="aclCache" xsi:type="object">Magento\Framework\Acl\Cache\Proxy</argument>
12-
</arguments>
13-
</type>
149
<type name="Magento\Authorization\Model\Role">
1510
<plugin name="updateRoleUsersAcl" type="Magento\User\Model\Plugin\AuthorizationRole" sortOrder="20"/>
1611
</type>

app/etc/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
<preference for="Magento\Framework\App\ResourceConnection\ConnectionAdapterInterface" type="Magento\Framework\Model\ResourceModel\Type\Db\Pdo\Mysql"/>
107107
<preference for="Magento\Framework\DB\QueryInterface" type="Magento\Framework\DB\Query"/>
108108
<preference for="Magento\Framework\App\ProductMetadataInterface" type="Magento\Framework\App\ProductMetadata"/>
109-
<preference for="Magento\Framework\Acl\CacheInterface" type="Magento\Framework\Acl\Cache" />
110109
<preference for="Magento\Framework\Acl\Data\CacheInterface" type="Magento\Framework\Acl\Data\Cache" />
111110
<preference for="Magento\Framework\App\AreaInterface" type="Magento\Framework\App\Area" />
112111
<preference for="Magento\Framework\Setup\ModuleDataSetupInterface" type="Magento\Setup\Module\DataSetup" />

dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,4 +4227,7 @@
42274227
['Magento\Framework\Search\Document', 'Magento\Framework\Api\Search\Document'],
42284228
['Magento\Framework\Search\DocumentField'],
42294229
['Magento\Quote\Setup\Recurring'],
4230+
['Magento\Framework\Acl\Cache'],
4231+
['Magento\Framework\Acl\CacheInterface'],
4232+
['Magento\Framework\Acl\Test\Unit\CacheTest'],
42304233
];

lib/internal/Magento/Framework/Acl/Builder.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,24 @@ class Builder
2525
*/
2626
protected $_loaderPool;
2727

28-
/**
29-
* ACL cache
30-
*
31-
* @var \Magento\Framework\Acl\CacheInterface
32-
* @deprecated
33-
*/
34-
protected $_cache;
35-
3628
/**
3729
* @var \Magento\Framework\AclFactory
3830
*/
3931
protected $_aclFactory;
4032

4133
/**
4234
* @param \Magento\Framework\AclFactory $aclFactory
43-
* @param \Magento\Framework\Acl\CacheInterface $cache
4435
* @param \Magento\Framework\Acl\LoaderInterface $roleLoader
4536
* @param \Magento\Framework\Acl\LoaderInterface $resourceLoader
4637
* @param \Magento\Framework\Acl\LoaderInterface $ruleLoader
4738
*/
4839
public function __construct(
4940
\Magento\Framework\AclFactory $aclFactory,
50-
\Magento\Framework\Acl\CacheInterface $cache,
5141
\Magento\Framework\Acl\LoaderInterface $roleLoader,
5242
\Magento\Framework\Acl\LoaderInterface $resourceLoader,
5343
\Magento\Framework\Acl\LoaderInterface $ruleLoader
5444
) {
5545
$this->_aclFactory = $aclFactory;
56-
$this->_cache = $cache;
5746
$this->_loaderPool = [$roleLoader, $resourceLoader, $ruleLoader];
5847
}
5948

lib/internal/Magento/Framework/Acl/Cache.php

Lines changed: 0 additions & 92 deletions
This file was deleted.

lib/internal/Magento/Framework/Acl/CacheInterface.php

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)