First mistake is .xsd
file configuration, In magento 2 stable release it should be
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
and second mistake is section should be darsh
instead of darsh_banner
third mistake is
<tab>darsh_banner</tab>
It should be
<tab>darsh</tab>
I think the resources is relating to the actual database connection. M1 in the past had something like this:
<resources>
<backup_setup>
<setup>
<module>Mage_Backup</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</backup_setup>
<backup_write>
<connection>
<use>core_write</use>
</connection>
</backup_write>
<backup_read>
<connection>
<use>core_read</use>
</connection>
</backup_read>
</resources>
so I would say the resources file is the successor to what the connection was.
Not sure that the _setup node provides much value above the other line as we have this code in
lib/internal/Magento/Framework/App/ResourceConnection/Config.php
public function getConnectionName($resourceName)
{
$connectionName = \Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION;
$resourceName = preg_replace("/_setup$/", '', $resourceName);
and also in setup/src/Magento/Setup/Module/Setup/ResourceConfig.php
class ResourceConfig implements \Magento\Framework\App\ResourceConnection\ConfigInterface
{
/**
* {@inheritdoc}
*/
public function getConnectionName($resourceName)
{
return \Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION;
}
}
I had a quick look through some of the enterprise modules to see if that sheds more light on the use of the resources.xml
file (as multiple dbs is apparently an M2 Enterprise feature) but the only use that I have come across so far also only uses extends from core
.
My hunch is that one would need to create additional db connections in app/etc/env.php
which then allows you to use those values to override the ones shipped in the default resource.xml
files (ie just the 1 default connection).
Best Answer
This is the file where you define the module access control list resources.
Those resources can be seen under the admin : System > Permissions > User Roles section when you click on Add a new Role button.
If you're not familiar with ACL, I suggest you read this good article from Alan Storm (even though it was written for M1 it is still relevant to understand the functionality): http://alanstorm.com/magento_acl_authentication