|
MediaWiki master
|
Constraints reflect possible errors that need to be checked. More...
Public Member Functions | |
| __construct (private readonly ServiceOptions $options, private readonly Spi $loggerFactory, private readonly HookContainer $hookContainer, private readonly ReadOnlyMode $readOnlyMode, private readonly SpamChecker $spamRegexChecker, private readonly RateLimiter $rateLimiter, private readonly RedirectLookup $redirectLookup, private readonly IConnectionProvider $connectionProvider, private readonly LogFormatterFactory $logFormatterFactory,) | |
| Some constraints have dependencies that need to be injected, this class serves as a factory for all of the different constraints that need dependencies injected. | |
| newAccidentalRecreationConstraint (Title $title, bool $allowRecreation, ?string $startTime, ?string $submitButtonLabel=null,) | |
| newEditFilterMergedContentHookConstraint (Content $content, IContextSource $context, string $summary, bool $minorEdit, Language $language, User $user) | |
| newLinkPurgeRateLimitConstraint (RateLimitSubject $subject) | |
| newPageSizeConstraint (int $contentSize, string $type) | |
| newReadOnlyConstraint () | |
| newRedirectConstraint (?Title $allowedProblematicRedirectTarget, Content $newContent, ?Content $originalContent, LinkTarget $title, MessageValue $errorMessageWrapper, ?string $contentFormat,) | |
| newSimpleAntiSpamConstraint (string $input, UserIdentity $user, Title $title) | |
| newSpamRegexConstraint (string $summary, ?string $sectionHeading, string $text, string $reqIP, Title $title) | |
Public Attributes | |
| const | CONSTRUCTOR_OPTIONS |
Constraints reflect possible errors that need to be checked.
Definition at line 36 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::__construct | ( | private readonly ServiceOptions | $options, |
| private readonly Spi | $loggerFactory, | ||
| private readonly HookContainer | $hookContainer, | ||
| private readonly ReadOnlyMode | $readOnlyMode, | ||
| private readonly SpamChecker | $spamRegexChecker, | ||
| private readonly RateLimiter | $rateLimiter, | ||
| private readonly RedirectLookup | $redirectLookup, | ||
| private readonly IConnectionProvider | $connectionProvider, | ||
| private readonly LogFormatterFactory | $logFormatterFactory ) |
Some constraints have dependencies that need to be injected, this class serves as a factory for all of the different constraints that need dependencies injected.
The checks in EditPage use wfDebugLog and logged to different channels, hence the need for multiple loggers retrieved from the Spi. The channels used are:
TODO can they be combined into the same channel?
Definition at line 56 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newAccidentalRecreationConstraint | ( | Title | $title, |
| bool | $allowRecreation, | ||
| ?string | $startTime, | ||
| ?string | $submitButtonLabel = null ) |
Definition at line 205 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newEditFilterMergedContentHookConstraint | ( | Content | $content, |
| IContextSource | $context, | ||
| string | $summary, | ||
| bool | $minorEdit, | ||
| Language | $language, | ||
| User | $user ) |
| Content | $content | |
| IContextSource | $context | |
| string | $summary | |
| bool | $minorEdit | |
| Language | $language | |
| User | $user |
Definition at line 86 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newLinkPurgeRateLimitConstraint | ( | RateLimitSubject | $subject | ) |
| RateLimitSubject | $subject |
Definition at line 132 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newPageSizeConstraint | ( | int | $contentSize, |
| string | $type ) |
| int | $contentSize | |
| string | $type |
Definition at line 110 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newReadOnlyConstraint | ( | ) |
Definition at line 121 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newRedirectConstraint | ( | ?Title | $allowedProblematicRedirectTarget, |
| Content | $newContent, | ||
| ?Content | $originalContent, | ||
| LinkTarget | $title, | ||
| MessageValue | $errorMessageWrapper, | ||
| ?string | $contentFormat ) |
Definition at line 186 of file EditConstraintFactory.php.
Referenced by MediaWiki\EditPage\EditPage\getPreviewText().
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newSimpleAntiSpamConstraint | ( | string | $input, |
| UserIdentity | $user, | ||
| Title | $title ) |
| string | $input | |
| UserIdentity | $user | |
| Title | $title |
Definition at line 147 of file EditConstraintFactory.php.
| MediaWiki\EditPage\Constraint\EditConstraintFactory::newSpamRegexConstraint | ( | string | $summary, |
| ?string | $sectionHeading, | ||
| string | $text, | ||
| string | $reqIP, | ||
| Title | $title ) |
| string | $summary | |
| ?string | $sectionHeading | |
| string | $text | |
| string | $reqIP | |
| Title | $title |
Definition at line 168 of file EditConstraintFactory.php.
| const MediaWiki\EditPage\Constraint\EditConstraintFactory::CONSTRUCTOR_OPTIONS |
Definition at line 39 of file EditConstraintFactory.php.