Skip to content

Commit da67b9d

Browse files
author
Karpenko, Oleksandr
committed
Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-52958-2
2 parents 329bdb2 + 941a525 commit da67b9d

File tree

665 files changed

+10590
-2750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

665 files changed

+10590
-2750
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
/.settings
66
atlassian*
77
/nbproject
8+
/robots.txt
9+
/pub/robots.txt
810
/sitemap
911
/sitemap.xml
12+
/pub/sitemap
13+
/pub/sitemap.xml
1014
/.idea
1115
/.gitattributes
1216
/app/config_sandbox
@@ -41,6 +45,7 @@ atlassian*
4145
!/pub/media/customer/.htaccess
4246
/pub/media/downloadable/*
4347
!/pub/media/downloadable/.htaccess
48+
/pub/media/favicon/*
4449
/pub/media/import/*
4550
!/pub/media/import/.htaccess
4651
/pub/media/theme/*

.travis.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ addons:
99
- postfix
1010
language: php
1111
php:
12-
- 5.6.29
1312
- 7.0
1413
env:
1514
global:
@@ -30,12 +29,6 @@ cache:
3029
- $HOME/.nvm
3130
- $HOME/node_modules
3231
- $HOME/yarn.lock
33-
matrix:
34-
exclude:
35-
- php: 5.6.29
36-
env: TEST_SUITE=static
37-
- php: 5.6.29
38-
env: TEST_SUITE=js
3932
before_install: ./dev/travis/before_install.sh
4033
install: composer install --no-interaction --prefer-dist
4134
before_script: ./dev/travis/before_script.sh

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
66
Please see LICENSE.txt for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy.
77

88
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
9-
Please see <insert file name of the MEE license> for the full text of the MEE License or visit http://magento.com/legal/terms/enterprise.
9+
Please see LICENSE_EE.txt for the full text of the MEE License or visit http://magento.com/legal/terms/enterprise.

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,33 @@ To suggest documentation improvements, click [here][4].
2727
[3]: <https://github.com/magento/magento2/issues>
2828
[4]: <http://devdocs.magento.com>
2929

30+
<h3>Labels applied by the Magento team</h3>
31+
32+
| Label | Description |
33+
| ------------- |-------------|
34+
| ![DOC](http://devdocs.magento.com/common/images/github_DOC.png) | Affects Documentation domain. |
35+
| ![PROD](http://devdocs.magento.com/common/images/github_PROD.png) | Affects the Product team (mostly feature requests or business logic change). |
36+
| ![TECH](http://devdocs.magento.com/common/images/github_TECH.png) | Affects Architect Group (mostly to make decisions around technology changes). |
37+
| ![accept](http://devdocs.magento.com/common/images/github_accept.png) | The pull request has been accepted and will be merged into mainline code. |
38+
| ![reject](http://devdocs.magento.com/common/images/github_reject.png) | The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution. |
39+
| ![bug report](http://devdocs.magento.com/common/images/github_bug.png) | The Magento Team has confirmed that this issue contains the minimum required information to reproduce. |
40+
| ![acknowledged](http://devdocs.magento.com/common/images/gitHub_acknowledged.png) | The Magento Team has validated the issue and an internal ticket has been created. |
41+
| ![acknowledged](http://devdocs.magento.com/common/images/github_inProgress.png) | The internal ticket is currently in progress, fix is scheduled to be delivered. |
42+
| ![acknowledged](http://devdocs.magento.com/common/images/github_needsUpdate.png) | The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request. |
43+
3044
<h2>Reporting security issues</h2>
3145

3246
To report security vulnerabilities in Magento software or web sites, please e-mail <a href="mailto:security@magento.com">security@magento.com</a>. Please do not report security issues using GitHub. Be sure to encrypt your e-mail with our <a href="https://info2.magento.com/rs/magentoenterprise/images/security_at_magento.asc">encryption key</a> if it includes sensitive information. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.
3347

34-
Stay up-to-date on the latest vulnerabilities and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.
48+
Stay up-to-date on the latest security news and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.
49+
50+
<h2>License</h2>
51+
52+
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
53+
54+
http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
55+
Please see LICENSE.txt for the full text of the OSL 3.0 license or contact license@magentocommerce.com for a copy.
56+
57+
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
58+
Please see LICENSE_EE.txt for the full text of the MEE License or visit http://magento.com/legal/terms/enterprise.
3559

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Activate.php

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@
66

77
namespace Magento\Analytics\Controller\Adminhtml\Subscription;
88

9+
use Magento\Analytics\Model\Config\Backend\Enabled;
910
use Magento\Analytics\Model\NotificationTime;
10-
use Magento\Analytics\Model\Subscription;
1111
use Magento\Backend\App\Action;
1212
use Magento\Backend\App\Action\Context;
13+
use Magento\Config\Model\Config\Source\Enabledisable;
14+
use Magento\Config\Model\PreparedValueFactory;
15+
use Magento\Framework\App\Config\ScopeConfigInterface;
1316
use Magento\Framework\Controller\Result\Json;
1417
use Magento\Framework\Controller\ResultFactory;
1518
use Magento\Framework\Exception\LocalizedException;
19+
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
1620
use Psr\Log\LoggerInterface;
1721

1822
/**
1923
* Activates subscription to Magento BI Advanced Reporting.
2024
*/
2125
class Activate extends Action
2226
{
23-
/**
24-
* Resource for managing subscription to Magento BI.
25-
*
26-
* @var Subscription
27-
*/
28-
private $subscription;
29-
3027
/**
3128
* @var LoggerInterface
3229
*/
@@ -46,23 +43,36 @@ class Activate extends Action
4643
*/
4744
private $subscriptionApprovedField = 'analytics_subscription_checkbox';
4845

46+
/**
47+
* @var AbstractDb
48+
*/
49+
private $configValueResource;
50+
51+
/**
52+
* @var PreparedValueFactory
53+
*/
54+
private $preparedValueFactory;
55+
4956
/**
5057
* Activate constructor.
5158
*
5259
* @param Context $context
53-
* @param Subscription $subscription
5460
* @param LoggerInterface $logger
5561
* @param NotificationTime $notificationTime
62+
* @param AbstractDb $configValueResource
63+
* @param PreparedValueFactory $preparedValueFactory
5664
*/
5765
public function __construct(
5866
Context $context,
59-
Subscription $subscription,
6067
LoggerInterface $logger,
61-
NotificationTime $notificationTime
68+
NotificationTime $notificationTime,
69+
AbstractDb $configValueResource,
70+
PreparedValueFactory $preparedValueFactory
6271
) {
63-
$this->subscription = $subscription;
6472
$this->logger = $logger;
6573
$this->notificationTime = $notificationTime;
74+
$this->configValueResource = $configValueResource;
75+
$this->preparedValueFactory = $preparedValueFactory;
6676
parent::__construct($context);
6777
}
6878

@@ -85,7 +95,14 @@ public function execute()
8595
{
8696
try {
8797
if ($this->getRequest()->getParam($this->subscriptionApprovedField)) {
88-
$this->subscription->enable();
98+
$configValue = $this->preparedValueFactory->create(
99+
Enabled::XML_ENABLED_CONFIG_STRUCTURE_PATH,
100+
Enabledisable::ENABLE_VALUE,
101+
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
102+
);
103+
104+
$this->configValueResource
105+
->save($configValue);
89106
} else {
90107
$this->notificationTime->unsetLastTimeNotificationValue();
91108
}

app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Retry.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Magento\Analytics\Controller\Adminhtml\Subscription;
88

9-
use Magento\Analytics\Model\Subscription;
9+
use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler;
1010
use Magento\Backend\App\Action;
1111
use Magento\Backend\App\Action\Context;
1212
use Magento\Framework\Controller\Result\Redirect;
@@ -21,19 +21,19 @@ class Retry extends Action
2121
/**
2222
* Resource for managing subscription to Magento Analytics.
2323
*
24-
* @var Subscription
24+
* @var SubscriptionHandler
2525
*/
26-
private $subscription;
26+
private $subscriptionHandler;
2727

2828
/**
2929
* @param Context $context
30-
* @param Subscription $subscription
30+
* @param SubscriptionHandler $subscriptionHandler
3131
*/
3232
public function __construct(
3333
Context $context,
34-
Subscription $subscription
34+
SubscriptionHandler $subscriptionHandler
3535
) {
36-
$this->subscription = $subscription;
36+
$this->subscriptionHandler = $subscriptionHandler;
3737
parent::__construct($context);
3838
}
3939

@@ -58,7 +58,7 @@ public function execute()
5858
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
5959
try {
6060
$resultRedirect->setPath('adminhtml');
61-
$this->subscription->retry();
61+
$this->subscriptionHandler->processEnabled();
6262
} catch (LocalizedException $e) {
6363
$this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
6464
} catch (\Exception $e) {

app/code/Magento/Analytics/Model/Config/Backend/Enabled.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
*/
2121
class Enabled extends Value
2222
{
23+
/**
24+
* Path to field subscription enabled into config structure.
25+
*/
26+
const XML_ENABLED_CONFIG_STRUCTURE_PATH = 'analytics/general/enabled';
27+
2328
/**
2429
* Service for processing of activation/deactivation MBI subscription.
2530
*

app/code/Magento/Analytics/Model/Config/Backend/Enabled/SubscriptionHandler.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
use Magento\Analytics\Model\AnalyticsToken;
99
use Magento\Analytics\Model\Config\Backend\CollectionTime;
1010
use Magento\Analytics\Model\NotificationTime;
11-
use Magento\Framework\FlagManager;
11+
use Magento\Framework\App\Config\ReinitableConfigInterface;
1212
use Magento\Framework\App\Config\Storage\WriterInterface;
13+
use Magento\Framework\FlagManager;
1314

1415
/**
1516
* Class for processing of activation/deactivation MBI subscription.
@@ -61,22 +62,30 @@ class SubscriptionHandler
6162
*/
6263
private $notificationTime;
6364

65+
/**
66+
* @var ReinitableConfigInterface
67+
*/
68+
private $reinitableConfig;
69+
6470
/**
6571
* @param WriterInterface $configWriter
6672
* @param FlagManager $flagManager
6773
* @param AnalyticsToken $analyticsToken
6874
* @param NotificationTime $notificationTime
75+
* @param ReinitableConfigInterface $reinitableConfig
6976
*/
7077
public function __construct(
7178
WriterInterface $configWriter,
7279
FlagManager $flagManager,
7380
AnalyticsToken $analyticsToken,
74-
NotificationTime $notificationTime
81+
NotificationTime $notificationTime,
82+
ReinitableConfigInterface $reinitableConfig
7583
) {
7684
$this->configWriter = $configWriter;
7785
$this->flagManager = $flagManager;
7886
$this->analyticsToken = $analyticsToken;
7987
$this->notificationTime = $notificationTime;
88+
$this->reinitableConfig = $reinitableConfig;
8089
}
8190

8291
/**
@@ -92,6 +101,7 @@ public function processEnabled()
92101
$this->setCronSchedule();
93102
$this->setAttemptsFlag();
94103
$this->notificationTime->unsetLastTimeNotificationValue();
104+
$this->reinitableConfig->reinit();
95105
}
96106

97107
return true;

app/code/Magento/Analytics/Model/Connector/CommandInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ interface CommandInterface
1414
/**
1515
* Execute call to external service
1616
* Information about destination and arguments appears from config
17-
* @return void
17+
*
18+
* @return bool
1819
*/
1920
public function execute();
2021
}

0 commit comments

Comments
 (0)