Skip to content

Commit

Permalink
Merge branch 'develop' of github.scm.corp.ebay.com:magento2/magento2c…
Browse files Browse the repository at this point in the history
…e into MAGETWO-29363-Refactor-SOAP-code-to-get-version-from-route-URL

Conflicts:
	app/code/Magento/Bundle/composer.json
	app/code/Magento/ConfigurableProduct/composer.json
	app/code/Magento/Webapi/composer.json
  • Loading branch information
Cari Spruiell committed Feb 27, 2015
1 parent c57127d commit a6dee61
Show file tree
Hide file tree
Showing 1,530 changed files with 20,218 additions and 15,568 deletions.
71 changes: 61 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ module.exports = function (grunt) {
tmpSource: 'var/view_preprocessed/source/',
tmp: 'var',
css: {
setup: 'setup/pub/magento/setup/css'
setup: 'setup/pub/styles'
},
less: {
setup: 'setup/module/Magento/Setup/styles'
setup: 'setup/view/styles'
},
uglify: {
legacy: 'lib/web/legacy-build.min.js'
Expand Down Expand Up @@ -126,6 +126,23 @@ module.exports = function (grunt) {
}
};

// Banners
// ---------------------------------------------

var banner = {
firstLine: 'Copyright © <%= grunt.template.today("yyyy") %> Magento. All rights reserved.',
secondLine: 'See COPYING.txt for license details.',
css: function(){
return '/**\n * ' + this.firstLine + '\n * ' + this.secondLine + '\n */\n';
},
less: function(){
return '// /**\n// * ' + this.firstLine + '\n// * ' + this.secondLine + '\n// */\n';
},
html: function(){
return '<!--\n/**\n * ' + this.firstLine + '\n * ' + this.secondLine + '\n */\n-->\n';
}
};

// Tasks
// _____________________________________________

Expand All @@ -135,6 +152,7 @@ module.exports = function (grunt) {
path: path,
theme: theme,
combo: combo,
banner: banner,

// Execution into cmd
// ---------------------------------------------
Expand Down Expand Up @@ -343,21 +361,48 @@ module.exports = function (grunt) {
}
},

// Concatenation
// Banners
// ---------------------------------------------

concat: {
usebanner: {
options: {
stripBanners: true,
banner: '/**\n * Copyright © <%= grunt.template.today("yyyy") %> Magento. All rights reserved.\n * See COPYING.txt for license details.\n */\n'
position: 'top',
linebreak: true
},
setup: {
src: '<%= path.css.setup %>/setup.css',
dest: '<%= path.css.setup %>/setup.css'
options: {
banner: banner.css()
},
files: {
src: '<%= path.css.setup %>/*.css'
}
},
documentationCss: {
options: {
banner: banner.css()
},
files: {
src: '<%= path.doc %>/**/*.css'
}
},
documentationLess: {
options: {
banner: banner.less()
},
files: {
src: '<%= path.doc %>/**/*.less'
}
},
documentationHtml: {
options: {
banner: banner.html()
},
files: {
src: '<%= path.doc %>/**/*.html'
}
}
},


// Watches files for changes and runs tasks based on the changed files
// ---------------------------------------------

Expand Down Expand Up @@ -552,6 +597,12 @@ module.exports = function (grunt) {
'clean:pub'
]);

grunt.registerTask('documentation-banners', [
'usebanner:documentationCss',
'usebanner:documentationLess',
'usebanner:documentationHtml'
]);

// Production
// ---------------------------------------------

Expand All @@ -561,7 +612,7 @@ module.exports = function (grunt) {
'less:' + component,
'autoprefixer:' + component,
'cssmin:' + component,
'concat:' + component
'usebanner:' + component
]);
}
if (component == undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function execute()
$notificationId
);
$this->messageManager->addSuccess(__('The message has been marked as Read.'));
} catch (\Magento\Framework\Model\Exception $e) {
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function execute()
$this->messageManager->addSuccess(
__('A total of %1 record(s) have been marked as Read.', count($ids))
);
} catch (\Magento\Framework\Model\Exception $e) {
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function execute()
}
}
$this->messageManager->addSuccess(__('Total of %1 record(s) have been removed.', count($ids)));
} catch (\Magento\Framework\Model\Exception $e) {
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function execute()
try {
$model->setIsRemove(1)->save();
$this->messageManager->addSuccess(__('The message has been removed.'));
} catch (\Magento\Framework\Model\Exception $e) {
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
} catch (\Exception $e) {
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
Expand Down
40 changes: 33 additions & 7 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* AdminNotification Feed model
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Feed extends \Magento\Framework\Model\AbstractModel
{
Expand Down Expand Up @@ -50,16 +51,29 @@ class Feed extends \Magento\Framework\Model\AbstractModel
*/
protected $_deploymentConfig;

/**
* @var \Magento\Framework\App\ProductMetadataInterface
*/
protected $productMetadata;

/**
* @var \Magento\Framework\UrlInterface
*/
protected $urlBuilder;

/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Backend\App\ConfigInterface $backendConfig
* @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param InboxFactory $inboxFactory
* @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory
* @param \Magento\Framework\App\DeploymentConfig $deploymentConfig
* @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
* @param \Magento\Framework\UrlInterface $urlBuilder
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
* @param \Magento\Framework\HTTP\Adapter\curlFactory $curlFactory
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Framework\Model\Context $context,
Expand All @@ -68,15 +82,19 @@ public function __construct(
\Magento\AdminNotification\Model\InboxFactory $inboxFactory,
\Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory,
\Magento\Framework\App\DeploymentConfig $deploymentConfig,
\Magento\Framework\App\ProductMetadataInterface $productMetadata,
\Magento\Framework\UrlInterface $urlBuilder,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
array $data = []
) {
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
$this->_backendConfig = $backendConfig;
$this->_inboxFactory = $inboxFactory;
$this->curlFactory = $curlFactory;
$this->_backendConfig = $backendConfig;
$this->_inboxFactory = $inboxFactory;
$this->curlFactory = $curlFactory;
$this->_deploymentConfig = $deploymentConfig;
$this->productMetadata = $productMetadata;
$this->urlBuilder = $urlBuilder;
}

/**
Expand Down Expand Up @@ -191,7 +209,15 @@ public function setLastUpdate()
public function getFeedData()
{
$curl = $this->curlFactory->create();
$curl->setConfig(['timeout' => 2]);
$curl->setConfig(
[
'timeout' => 2,
'useragent' => $this->productMetadata->getName()
. '/' . $this->productMetadata->getVersion()
. ' (' . $this->productMetadata->getEdition() . ')',
'referer' => $this->urlBuilder->getUrl('*/*/*')
]
);
$curl->write(\Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
$data = $curl->read();
if ($data === false) {
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ public function parse(array $data)
* @param string|string[] $description
* @param string $url
* @param bool $isInternal
* @throws \Magento\Framework\Model\Exception
* @throws \Magento\Framework\Exception\LocalizedException
* @return $this
*/
public function add($severity, $title, $description, $url = '', $isInternal = true)
{
if (!$this->getSeverities($severity)) {
throw new \Magento\Framework\Model\Exception(__('Wrong message type'));
throw new \Magento\Framework\Exception\LocalizedException(__('Wrong message type'));
}
if (is_array($description)) {
$description = '<ul><li>' . implode('</li><li>', $description) . '</li></ul>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public function __construct(\Magento\AdminNotification\Model\InboxFactory $notif
*
* @param int $notificationId
* @return void
* @throws \Magento\Framework\Model\Exception
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function markAsRead($notificationId)
{
$notification = $this->_notificationFactory->create();
$notification->load($notificationId);
if (!$notification->getId()) {
throw new \Magento\Framework\Model\Exception('Wrong notification ID specified.');
throw new \Magento\Framework\Exception\LocalizedException(__('Wrong notification ID specified.'));
}
$notification->setIsRead(1);
$notification->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function _getConfigUrl()
) {
$output = $this->_urlBuilder->getUrl('adminhtml/system_config/edit', ['section' => 'web']);
} else {
/** @var $dataCollection \Magento\Core\Model\Resource\Config\Data\Collection */
/** @var $dataCollection \Magento\Config\Model\Resource\Config\Data\Collection */
$dataCollection = $this->_configValueFactory->create()->getCollection();
$dataCollection->addValueFilter(\Magento\Store\Model\Store::BASE_URL_PLACEHOLDER);

Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/AdminNotification/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/system_file.xsd">
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd">
<system>
<section id="system">
<group id="adminnotification" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Notifications</label>
<field id="use_https" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Use HTTPS to Get Feed</label>
<source_model>Magento\Backend\Model\Config\Source\Yesno</source_model>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="frequency" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Update Frequency</label>
<source_model>Magento\AdminNotification\Model\Config\Source\Frequency</source_model>
</field>
<field id="last_update" translate="label" type="label" sortOrder="3" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Last Update</label>
<frontend_model>Magento\Backend\Block\System\Config\Form\Field\Notification</frontend_model>
<frontend_model>Magento\Config\Block\System\Config\Form\Field\Notification</frontend_model>
</field>
</group>
</section>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<default>
<system>
<adminnotification>
<feed_url>notifications.magentocommerce.com/community/notifications.rss</feed_url>
<feed_url>notifications.magentocommerce.com/magento2/community/notifications.rss</feed_url>
<popup_url>widgets.magentocommerce.com/notificationPopup</popup_url>
<severity_icons_url>widgets.magentocommerce.com/%s/%s.gif</severity_icons_url>
<use_https>0</use_https>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/Model/Acl/AclRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getAllowedResourcesByUser($userType, $userId)
} catch (\Exception $e) {
$this->logger->critical($e);
throw new LocalizedException(
'Error happened while getting a list of allowed resources. Check exception log for details.'
__('Error happened while getting a list of allowed resources. Check exception log for details.')
);
}
return $allowedResources;
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Authorization/Model/Resource/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function _construct()
*
* @param \Magento\Authorization\Model\Rules $rule
* @return void
* @throws \Magento\Framework\Model\Exception
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function saveRel(\Magento\Authorization\Model\Rules $rule)
{
Expand Down Expand Up @@ -115,7 +115,7 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)

$adapter->commit();
$this->_aclCache->clean();
} catch (\Magento\Framework\Model\Exception $e) {
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$adapter->rollBack();
throw $e;
} catch (\Exception $e) {
Expand Down
5 changes: 3 additions & 2 deletions app/code/Magento/Backend/App/Action/Plugin/Authentication.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
/**
*
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Backend\App\Action\Plugin;

use Magento\Framework\Exception\AuthenticationException;

class Authentication
{
/**
Expand Down Expand Up @@ -167,7 +168,7 @@ protected function _performLogin(\Magento\Framework\App\RequestInterface $reques

try {
$this->_auth->login($username, $password);
} catch (\Magento\Backend\Model\Auth\Exception $e) {
} catch (AuthenticationException $e) {
if (!$request->getParam('messageSent')) {
$this->messageManager->addError($e->getMessage());
$request->setParam('messageSent', true);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/App/UserConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
namespace Magento\Backend\App;

use Magento\Backend\Model\Config\Factory;
use Magento\Config\Model\Config\Factory;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\Console\Response;
use Magento\Framework\AppInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Reset extends \Magento\Backend\Block\System\Config\Form\Field
class Reset extends \Magento\Config\Block\System\Config\Form\Field
{
/**
* Pasge robots default instructions
Expand All @@ -39,7 +39,7 @@ public function __construct(
protected function _construct()
{
parent::_construct();
$this->setTemplate('page/system/config/robots/reset.phtml');
$this->setTemplate('Magento_Config::page/system/config/robots/reset.phtml');
}

/**
Expand Down
Loading

0 comments on commit a6dee61

Please sign in to comment.