Skip to content

Commit a525495

Browse files
author
Pavlo Cherniavskyi
committed
Merge branch 'develop-mainline' into develop
2 parents 0d6179e + d1a0d51 commit a525495

File tree

520 files changed

+2416
-1815
lines changed

Some content is hidden

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

520 files changed

+2416
-1815
lines changed

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* AdminNotification Feed model
1010
*
1111
* @author Magento Core Team <core@magentocommerce.com>
12+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1213
*/
1314
class Feed extends \Magento\Framework\Model\AbstractModel
1415
{
@@ -50,16 +51,29 @@ class Feed extends \Magento\Framework\Model\AbstractModel
5051
*/
5152
protected $_deploymentConfig;
5253

54+
/**
55+
* @var \Magento\Framework\App\ProductMetadataInterface
56+
*/
57+
protected $productMetadata;
58+
59+
/**
60+
* @var \Magento\Framework\UrlInterface
61+
*/
62+
protected $urlBuilder;
63+
5364
/**
5465
* @param \Magento\Framework\Model\Context $context
5566
* @param \Magento\Framework\Registry $registry
5667
* @param \Magento\Backend\App\ConfigInterface $backendConfig
57-
* @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory
58-
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
68+
* @param InboxFactory $inboxFactory
69+
* @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory
5970
* @param \Magento\Framework\App\DeploymentConfig $deploymentConfig
71+
* @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
72+
* @param \Magento\Framework\UrlInterface $urlBuilder
73+
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
6074
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
61-
* @param \Magento\Framework\HTTP\Adapter\curlFactory $curlFactory
6275
* @param array $data
76+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6377
*/
6478
public function __construct(
6579
\Magento\Framework\Model\Context $context,
@@ -68,15 +82,19 @@ public function __construct(
6882
\Magento\AdminNotification\Model\InboxFactory $inboxFactory,
6983
\Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory,
7084
\Magento\Framework\App\DeploymentConfig $deploymentConfig,
85+
\Magento\Framework\App\ProductMetadataInterface $productMetadata,
86+
\Magento\Framework\UrlInterface $urlBuilder,
7187
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
7288
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
7389
array $data = []
7490
) {
7591
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
76-
$this->_backendConfig = $backendConfig;
77-
$this->_inboxFactory = $inboxFactory;
78-
$this->curlFactory = $curlFactory;
92+
$this->_backendConfig = $backendConfig;
93+
$this->_inboxFactory = $inboxFactory;
94+
$this->curlFactory = $curlFactory;
7995
$this->_deploymentConfig = $deploymentConfig;
96+
$this->productMetadata = $productMetadata;
97+
$this->urlBuilder = $urlBuilder;
8098
}
8199

82100
/**
@@ -191,7 +209,15 @@ public function setLastUpdate()
191209
public function getFeedData()
192210
{
193211
$curl = $this->curlFactory->create();
194-
$curl->setConfig(['timeout' => 2]);
212+
$curl->setConfig(
213+
[
214+
'timeout' => 2,
215+
'useragent' => $this->productMetadata->getName()
216+
. '/' . $this->productMetadata->getVersion()
217+
. ' (' . $this->productMetadata->getEdition() . ')',
218+
'referer' => $this->urlBuilder->getUrl('*/*/*')
219+
]
220+
);
195221
$curl->write(\Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
196222
$data = $curl->read();
197223
if ($data === false) {

app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function _getConfigUrl()
6767
) {
6868
$output = $this->_urlBuilder->getUrl('adminhtml/system_config/edit', ['section' => 'web']);
6969
} else {
70-
/** @var $dataCollection \Magento\Core\Model\Resource\Config\Data\Collection */
70+
/** @var $dataCollection \Magento\Config\Model\Resource\Config\Data\Collection */
7171
$dataCollection = $this->_configValueFactory->create()->getCollection();
7272
$dataCollection->addValueFilter(\Magento\Store\Model\Store::BASE_URL_PLACEHOLDER);
7373

app/code/Magento/AdminNotification/etc/adminhtml/system.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/system_file.xsd">
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd">
99
<system>
1010
<section id="system">
1111
<group id="adminnotification" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="0" showInStore="0">
1212
<label>Notifications</label>
1313
<field id="use_https" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
1414
<label>Use HTTPS to Get Feed</label>
15-
<source_model>Magento\Backend\Model\Config\Source\Yesno</source_model>
15+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1616
</field>
1717
<field id="frequency" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
1818
<label>Update Frequency</label>
1919
<source_model>Magento\AdminNotification\Model\Config\Source\Frequency</source_model>
2020
</field>
2121
<field id="last_update" translate="label" type="label" sortOrder="3" showInDefault="1" showInWebsite="0" showInStore="0">
2222
<label>Last Update</label>
23-
<frontend_model>Magento\Backend\Block\System\Config\Form\Field\Notification</frontend_model>
23+
<frontend_model>Magento\Config\Block\System\Config\Form\Field\Notification</frontend_model>
2424
</field>
2525
</group>
2626
</section>

app/code/Magento/AdminNotification/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<default>
1010
<system>
1111
<adminnotification>
12-
<feed_url>notifications.magentocommerce.com/community/notifications.rss</feed_url>
12+
<feed_url>notifications.magentocommerce.com/magento2/community/notifications.rss</feed_url>
1313
<popup_url>widgets.magentocommerce.com/notificationPopup</popup_url>
1414
<severity_icons_url>widgets.magentocommerce.com/%s/%s.gif</severity_icons_url>
1515
<use_https>0</use_https>

app/code/Magento/Backend/App/UserConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
namespace Magento\Backend\App;
99

10-
use Magento\Backend\Model\Config\Factory;
10+
use Magento\Config\Model\Config\Factory;
1111
use Magento\Framework\App\Bootstrap;
1212
use Magento\Framework\App\Console\Response;
1313
use Magento\Framework\AppInterface;

app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @author Magento Core Team <core@magentocommerce.com>
1515
*/
16-
class Reset extends \Magento\Backend\Block\System\Config\Form\Field
16+
class Reset extends \Magento\Config\Block\System\Config\Form\Field
1717
{
1818
/**
1919
* Pasge robots default instructions
@@ -39,7 +39,7 @@ public function __construct(
3939
protected function _construct()
4040
{
4141
parent::_construct();
42-
$this->setTemplate('page/system/config/robots/reset.phtml');
42+
$this->setTemplate('Magento_Config::page/system/config/robots/reset.phtml');
4343
}
4444

4545
/**

app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Dependence extends \Magento\Backend\Block\AbstractBlock
4040
protected $_configOptions = [];
4141

4242
/**
43-
* @var \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory
43+
* @var \Magento\Config\Model\Config\Structure\Element\Dependency\FieldFactory
4444
*/
4545
protected $_fieldFactory;
4646

@@ -52,13 +52,13 @@ class Dependence extends \Magento\Backend\Block\AbstractBlock
5252
/**
5353
* @param \Magento\Backend\Block\Context $context
5454
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
55-
* @param \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory
55+
* @param \Magento\Config\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory
5656
* @param array $data
5757
*/
5858
public function __construct(
5959
\Magento\Backend\Block\Context $context,
6060
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
61-
\Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory,
61+
\Magento\Config\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory,
6262
array $data = []
6363
) {
6464
$this->_jsonEncoder = $jsonEncoder;
@@ -84,13 +84,13 @@ public function addFieldMap($fieldId, $fieldName)
8484
*
8585
* @param string $fieldName
8686
* @param string $fieldNameFrom
87-
* @param \Magento\Backend\Model\Config\Structure\Element\Dependency\Field|string $refField
87+
* @param \Magento\Config\Model\Config\Structure\Element\Dependency\Field|string $refField
8888
* @return \Magento\Backend\Block\Widget\Form\Element\Dependence
8989
*/
9090
public function addFieldDependence($fieldName, $fieldNameFrom, $refField)
9191
{
9292
if (!is_object($refField)) {
93-
/** @var $refField \Magento\Backend\Model\Config\Structure\Element\Dependency\Field */
93+
/** @var $refField \Magento\Config\Model\Config\Structure\Element\Dependency\Field */
9494
$refField = $this->_fieldFactory->create(
9595
['fieldData' => ['value' => (string)$refField], 'fieldPrefix' => '']
9696
);
@@ -139,7 +139,7 @@ protected function _getDependsJson()
139139
$result = [];
140140
foreach ($this->_depends as $to => $row) {
141141
foreach ($row as $from => $field) {
142-
/** @var $field \Magento\Backend\Model\Config\Structure\Element\Dependency\Field */
142+
/** @var $field \Magento\Config\Model\Config\Structure\Element\Dependency\Field */
143143
$result[$this->_fields[$to]][$this->_fields[$from]] = [
144144
'values' => $field->getValues(),
145145
'negative' => $field->isNegative(),

app/code/Magento/Backend/Model/Config/Structure/Element/Iterator/Group.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/code/Magento/Backend/Model/Config/Structure/Element/Iterator/Section.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/code/Magento/Backend/Model/Config/Structure/Element/Iterator/Tab.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)