-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from magento-ogre/develop
[Ogre's] Sprint 24 Bugs Contribution
- Loading branch information
Showing
29 changed files
with
653 additions
and
629 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,63 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\PageCache\Model; | ||
|
||
/** | ||
* Checks if session should be depersonalized in Depersonalize plugin | ||
*/ | ||
class DepersonalizeChecker | ||
{ | ||
/** | ||
* Request | ||
* | ||
* @var \Magento\Framework\App\RequestInterface | ||
*/ | ||
private $request; | ||
|
||
/** | ||
* Module manager | ||
* | ||
* @var \Magento\Framework\Module\Manager | ||
*/ | ||
private $moduleManager; | ||
|
||
/** | ||
* Cache config | ||
* | ||
* @var Config | ||
*/ | ||
private $cacheConfig; | ||
|
||
/** | ||
* @param \Magento\Framework\App\RequestInterface $request | ||
* @param \Magento\Framework\Module\Manager $moduleManager | ||
* @param Config $cacheConfig | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\App\RequestInterface $request, | ||
\Magento\Framework\Module\Manager $moduleManager, | ||
Config $cacheConfig | ||
) { | ||
$this->request = $request; | ||
$this->moduleManager = $moduleManager; | ||
$this->cacheConfig = $cacheConfig; | ||
} | ||
|
||
/** | ||
* Check if depersonalize or not | ||
* | ||
* @param \Magento\Framework\View\LayoutInterface $subject | ||
* @return bool | ||
*/ | ||
public function checkIfDepersonalize(\Magento\Framework\View\LayoutInterface $subject) | ||
{ | ||
return ($this->moduleManager->isEnabled('Magento_PageCache') | ||
&& $this->cacheConfig->isEnabled() | ||
&& !$this->request->isAjax() | ||
&& ($this->request->isGet() || $this->request->isHead()) | ||
&& $subject->isCacheable()); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.