Skip to content

Commit 822359d

Browse files
committed
Issue-230: adding varnish
- fixing static
1 parent c84a7a3 commit 822359d

File tree

1 file changed

+13
-38
lines changed
  • lib/internal/Magento/Framework/App/PageCache

1 file changed

+13
-38
lines changed

lib/internal/Magento/Framework/App/PageCache/Kernel.php

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Framework\App\PageCache;
77

88
use Magento\Framework\App\State as AppState;
9+
use Magento\Framework\App\ObjectManager;
910

1011
/**
1112
* Builtin cache processor
@@ -82,43 +83,17 @@ public function __construct(
8283
$this->cache = $cache;
8384
$this->identifier = $identifier;
8485
$this->request = $request;
85-
86-
if ($context) {
87-
$this->context = $context;
88-
} else {
89-
$this->context = \Magento\Framework\App\ObjectManager::getInstance()->get(
90-
\Magento\Framework\App\Http\Context::class
91-
);
92-
}
93-
if ($contextFactory) {
94-
$this->contextFactory = $contextFactory;
95-
} else {
96-
$this->contextFactory = \Magento\Framework\App\ObjectManager::getInstance()->get(
97-
\Magento\Framework\App\Http\ContextFactory::class
98-
);
99-
}
100-
if ($httpFactory) {
101-
$this->httpFactory = $httpFactory;
102-
} else {
103-
$this->httpFactory = \Magento\Framework\App\ObjectManager::getInstance()->get(
104-
\Magento\Framework\App\Response\HttpFactory::class
105-
);
106-
}
107-
if ($serializer) {
108-
$this->serializer = $serializer;
109-
} else {
110-
$this->serializer = \Magento\Framework\App\ObjectManager::getInstance()->get(
111-
\Magento\Framework\Serialize\SerializerInterface::class
112-
);
113-
}
114-
115-
if ($state) {
116-
$this->state = $state;
117-
} else {
118-
$this->state = \Magento\Framework\App\ObjectManager::getInstance()->get(
119-
AppState::class
120-
);
121-
}
86+
$this->context = $context ?? ObjectManager::getInstance()->get(\Magento\Framework\App\Http\Context::class);
87+
$this->contextFactory = $contextFactory ?? ObjectManager::getInstance()->get(
88+
\Magento\Framework\App\Http\ContextFactory::class
89+
);
90+
$this->httpFactory = $httpFactory ?? ObjectManager::getInstance()->get(
91+
\Magento\Framework\App\Response\HttpFactory::class
92+
);
93+
$this->serializer = $serializer ?? ObjectManager::getInstance()->get(
94+
\Magento\Framework\Serialize\SerializerInterface::class
95+
);
96+
$this->state = $state ?? ObjectManager::getInstance()->get(AppState::class);
12297
}
12398

12499
/**
@@ -231,7 +206,7 @@ private function buildResponse($responseData)
231206
private function getCache()
232207
{
233208
if (!$this->fullPageCache) {
234-
$this->fullPageCache = \Magento\Framework\App\ObjectManager::getInstance()->get(
209+
$this->fullPageCache = $objectManager->get(
235210
\Magento\PageCache\Model\Cache\Type::class
236211
);
237212
}

0 commit comments

Comments
 (0)