Skip to content

Commit 2263d5c

Browse files
author
Sergii Kovalenko
committed
MAGETWO-56989: Deployment process can't be executed on separate machine
-move deploy static command
1 parent b3274a6 commit 2263d5c

File tree

3 files changed

+6
-73
lines changed

3 files changed

+6
-73
lines changed

app/code/Magento/Eav/Model/Entity/AttributeCache.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
1010
use Magento\Framework\App\CacheInterface;
1111
use Magento\Framework\App\Cache\StateInterface;
12-
use Magento\Framework\App\ObjectManager;
13-
use Magento\Framework\Serialize\Serializer\Serialize;
1412
use Magento\Framework\Serialize\SerializerInterface;
1513

1614
/**
@@ -46,11 +44,6 @@ class AttributeCache
4644
*/
4745
private $unsupportedTypes;
4846

49-
/**
50-
* @var SerializerInterface
51-
*/
52-
private $serializer;
53-
5447
/**
5548
* AttributeCache constructor.
5649
* @param CacheInterface $cache
@@ -97,7 +90,7 @@ public function getAttributes($entityType, $suffix = '')
9790
$cacheKey = self::ATTRIBUTES_CACHE_PREFIX . $entityType . $suffix;
9891
$attributesData = $this->cache->load($cacheKey);
9992
if ($attributesData) {
100-
$attributes = $this->getSerializer()->unserialize($attributesData);
93+
$attributes = unserialize($attributesData);
10194
$this->attributeInstances[$entityType . $suffix] = $attributes;
10295
return $attributes;
10396
}
@@ -121,7 +114,7 @@ public function saveAttributes($entityType, $attributes, $suffix = '')
121114
$this->attributeInstances[$entityType . $suffix] = $attributes;
122115
if ($this->isAttributeCacheEnabled()) {
123116
$cacheKey = self::ATTRIBUTES_CACHE_PREFIX . $entityType . $suffix;
124-
$attributesData = $this->getSerializer()->serialize($attributes);
117+
$attributesData = serialize($attributes);
125118
$this->cache->save(
126119
$attributesData,
127120
$cacheKey,
@@ -153,19 +146,4 @@ public function clear()
153146
}
154147
return true;
155148
}
156-
157-
/**
158-
* Retrieve handler which allows serialize/deserialize data
159-
*
160-
* @deprecated
161-
* @return SerializerInterface
162-
*/
163-
private function getSerializer()
164-
{
165-
if (!$this->serializer) {
166-
$this->serializer = ObjectManager::getInstance()->get(Serialize::class);
167-
}
168-
169-
return $this->serializer;
170-
}
171149
}

app/code/Magento/Theme/Model/Theme/ThemeProvider.php

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
namespace Magento\Theme\Model\Theme;
77

88
use Magento\Framework\App\ObjectManager;
9-
use Magento\Framework\Serialize\Serializer\Serialize;
10-
use Magento\Framework\Serialize\SerializerInterface;
119
use Magento\Framework\View\Design\Theme\ListInterface;
1210
use Magento\Framework\App\DeploymentConfig;
1311

@@ -46,11 +44,6 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide
4644
*/
4745
private $deploymentConfig;
4846

49-
/**
50-
* @var SerializerInterface
51-
*/
52-
private $serializer;
53-
5447
/**
5548
* ThemeProvider constructor.
5649
*
@@ -84,13 +77,13 @@ public function getThemeByFullPath($fullPath)
8477
/** @var $themeCollection \Magento\Theme\Model\ResourceModel\Theme\Collection */
8578
$theme = $this->cache->load('theme'. $fullPath);
8679
if ($theme) {
87-
$this->themes[$fullPath] = $this->getSerializer()->unserialize($theme);
80+
$this->themes[$fullPath] = unserialize($theme);
8881
return $this->themes[$fullPath];
8982
}
9083
$themeCollection = $this->collectionFactory->create();
9184
$item = $themeCollection->getThemeByFullPath($fullPath);
9285
if ($item->getId()) {
93-
$themeData = $this->getSerializer()->serialize($item);
86+
$themeData = serialize($item);
9487
$this->cache->save($themeData, 'theme' . $fullPath);
9588
$this->cache->save($themeData, 'theme-by-id-' . $item->getId());
9689
$this->themes[$fullPath] = $item;
@@ -122,14 +115,14 @@ public function getThemeById($themeId)
122115
}
123116
$theme = $this->cache->load('theme-by-id-' . $themeId);
124117
if ($theme) {
125-
$this->themes[$themeId] = $this->getSerializer()->unserialize($theme);
118+
$this->themes[$themeId] = unserialize($theme);
126119
return $this->themes[$themeId];
127120
}
128121
/** @var $themeModel \Magento\Framework\View\Design\ThemeInterface */
129122
$themeModel = $this->themeFactory->create();
130123
$themeModel->load($themeId);
131124
if ($themeModel->getId()) {
132-
$this->cache->save($this->getSerializer()->serialize($themeModel), 'theme-by-id-' . $themeId);
125+
$this->cache->save(serialize($themeModel), 'theme-by-id-' . $themeId);
133126
$this->themes[$themeId] = $themeModel;
134127
}
135128
return $themeModel;
@@ -158,19 +151,4 @@ private function getDeploymentConfig()
158151
}
159152
return $this->deploymentConfig;
160153
}
161-
162-
/**
163-
* Retrieve handler which allows serialize/deserialize data
164-
*
165-
* @deprecated
166-
* @return SerializerInterface
167-
*/
168-
private function getSerializer()
169-
{
170-
if (!$this->serializer) {
171-
$this->serializer = ObjectManager::getInstance()->get(Serialize::class);
172-
}
173-
174-
return $this->serializer;
175-
}
176154
}

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
1010
use Magento\Authorization\Model\Acl\Role\User as RoleUser;
1111
use Magento\Authorization\Model\UserContextInterface;
12-
use Magento\Framework\App\ObjectManager;
13-
use Magento\Framework\Serialize\Serializer\Serialize;
14-
use Magento\Framework\Serialize\SerializerInterface;
1512
use Magento\User\Model\User as ModelUser;
1613

1714
/**
@@ -37,11 +34,6 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
3734
*/
3835
protected $dateTime;
3936

40-
/**
41-
* @var SerializerInterface
42-
*/
43-
private $serializer;
44-
4537
/**
4638
* Construct
4739
*
@@ -625,19 +617,4 @@ public function getLatestPassword($userId)
625617
[':user_id' => $userId]
626618
);
627619
}
628-
629-
/**
630-
* Retrieve handler which allows serialize/deserialize data
631-
*
632-
* @deprecated
633-
* @return SerializerInterface
634-
*/
635-
private function getSerializer()
636-
{
637-
if (!$this->serializer) {
638-
$this->serializer = ObjectManager::getInstance()->get(Serialize::class);
639-
}
640-
641-
return $this->serializer;
642-
}
643620
}

0 commit comments

Comments
 (0)