Add new Helper to process Ignore Origin rules and RulerZ operator

This commits adds a new helper like RuleBasedTagger for processing
ignore origin rules. It also adds a new custom RulerZ operator for the
'~' pattern matching rule.

Renames 'pattern' with '_all' in IgnoreOriginRule entity.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf
2019-08-11 23:51:55 +02:00
parent 24230a5130
commit f39c5a2a70
6 changed files with 300 additions and 4 deletions

View File

@ -92,6 +92,7 @@ services:
arguments:
- "@wallabag_core.graby"
- "@wallabag_core.rule_based_tagger"
- "@wallabag_core.rule_based_ignore_origin_processor"
- "@validator"
- "@logger"
- '%wallabag_core.fetching_error_message%'
@ -110,6 +111,13 @@ services:
- "@wallabag_core.entry_repository"
- "@logger"
wallabag_core.rule_based_ignore_origin_processor:
class: Wallabag\CoreBundle\Helper\RuleBasedIgnoreOriginProcessor
arguments:
- "@rulerz"
- "@logger"
- "@wallabag_core.ignore_origin_instance_rule_repository"
# repository as a service
wallabag_core.entry_repository:
class: Wallabag\CoreBundle\Repository\EntryRepository
@ -164,6 +172,11 @@ services:
tags:
- { name: rulerz.operator, target: doctrine, operator: notmatches, inline: true }
wallabag.operator.array.pattern_matches:
class: Wallabag\CoreBundle\Operator\PHP\PatternMatches
tags:
- { name: rulerz.operator, target: native, operator: "~" }
wallabag_core.helper.redirect:
class: Wallabag\CoreBundle\Helper\Redirect
arguments: