Skip to content

Commit 87afe0b

Browse files
author
Dale Sikkema
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-40265-exposed-resources
2 parents 6a024f1 + bc104f0 commit 87afe0b

File tree

3,361 files changed

+57213
-43350
lines changed

Some content is hidden

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

3,361 files changed

+57213
-43350
lines changed

.php_cs

-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ $finder = Symfony\CS\Finder\DefaultFinder::create()
1717
->exclude('dev/tests/integration/var')
1818
->exclude('lib/internal/Cm')
1919
->exclude('lib/internal/Credis')
20-
->exclude('lib/internal/JSMin')
2120
->exclude('lib/internal/Less')
2221
->exclude('lib/internal/LinLibertineFont')
23-
->exclude('lib/internal/phpseclib')
2422
->exclude('pub/media')
2523
->exclude('pub/static')
2624
->exclude('setup/vendor')

Gruntfile.js

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ module.exports = function (grunt) {
1515
[
1616
taskDir + '/mage-minify',
1717
taskDir + '/deploy',
18+
taskDir + '/black-list-generator',
19+
taskDir + '/clean-black-list',
20+
taskDir + '/static',
1821
'time-grunt'
1922
].forEach(function (task) {
2023
require(task)(grunt);

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
<h2>Welcome</h2>
44
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.
55

6-
The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the <a href="http://devdocs.magento.com/guides/v1.0/install-gde/bk-install-guide.html" target="_blank">guide</a>.
6+
The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the <a href="http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html" target="_blank">guide</a>.
77

88
<h2>New to Magento? Need some help?</h2>
99
If you're not sure about the following, you probably need a little help before you start installing the Magento software:
1010

11-
* Is the Magento software <a href="http://devdocs.magento.com/guides/v1.0/install-gde/basics/basics_magento-installed.html">installed already</a>?
12-
* What's a <a href="http://devdocs.magento.com/guides/v1.0/install-gde/basics/basics_login.html">terminal, command prompt, or Secure Shell (ssh)</a>?
13-
* Where's my <a href="http://devdocs.magento.com/guides/v1.0/install-gde/basics/basics_login.html">Magento server</a> and how do I access it?
14-
* What's <a href="http://devdocs.magento.com/guides/v1.0/install-gde/basics/basics_software.html">PHP</a>?
15-
* What's <a href="http://devdocs.magento.com/guides/v1.0/install-gde/basics/basics_software.html">Apache</a>?
16-
* What's <a href="http://devdocs.magento.com/guides/v1.0/install-gde/basics/basics_software.html">MySQL</a>?
11+
* Is the Magento software <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_magento-installed.html">installed already</a>?
12+
* What's a <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_login.html">terminal, command prompt, or Secure Shell (ssh)</a>?
13+
* Where's my <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_login.html">Magento server</a> and how do I access it?
14+
* What's <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_software.html">PHP</a>?
15+
* What's <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_software.html">Apache</a>?
16+
* What's <a href="http://devdocs.magento.com/guides/v2.0/install-gde/basics/basics_software.html">MySQL</a>?
1717

1818
<h2>Step 1: Verify your prerequisites</h2>
1919

@@ -30,16 +30,16 @@ Use the following table to verify you have the correct prerequisites to install
3030
<td>Apache 2.2 or 2.4</td>
3131
<td>Ubuntu: <code>apache2 -v</code><br>
3232
CentOS: <code>httpd -v</code></td>
33-
<td><a href="http://devdocs.magento.com/guides/v1.0/install-gde/prereq/apache.html">Apache</a></td>
33+
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/apache.html">Apache</a></td>
3434
</tr>
3535
<tr>
3636
<td>PHP 5.5.x or 5.6.x</td>
3737
<td><code>php -v</code></td>
38-
<td><a href="http://devdocs.magento.com/guides/v1.0/install-gde/prereq/php-ubuntu.html">PHP Ubuntu</a><br><a href="http://devdocs.magento.com/guides/v1.0/install-gde/prereq/php-centos.html">PHP CentOS</a></td>
38+
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-ubuntu.html">PHP Ubuntu</a><br><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html">PHP CentOS</a></td>
3939
</tr>
4040
<tr><td>MySQL 5.6.x</td>
4141
<td><code>mysql -u [root user name] -p</code></td>
42-
<td><a href="http://devdocs.magento.com/guides/v1.0/install-gde/prereq/mysql.html">MySQL</a></td>
42+
<td><a href="http://devdocs.magento.com/guides/v2.0/install-gde/prereq/mysql.html">MySQL</a></td>
4343
</tr>
4444
</tbody>
4545
</table>
@@ -48,16 +48,16 @@ Use the following table to verify you have the correct prerequisites to install
4848

4949
After verifying your prerequisites, perform the following tasks in order to prepare to install the Magento software.
5050

51-
1. <a href="http://devdocs.magento.com/guides/v1.0/install-gde/install/composer-clone.html#instgde-prereq-compose-install">Install Composer</a>
52-
2. <a href="http://devdocs.magento.com/guides/v1.0/install-gde/install/composer-clone.html#instgde-prereq-compose-clone">Clone the Magento repository</a>
51+
1. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/composer-clone.html#instgde-prereq-compose-install">Install Composer</a>
52+
2. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/composer-clone.html#instgde-prereq-compose-clone">Clone the Magento repository</a>
5353

5454
<h2>Step 3: Install and verify the installation</h2>
5555

56-
1. <a href="http://devdocs.magento.com/guides/v1.0/install-gde/install/prepare-install.html">Update installation dependencies</a>
56+
1. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/prepare-install.html">Update installation dependencies</a>
5757
2. Install Magento:
58-
* <a href="http://devdocs.magento.com/guides/v1.0/install-gde/install/install-web.html">Install Magento software using the web interface</a>
59-
* <a href="http://devdocs.magento.com/guides/v1.0/install-gde/install/install-cli.html">Install Magento software using the command line</a>
60-
2. <a href="http://devdocs.magento.com/guides/v1.0/install-gde/install/verify.html">Verify the installation</a>
58+
* <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/install-web.html">Install Magento software using the web interface</a>
59+
* <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/install-cli.html">Install Magento software using the command line</a>
60+
2. <a href="http://devdocs.magento.com/guides/v2.0/install-gde/install/verify.html">Verify the installation</a>
6161

6262
<h2>Contributing to the Magento 2 code base</h2>
6363
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
@@ -68,7 +68,7 @@ To learn about issues, click [here][2]. To open an issue, click [here][3].
6868

6969
To suggest documentation improvements, click [here][4].
7070

71-
[1]: <http://devdocs.magento.com/guides/v1.0/contributor-guide/CONTRIBUTING.html>
72-
[2]: <http://devdocs.magento.com/guides/v1.0/contributor-guide/CONTRIBUTING.html#report>
71+
[1]: <http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html>
72+
[2]: <http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#report>
7373
[3]: <https://github.com/magento/magento2/issues>
7474
[4]: <http://devdocs.magento.com>

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public function __construct(
3434
/**
3535
* Renders grid column
3636
*
37-
* @param \Magento\Framework\Object $row
37+
* @param \Magento\Framework\DataObject $row
3838
* @return string
3939
*/
40-
public function render(\Magento\Framework\Object $row)
40+
public function render(\Magento\Framework\DataObject $row)
4141
{
4242
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __(
4343
'Read Details'

app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstract
1212
/**
1313
* Renders grid column
1414
*
15-
* @param \Magento\Framework\Object $row
15+
* @param \Magento\Framework\DataObject $row
1616
* @return string
1717
*/
18-
public function render(\Magento\Framework\Object $row)
18+
public function render(\Magento\Framework\DataObject $row)
1919
{
2020
return '<span class="grid-row-title">' .
2121
$row->getTitle() .

app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public function __construct(
3333
/**
3434
* Renders grid column
3535
*
36-
* @param \Magento\Framework\Object $row
36+
* @param \Magento\Framework\DataObject $row
3737
* @return string
3838
*/
39-
public function render(\Magento\Framework\Object $row)
39+
public function render(\Magento\Framework\DataObject $row)
4040
{
4141
$class = '';
4242
$value = '';

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
namespace Magento\AdminNotification\Controller\Adminhtml;
99

10-
class Notification extends \Magento\Backend\App\AbstractAction
10+
abstract class Notification extends \Magento\Backend\App\AbstractAction
1111
{
1212
/**
1313
* @return bool

app/code/Magento/AdminNotification/Model/Resource/Inbox.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ protected function _construct()
3030
*/
3131
public function loadLatestNotice(\Magento\AdminNotification\Model\Inbox $object)
3232
{
33-
$adapter = $this->_getReadAdapter();
34-
$select = $adapter->select()->from(
33+
$connection = $this->getConnection();
34+
$select = $connection->select()->from(
3535
$this->getMainTable()
3636
)->order(
3737
$this->getIdFieldName() . ' DESC'
@@ -42,7 +42,7 @@ public function loadLatestNotice(\Magento\AdminNotification\Model\Inbox $object)
4242
)->limit(
4343
1
4444
);
45-
$data = $adapter->fetchRow($select);
45+
$data = $connection->fetchRow($select);
4646

4747
if ($data) {
4848
$object->setData($data);
@@ -62,8 +62,8 @@ public function loadLatestNotice(\Magento\AdminNotification\Model\Inbox $object)
6262
*/
6363
public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
6464
{
65-
$adapter = $this->_getReadAdapter();
66-
$select = $adapter->select()->from(
65+
$connection = $this->getConnection();
66+
$select = $connection->select()->from(
6767
$this->getMainTable(),
6868
[
6969
'severity' => 'severity',
@@ -78,7 +78,7 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
7878
'is_read=?',
7979
0
8080
);
81-
$return = $adapter->fetchPairs($select);
81+
$return = $connection->fetchPairs($select);
8282
return $return;
8383
}
8484

@@ -92,9 +92,9 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
9292
*/
9393
public function parse(\Magento\AdminNotification\Model\Inbox $object, array $data)
9494
{
95-
$adapter = $this->_getWriteAdapter();
95+
$connection = $this->getConnection();
9696
foreach ($data as $item) {
97-
$select = $adapter->select()->from($this->getMainTable())->where('title = ?', $item['title']);
97+
$select = $connection->select()->from($this->getMainTable())->where('title = ?', $item['title']);
9898

9999
if (empty($item['url'])) {
100100
$select->where('url IS NULL');
@@ -106,11 +106,11 @@ public function parse(\Magento\AdminNotification\Model\Inbox $object, array $dat
106106
$row = false;
107107
unset($item['internal']);
108108
} else {
109-
$row = $adapter->fetchRow($select);
109+
$row = $connection->fetchRow($select);
110110
}
111111

112112
if (!$row) {
113-
$adapter->insert($this->getMainTable(), $item);
113+
$connection->insert($this->getMainTable(), $item);
114114
}
115115
}
116116
}

app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(
3636
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
3737
\Magento\Framework\Event\ManagerInterface $eventManager,
3838
\Magento\Framework\Notification\MessageList $messageList,
39-
$connection = null,
39+
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
4040
\Magento\Framework\Model\Resource\Db\AbstractDb $resource = null
4141
) {
4242
$this->_messageList = $messageList;

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
99
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
10+
use Magento\Framework\App\Resource;
1011

1112
/**
1213
* Class AdvancedPricing
@@ -176,7 +177,7 @@ public function __construct(
176177
$this->_importExportData = $importExportData;
177178
$this->_resourceHelper = $resourceHelper;
178179
$this->_dataSourceModel = $importData;
179-
$this->_connection = $resource->getConnection('write');
180+
$this->_connection = $resource->getConnection();
180181
$this->_resourceFactory = $resourceFactory;
181182
$this->_productModel = $productModel;
182183
$this->_catalogData = $catalogData;

app/code/Magento/Authorization/Model/Acl/Loader/Role.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Authorization\Model\Acl\Role\Group as RoleGroup;
99
use Magento\Authorization\Model\Acl\Role\User as RoleUser;
10+
use Magento\Framework\App\Resource;
1011

1112
class Role implements \Magento\Framework\Acl\LoaderInterface
1213
{
@@ -49,11 +50,11 @@ public function __construct(
4950
public function populateAcl(\Magento\Framework\Acl $acl)
5051
{
5152
$roleTableName = $this->_resource->getTableName('authorization_role');
52-
$adapter = $this->_resource->getConnection('core_read');
53+
$connection = $this->_resource->getConnection();
5354

54-
$select = $adapter->select()->from($roleTableName)->order('tree_level');
55+
$select = $connection->select()->from($roleTableName)->order('tree_level');
5556

56-
foreach ($adapter->fetchAll($select) as $role) {
57+
foreach ($connection->fetchAll($select) as $role) {
5758
$parent = $role['parent_id'] > 0 ? $role['parent_id'] : null;
5859
switch ($role['role_type']) {
5960
case RoleGroup::ROLE_TYPE:

app/code/Magento/Authorization/Model/Acl/Loader/Rule.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Authorization\Model\Acl\Loader;
77

8+
use Magento\Framework\App\Resource;
9+
810
class Rule implements \Magento\Framework\Acl\LoaderInterface
911
{
1012
/**
@@ -37,11 +39,11 @@ public function populateAcl(\Magento\Framework\Acl $acl)
3739
{
3840
$ruleTable = $this->_resource->getTableName("authorization_rule");
3941

40-
$adapter = $this->_resource->getConnection('core_read');
42+
$connection = $this->_resource->getConnection();
4143

42-
$select = $adapter->select()->from(['r' => $ruleTable]);
44+
$select = $connection->select()->from(['r' => $ruleTable]);
4345

44-
$rulesArr = $adapter->fetchAll($select);
46+
$rulesArr = $connection->fetchAll($select);
4547

4648
foreach ($rulesArr as $rule) {
4749
$role = $rule['role_id'];

app/code/Magento/Authorization/Model/Resource/Role.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb
3535
* @param \Magento\Framework\Model\Resource\Db\Context $context
3636
* @param \Magento\Framework\App\CacheInterface $cache
3737
* @param \Magento\Framework\Stdlib\DateTime $dateTime
38-
* @param string|null $resourcePrefix
38+
* @param string $connectionName
3939
*/
4040
public function __construct(
4141
\Magento\Framework\Model\Resource\Db\Context $context,
4242
\Magento\Framework\App\CacheInterface $cache,
4343
\Magento\Framework\Stdlib\DateTime $dateTime,
44-
$resourcePrefix = null
44+
$connectionName = null
4545
) {
4646
$this->dateTime = $dateTime;
47-
parent::__construct($context, $resourcePrefix);
47+
parent::__construct($context, $connectionName);
4848
$this->_cache = $cache->getFrontend();
4949
}
5050

@@ -82,7 +82,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $role)
8282

8383
if (!$role->getTreeLevel()) {
8484
if ($role->getPid() > 0) {
85-
$select = $this->_getReadAdapter()->select()->from(
85+
$select = $this->getConnection()->select()->from(
8686
$this->getMainTable(),
8787
['tree_level']
8888
)->where(
@@ -91,7 +91,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $role)
9191

9292
$binds = ['pid' => (int)$role->getPid()];
9393

94-
$treeLevel = $this->_getReadAdapter()->fetchOne($select, $binds);
94+
$treeLevel = $this->getConnection()->fetchOne($select, $binds);
9595
} else {
9696
$treeLevel = 0;
9797
}
@@ -126,11 +126,11 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $role)
126126
*/
127127
protected function _afterDelete(\Magento\Framework\Model\AbstractModel $role)
128128
{
129-
$adapter = $this->_getWriteAdapter();
129+
$connection = $this->getConnection();
130130

131-
$adapter->delete($this->getMainTable(), ['parent_id = ?' => (int)$role->getId()]);
131+
$connection->delete($this->getMainTable(), ['parent_id = ?' => (int)$role->getId()]);
132132

133-
$adapter->delete($this->_ruleTable, ['role_id = ?' => (int)$role->getId()]);
133+
$connection->delete($this->_ruleTable, ['role_id = ?' => (int)$role->getId()]);
134134

135135
return $this;
136136
}
@@ -143,16 +143,16 @@ protected function _afterDelete(\Magento\Framework\Model\AbstractModel $role)
143143
*/
144144
public function getRoleUsers(\Magento\Authorization\Model\Role $role)
145145
{
146-
$read = $this->_getReadAdapter();
146+
$connection = $this->getConnection();
147147

148148
$binds = ['role_id' => $role->getId(), 'role_type' => RoleUser::ROLE_TYPE];
149149

150-
$select = $read->select()
150+
$select = $connection->select()
151151
->from($this->getMainTable(), ['user_id'])
152152
->where('parent_id = :role_id')
153153
->where('role_type = :role_type')
154154
->where('user_id > 0');
155155

156-
return $read->fetchCol($select, $binds);
156+
return $connection->fetchCol($select, $binds);
157157
}
158158
}

0 commit comments

Comments
 (0)