Remove unnecessary routes.

This commit is contained in:
James Cole 2018-01-10 07:29:55 +01:00
parent a816e59a97
commit c045193246
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -200,25 +200,28 @@ class HomeController extends Controller
'login', 'logout', 'password.reset', 'profile.confirm-email-change', 'profile.undo-email-change',
'register', 'report.options', 'routes', 'rule-groups.down', 'rule-groups.up', 'rules.up', 'rules.down',
'rules.select', 'search.search', 'test-flash', 'transactions.link.delete', 'transactions.link.switch',
'two-factor.lost', 'report.options',
'two-factor.lost', 'reports.options', 'debug', 'import.create-job', 'import.download', 'import.start', 'import.status.json',
'preferences.delete-code', 'rules.test-triggers', 'piggy-banks.remove-money', 'piggy-banks.add-money',
'accounts.reconcile.transactions', 'accounts.reconcile.overview',
];
$return = ' ';
/** @var Route $route */
foreach ($set as $route) {
$name = $route->getName();
if (null !== $name && in_array('GET', $route->methods()) && strlen($name) > 0) {
$found = false;
foreach ($ignore as $string) {
if (false !== strpos($name, $string)) {
if (!(false === stripos($name, $string))) {
$found = true;
break;
}
}
if (!$found) {
if ($found === false) {
$return .= 'touch ' . $route->getName() . '.md;';
}
}
}
return $return;
}