Skip to content

Commit

Permalink
Merge branch 'master' into fix/75_strategy_static
Browse files Browse the repository at this point in the history
# Conflicts:
#	Changelog.md
  • Loading branch information
Florian Horn committed Jul 11, 2017
2 parents 6f061d9 + e51140e commit 7e9fcd3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file, in reverse
### Fixed

- #75 Static matcher now canonicalizes url and rule to omit differences of trailing slashes
- #74 Provides backwards compatibility by set strategy for existing rules to regex matcher instead of static
- #72 Fixes on class resolution

## 2.0.2
Expand Down
22 changes: 20 additions & 2 deletions Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
$this->runUpgrade201($setup);
}

if (version_compare($context->getVersion(), '2.1.0', '<')) {
$this->runUpgrade210($setup);
}

$setup->endSetup();
}

Expand Down Expand Up @@ -152,24 +156,38 @@ protected function runUpgrade201(ModuleDataSetupInterface $setup)
);
}

/**
* @param ModuleDataSetupInterface $setup
*/
protected function runUpgrade210(ModuleDataSetupInterface $setup)
{
$setup->getConnection()->update(
$setup->getTable('bitexpert_forcelogin_whitelist'),
['strategy' => 'regex-all']
);
}

/**
* @param int $storeId
* @param string $label
* @param string $urlRule
* @param boolean $editable
* @param string $strategy
* @return array
*/
protected function getWhitelistEntryAsArray(
$storeId,
$label,
$urlRule,
$editable = false
$editable = false,
$strategy = 'default'
) {
return array(
'store_id' => $storeId,
'label' => $label,
'url_rule' => $urlRule,
'editable' => $editable
'editable' => $editable,
'strategy' => $strategy
);
}
}

0 comments on commit 7e9fcd3

Please sign in to comment.