Skip to content
Snippets Groups Projects
Commit 2263d5c9 authored by Sergii Kovalenko's avatar Sergii Kovalenko
Browse files

MAGETWO-56989: Deployment process can't be executed on separate machine

-move deploy static command
parent b3274a6a
No related merge requests found
......@@ -9,8 +9,6 @@ namespace Magento\Eav\Model\Entity;
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
use Magento\Framework\App\CacheInterface;
use Magento\Framework\App\Cache\StateInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Serialize;
use Magento\Framework\Serialize\SerializerInterface;
/**
......@@ -46,11 +44,6 @@ class AttributeCache
*/
private $unsupportedTypes;
/**
* @var SerializerInterface
*/
private $serializer;
/**
* AttributeCache constructor.
* @param CacheInterface $cache
......@@ -97,7 +90,7 @@ class AttributeCache
$cacheKey = self::ATTRIBUTES_CACHE_PREFIX . $entityType . $suffix;
$attributesData = $this->cache->load($cacheKey);
if ($attributesData) {
$attributes = $this->getSerializer()->unserialize($attributesData);
$attributes = unserialize($attributesData);
$this->attributeInstances[$entityType . $suffix] = $attributes;
return $attributes;
}
......@@ -121,7 +114,7 @@ class AttributeCache
$this->attributeInstances[$entityType . $suffix] = $attributes;
if ($this->isAttributeCacheEnabled()) {
$cacheKey = self::ATTRIBUTES_CACHE_PREFIX . $entityType . $suffix;
$attributesData = $this->getSerializer()->serialize($attributes);
$attributesData = serialize($attributes);
$this->cache->save(
$attributesData,
$cacheKey,
......@@ -153,19 +146,4 @@ class AttributeCache
}
return true;
}
/**
* Retrieve handler which allows serialize/deserialize data
*
* @deprecated
* @return SerializerInterface
*/
private function getSerializer()
{
if (!$this->serializer) {
$this->serializer = ObjectManager::getInstance()->get(Serialize::class);
}
return $this->serializer;
}
}
......@@ -6,8 +6,6 @@
namespace Magento\Theme\Model\Theme;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Serialize;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\View\Design\Theme\ListInterface;
use Magento\Framework\App\DeploymentConfig;
......@@ -46,11 +44,6 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide
*/
private $deploymentConfig;
/**
* @var SerializerInterface
*/
private $serializer;
/**
* ThemeProvider constructor.
*
......@@ -84,13 +77,13 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide
/** @var $themeCollection \Magento\Theme\Model\ResourceModel\Theme\Collection */
$theme = $this->cache->load('theme'. $fullPath);
if ($theme) {
$this->themes[$fullPath] = $this->getSerializer()->unserialize($theme);
$this->themes[$fullPath] = unserialize($theme);
return $this->themes[$fullPath];
}
$themeCollection = $this->collectionFactory->create();
$item = $themeCollection->getThemeByFullPath($fullPath);
if ($item->getId()) {
$themeData = $this->getSerializer()->serialize($item);
$themeData = serialize($item);
$this->cache->save($themeData, 'theme' . $fullPath);
$this->cache->save($themeData, 'theme-by-id-' . $item->getId());
$this->themes[$fullPath] = $item;
......@@ -122,14 +115,14 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide
}
$theme = $this->cache->load('theme-by-id-' . $themeId);
if ($theme) {
$this->themes[$themeId] = $this->getSerializer()->unserialize($theme);
$this->themes[$themeId] = unserialize($theme);
return $this->themes[$themeId];
}
/** @var $themeModel \Magento\Framework\View\Design\ThemeInterface */
$themeModel = $this->themeFactory->create();
$themeModel->load($themeId);
if ($themeModel->getId()) {
$this->cache->save($this->getSerializer()->serialize($themeModel), 'theme-by-id-' . $themeId);
$this->cache->save(serialize($themeModel), 'theme-by-id-' . $themeId);
$this->themes[$themeId] = $themeModel;
}
return $themeModel;
......@@ -158,19 +151,4 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide
}
return $this->deploymentConfig;
}
/**
* Retrieve handler which allows serialize/deserialize data
*
* @deprecated
* @return SerializerInterface
*/
private function getSerializer()
{
if (!$this->serializer) {
$this->serializer = ObjectManager::getInstance()->get(Serialize::class);
}
return $this->serializer;
}
}
......@@ -9,9 +9,6 @@ namespace Magento\User\Model\ResourceModel;
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
use Magento\Authorization\Model\Acl\Role\User as RoleUser;
use Magento\Authorization\Model\UserContextInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Serialize\Serializer\Serialize;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\User\Model\User as ModelUser;
/**
......@@ -37,11 +34,6 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
*/
protected $dateTime;
/**
* @var SerializerInterface
*/
private $serializer;
/**
* Construct
*
......@@ -625,19 +617,4 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
[':user_id' => $userId]
);
}
/**
* Retrieve handler which allows serialize/deserialize data
*
* @deprecated
* @return SerializerInterface
*/
private function getSerializer()
{
if (!$this->serializer) {
$this->serializer = ObjectManager::getInstance()->get(Serialize::class);
}
return $this->serializer;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment