Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

43 changes: 32 additions & 11 deletions docs/infrastructure_and_maintenance/background_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,25 @@ services:
```

``` php
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 1, 3) =]]
<?php

[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 5, 5) =]]
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 10, 15) =]]
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 17, 22) =]]
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 30, 31) =]]
namespace App\Dispatcher;

use App\Message\SomeMessage;
use Symfony\Component\Messenger\MessageBusInterface;

final readonly class SomeClassThatSchedulesExecutionInTheBackground
{
public function __construct(
private MessageBusInterface $bus
) {
}

public function schedule(): void
{
$this->bus->dispatch(new SomeMessage());
}
}
```

3\. [Route the message to the background queue](#route-message-to-background-queue).
Expand Down Expand Up @@ -154,10 +167,12 @@ On top of the supported Symfony stamps, [[= product_name =]] provides the follow
The following example shows how you can attach the `SudoStamp` to the message:

``` php
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 7, 7, remove_indent=True) =]]
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 9, 10, remove_indent=True) =]]
use App\Message\SomeMessage;
use Ibexa\Contracts\Messenger\Stamp\SudoStamp;
use Symfony\Component\Messenger\MessageBusInterface;

[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 25, 25, remove_indent=True) =]]
/** @var MessageBusInterface $bus */
$bus->dispatch(new SomeMessage(), [new SudoStamp()]);
```

#### UserPermissionStamp
Expand All @@ -171,10 +186,16 @@ By combing this stamp with [`SudoStamp`](#sudostamp), you can set the repository
The following example shows how you can use `UserPermissionStamp` to preserve the current repository user after the message is dispatched.

``` php
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 5, 5, remove_indent=True) =]]
[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 8, 10, remove_indent=True) =]]
use App\Message\SomeMessage;
use Ibexa\Contracts\Core\Repository\PermissionResolver;
use Ibexa\Contracts\Messenger\Stamp\UserPermissionStamp;
use Symfony\Component\Messenger\MessageBusInterface;

/** @var PermissionResolver $permissionResolver */
$currentUserId = $permissionResolver->getCurrentUserReference()->getUserId();

[[= include_code('code_samples/background_tasks/src/Dispatcher/SomeClassThatSchedulesExecutionInTheBackground.php', 23, 24, remove_indent=True) =]]
/** @var MessageBusInterface $bus */
$bus->dispatch(new SomeMessage(), [new UserPermissionStamp($currentUserId)]);
```

#### SiteAccessStamp
Expand Down
2 changes: 2 additions & 0 deletions docs/raptor_cdp/raptor_cdp_data_customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The following example adds a custom date of birth field to the exported data:
Register your processor as a Symfony service and tag it with `ibexa.cdp.export.user.item_processor`:

``` yaml
services:

App\Export\User\DateOfBirthUserItemProcessor:
parent: Ibexa\Contracts\Cdp\Export\User\AbstractUserItemProcessor
arguments:
Expand Down
7 changes: 1 addition & 6 deletions tests/yaml-validation-baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ ignoreErrors:
line: 26
hash: 4cfc5ac559eb8db38edb6c8a29872883a95886b61cdae2b343a5ebaf4a9bca8e
message: '~The value "\<general\|targetable\>" is not allowed for path "ibexa\.system\.\<scope\>\>\.product_tour\.\<scenario_identifier\>\.type"\. Permissible values\: "general", "targetable"\.~'
-
path: docs/cdp/cdp_data_customization.md
line: 29
hash: bb2ecc0b96ca61cd004b9c1806e78d6afc3197a68acb723db7a52cfd5bdc89d6
message: '~Unable to parse at line 1 \(near " App\\Export\\User\\DateOfBirthUserItemProcessor\:"\)\.~'
-
path: docs/commerce/checkout/customize_checkout.md
line: 130
Expand Down Expand Up @@ -349,7 +344,7 @@ ignoreErrors:
message: '~Unrecognized option "require_previous_session" under "security\.firewalls\.ezpublish_front\.form_login"\. Available options are "always_use_default_target_path", "check_path", "csrf_parameter", "csrf_token_id", "default_target_path", "enable_csrf", "failure_forward", "failure_handler", "failure_path", "failure_path_parameter", "form_only", "login_path", "password_parameter", "post_only", "provider", "remember_me", "success_handler", "target_path_parameter", "use_forward", "use_referer", "username_parameter"\.~'
-
path: docs/release_notes/ibexa_dxp_v5.0.md
line: 85
line: 84
hash: 7d4a5637a3e036ebcdc5a4be8282aebe2bfcbaee3222981b81f739ae773111d0
message: '~The child config "path" under "ibexa\.repositories\.\<repository\>\.mcp\.\<server\>" must be configured\: MCP server path~'
-
Expand Down
Loading