Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/MAGETWO-33873-Store-Constant' in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
Joan He committed Feb 26, 2015
2 parents d511960 + c033911 commit 4e46722
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/code/Magento/Store/App/Action/Plugin/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Magento\Store\App\Action\Plugin;

use Magento\Framework\App\Http\Context as HttpContext;
use Magento\Store\Model\StoreManagerInterface;

/**
* Class ContextPlugin
Expand Down Expand Up @@ -71,7 +72,7 @@ public function aroundDispatch(
);

$this->httpContext->setValue(
HttpContext::CONTEXT_STORE,
StoreManagerInterface::CONTEXT_STORE,
$this->httpRequest->getParam(
'___store',
$defaultStore->getStoreCodeFromCookie()
Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Store/Model/StoreManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

interface StoreManagerInterface
{
/**
* Store cache context
*/
const CONTEXT_STORE = 'store';

/**
* Allow or disallow single store mode
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
['CONTEXT_AUTH', 'Magento\Customer\Helper\Data', 'Magento\Customer\Model\Context::CONTEXT_AUTH'],
['CONTEXT_CURRENCY', 'Magento\Customer\Helper\Data', 'Magento\Framework\App\Http\Context::CONTEXT_CURRENCY'],
['CONTEXT_GROUP', 'Magento\Customer\Helper\Data', 'Magento\Customer\Model\Context::CONTEXT_GROUP'],
['CONTEXT_STORE', 'Magento\Customer\Helper\Data', 'Magento\Framework\App\Http\Context::CONTEXT_STORE'],
['CONTEXT_STORE', 'Magento\Customer\Helper\Data', 'Magento\Store\Model\StoreManagerInterface::CONTEXT_STORE'],
['DEBUG_CONNECT', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_CONNECT'],
['DEBUG_TRANSACTION', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_TRANSACTION'],
['DEBUG_QUERY', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_QUERY'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Magento\Store\App\Action\Plugin;
use Magento\Framework\App\Http\Context;
use Magento\Store\Model\StoreManagerInterface;

/**
* Class ContextPluginTest
Expand Down Expand Up @@ -133,7 +134,7 @@ public function testAroundDispatch()
->method('setValue')
->will($this->returnValueMap([
[Context::CONTEXT_CURRENCY, 'UAH', 'UAH', $this->httpContextMock],
[Context::CONTEXT_STORE, 'default', 'default', $this->httpContextMock],
[StoreManagerInterface::CONTEXT_STORE, 'default', 'default', $this->httpContextMock],
]));
$this->assertEquals(
'ExpectedValue',
Expand Down
4 changes: 0 additions & 4 deletions lib/internal/Magento/Framework/App/Http/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ class Context
* Currency cache context
*/
const CONTEXT_CURRENCY = 'current_currency';
/**
* Store cache context
*/
const CONTEXT_STORE = 'store';

/**
* Data storage
Expand Down

0 comments on commit 4e46722

Please sign in to comment.