Skip to content

Commit bc4ec06

Browse files
committed
Revised text and markup blocks
Signed-off-by: nati <[email protected]>
1 parent 77c4c38 commit bc4ec06

File tree

12 files changed

+53
-64
lines changed

12 files changed

+53
-64
lines changed

docs/book/v6/how-to/authorization.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
# Authorization Guards
22

3-
The packages responsible for restricting access to certain parts of the application are [dot-rbac-guard](https://github.com/dotkernel/dot-rbac-guard) and [dot-rbac](https://github.com/dotkernel/dot-rbac).
4-
These packages work together to create an infrastructure that is customizable and diversified to manage user access to the platform by specifying the type of role the user has.
3+
The packages responsible for restricting access to certain parts of the application are [dot-rbac-guard](https://github.com/dotkernel/dot-rbac-guard) and [dot-rbac](https://github.com/dotkernel/dot-rbac). These packages work together to create an infrastructure that is customizable and diversified to manage user access to the platform by specifying the type of role the user has.
54

65
The `authorization.global.php` file provides multiple configurations specifying multiple roles as well as the types of permissions to which these roles have access.
76

87
```php
98
//example of a flat RBAC model that specifies two types of roles as well as their permission
109
'roles' => [
11-
'admin' => [
12-
'permissions' => [
13-
'authenticated',
14-
'edit',
15-
'delete',
16-
//etc..
17-
]
18-
],
19-
'user' => [
20-
'permissions' => [
21-
'authenticated',
22-
//etc..
23-
]
24-
]
10+
'admin' => [
11+
'permissions' => [
12+
'authenticated',
13+
'edit',
14+
'delete',
15+
//etc..
2516
]
17+
],
18+
'user' => [
19+
'permissions' => [
20+
'authenticated',
21+
//etc..
22+
]
23+
]
24+
]
2625
```
2726

2827
The `authorization-guards.global.php` file defines which permissions are required to access specific route handlers. These permissions must first be declared in the authorization.global.php (dot-rbac) configuration file.

docs/book/v6/how-to/creating-fixtures.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
> Fixtures are used to seed the database with initial values and should only be executed ONCE each, after migrating the database.
44
5-
Seeding the database is done with the help of our custom package `dotkernel/dot-data-fixtures` built on top of `doctrine/data-fixtures`.
6-
See below on how to use our CLI command for listing and executing Doctrine data fixtures.
5+
Seeding the database is done with the help of our custom package `dotkernel/dot-data-fixtures` built on top of `doctrine/data-fixtures`. See below on how to use our CLI command for listing and executing Doctrine data fixtures.
76

87
## Working with fixtures
98

@@ -12,19 +11,19 @@ You can find an example of a fixtures class in `src/Core/src/App/src/Fixture/Adm
1211
To list all the available fixtures by order of execution run:
1312

1413
```shell
15-
php bin/doctrine fixtures:list
14+
php ./bin/doctrine fixtures:list
1615
```
1716

1817
To execute all fixtures run:
1918

2019
```shell
21-
php bin/doctrine fixtures:execute
20+
php ./bin/doctrine fixtures:execute
2221
```
2322

2423
To execute a specific fixture, use its class name, like in this example:
2524

2625
```shell
27-
php bin/doctrine fixtures:execute --class=AdminLoader
26+
php ./bin/doctrine fixtures:execute --class=AdminLoader
2827
```
2928

3029
Fixtures can and should be ordered to ensure database consistency.

docs/book/v6/how-to/creating-migrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Migrations are used to create and/or edit the database structure.
44
To generate a new migration file, use this command:
55

66
```shell
7-
php vendor/bin/doctrine-migrations migrations:generate
7+
php ./vendor/bin/doctrine-migrations migrations:generate
88
```
99

1010
It creates a PHP file like this one `src/Core/src/App/src/Migration/Version20240627134952.php` that can then be edited in the IDE.

docs/book/v6/how-to/csrf.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Open the form's PHP class and append the following code to the method that initi
2323

2424
```php
2525
$this->add(
26-
(new Csrf('exampleCsrf'))
26+
(new \Laminas\Form\Element\Csrf('exampleCsrf'))
2727
->setOptions([
2828
'csrf_options' => ['timeout' => 3600, 'session' => new Container()],
2929
])
@@ -39,7 +39,7 @@ Open the InputFilter that validates the form fields and append the following cod
3939
fields (usually `init`):
4040

4141
```php
42-
$this->add(new CsrfInput('exampleCsrf'));
42+
$this->add(new \Admin\App\InputFilter\Input\CsrfInput('exampleCsrf'));
4343
```
4444

4545
where `exampleCsrf` must match the CSRF field's name in the form.
@@ -50,28 +50,23 @@ where `exampleCsrf` must match the CSRF field's name in the form.
5050
5151
### Render field
5252

53-
Open the template that renders your form and add the following code somewhere between the form's opening and closing
54-
tags:
53+
Open the template that renders your form and add the following code somewhere between the form's opening and closing tags:
5554

5655
```text
5756
{{ formElement(form.get('exampleCsrf')) }}
5857
```
5958

6059
## Test the implementation
6160

62-
Access your form from the browser and view its source. You should see a new hidden field, called `exampleCsrf` (or
63-
however you named it). After filling out the form, submitting it should work as before.
61+
Access your form from the browser and view its source. You should see a new hidden field, called `exampleCsrf` (or however you named it). After filling out the form, submitting it should work as before.
6462

65-
In order to make sure that the new CSRF field works as expected, you can inspect the form using your browser's
66-
`Developer tools` and modify its value in any way. Submitting a filled out form should result in a validation error:
63+
In order to make sure that the new CSRF field works as expected, you can inspect the form using your browser's `Developer tools` and modify its value in any way. Submitting a filled out form should result in a validation error:
6764

6865
> This field is required and cannot be empty.
6966
7067
### Timeout
7168

72-
Note the `timeout` option in your PHP form's `exampleCsrf` field, with its default value set to **3600**. This
73-
represents the value in seconds for how long the token is valid. Submitting a form that has been rendered for longer
74-
than this value will result in a validation error:
69+
Note the `timeout` option in your PHP form's `exampleCsrf` field, with its default value set to **3600**. This represents the value in seconds for how long the token is valid. Submitting a form that has been rendered for longer than this value will result in a validation error:
7570

7671
> Invalid CSRF.
7772

docs/book/v6/how-to/dependency-injection.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class GetAccountLogoutHandler implements RequestHandlerInterface
3535

3636
> If your class needs the value of a specific configuration key, you can specify the path using dot notation: `config.example`
3737
38-
The next step is to register the class in the `ConfigProvider` under `factories` using
39-
`Dot\DependencyInjection\Factory\AttributedServiceFactory::class`.
38+
The next step is to register the class in the `ConfigProvider` under `factories` using `Dot\DependencyInjection\Factory\AttributedServiceFactory::class`.
4039

4140
```php
4241
public function getDependencies(): array

docs/book/v6/installation/composer.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Package operations: 171 installs, 0 updates, 0 removals
3232

3333
The setup script prompts for some configuration settings, for example the lines below:
3434

35-
```shell
35+
```text
3636
Please select which config file you wish to inject 'Laminas\Validator\ConfigProvider' into:
3737
[0] Do not inject
3838
[1] config/config.php
@@ -46,7 +46,9 @@ Type `0` to select `[0] Do not inject`.
4646
4747
The next question is:
4848

49-
`Remember this option for other packages of the same type? (y/N)`
49+
```text
50+
Remember this option for other packages of the same type? (y/N)
51+
```
5052

5153
Type `y` here, and hit `enter` to complete this stage.
5254

docs/book/v6/installation/configuration-files.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
> If you intend to send emails from your Frontend, make sure to fill in SMTP connection params.
66
> This will be covered in the next section.
77
8-
> **optional**: in order to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php`
9-
> this creates a new in-memory database that your tests will run on.
8+
> **optional**: in order to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php` this creates a new in-memory database that your tests will run on.
109
1110
If you want your application to send mail, add valid credentials to the following keys in `config/autoload/mail.global.php`
1211

@@ -15,13 +14,6 @@ Under `message_options` key:
1514
- `from` - email address that will send emails (required)
1615
- `from_name` - organization name for signing sent emails (optional)
1716

18-
Under `smtp_options` key:
19-
20-
- `host` - hostname or IP address of the mail server (required)
21-
- `connection_config` - add the `username` and `password` keys (required)
22-
23-
In `config/autoload/local.php` edit the key `contact` => `message_receivers` => `to` with *string* values for emails that should receive contact messages.
24-
2517
> **Please add at least 1 email address in order for contact message to reach someone**
2618
27-
Also feel free to add as many CCs as you require under the `contact` => `message_receivers` => `cc` key.
19+
Also feel free to add as many CCs as you require under the `dot_mail` => `default` => `message_options` => `cc` key.

docs/book/v6/installation/doctrine-orm.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ $databases = [
3333
Run the database migrations by using the following command:
3434

3535
```shell
36-
php vendor/bin/doctrine-migrations migrate
36+
php ./vendor/bin/doctrine-migrations migrate
3737
```
3838

39-
Note: If you have already run the migrations, you may get this message.
40-
You should double-check to make sure the new migrations are ok to run.
39+
> If you have already run the migrations, you may get this message.
40+
> You should double-check to make sure the new migrations are ok to run.
4141
42-
```shell
42+
```text
4343
WARNING! You have x previously executed migrations in the database that are not registered migrations.
4444
{migration list}
4545
Are you sure you wish to continue? (y/n)
4646
```
4747

4848
When using an empty database, you will get this confirmation message instead.
4949

50-
```shell
50+
```text
5151
WARNING! You are about to execute a migration in database "<your_database_name>" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no)
5252
```
5353

@@ -56,7 +56,7 @@ Each migration will be logged in the `migrations` table to prevent running the s
5656

5757
If everything ran correctly, you will get this confirmation.
5858

59-
```shell
59+
```text
6060
[OK] Successfully migrated to version: Core\App\Migration\Version20250407142911
6161
```
6262

@@ -67,7 +67,7 @@ If everything ran correctly, you will get this confirmation.
6767
Run this command to populate the admin tables with the default values:
6868

6969
```shell
70-
php bin/doctrine fixtures:execute
70+
php ./bin/doctrine fixtures:execute
7171
```
7272

7373
You should see our galloping horse in the command line.

docs/book/v6/installation/manage-geolite2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
You can download/update a specific GeoLite2 database, by running the following command where `{DATABASE}` can be `asn`, `city`, `country`:
44

55
```shell
6-
php bin/cli.php geoip:synchronize -d {DATABASE}
6+
php ./bin/cli.php geoip:synchronize -d {DATABASE}
77
```
88

99
You can download/update all GeoLite2 databases at once, by running the following command:
1010

1111
```shell
12-
php bin/cli.php geoip:synchronize
12+
php ./bin/cli.php geoip:synchronize
1313
```
1414

1515
The output should be similar to the below, displaying per row: `database identifier`: `previous build datetime` -> `current build datetime`.
@@ -25,7 +25,7 @@ country: n/a -> 2024-11-01 02:25:09
2525
Get help for this command by running:
2626

2727
```shell
28-
php bin/cli.php help geoip:synchronize
28+
php ./bin/cli.php help geoip:synchronize
2929
```
3030

31-
**Tip**: If you set up the synchronizer command as a cronjob, you can add the `-q|--quiet` option, and it will output data only if an error has occurred.
31+
> If you set up the synchronizer command as a cronjob, you can add the `-q|--quiet` option, and it will output data only if an error has occurred.

docs/book/v6/installation/test-the-installation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
55
We recommend running your applications in WSL:
66

7-
- Make sure you have [WSL](https://github.com/dotkernel/development/blob/main/wsl/README.md) installed on your system.
8-
- Currently we provide a distro implementations for [AlmaLinux9](https://github.com/dotkernel/development/blob/main/wsl/os/almalinux9/README.md).
7+
- Make sure you have [WSL2](https://docs.dotkernel.org/development/v2/setup/system-requirements/) installed on your system.
8+
- Currently we provide a distro implementations for [AlmaLinux9](https://github.com/dotkernel/development/blob/main/wsl/README.md).
99
- Install the application in a virtualhost as recommended by the chosen distro.
1010
- Set `$baseUrl` in **config/autoload/local.php** to the address of the virtualhost.
1111
- Run the application by opening the virtualhost address in your browser.
1212

13-
You should see the `Dotkernel admin` login page.
13+
You should see the `Dotkernel Admin` login page.
1414

1515
> If you are getting exceptions or errors regarding some missing services, try running the following command:
1616
1717
```shell
18-
sudo php bin/clear-config-cache.php
18+
sudo php ./bin/clear-config-cache.php
1919
```
2020

2121
> If `config-cache.php` is present that config will be loaded regardless of the `ConfigAggregator::ENABLE_CACHE` in `config/autoload/mezzio.global.php`
@@ -40,4 +40,4 @@ return [
4040
];
4141
```
4242

43-
Do not change this in `local.php.dist` as well because this value should remain `true` on production.
43+
> Do not change this in `local.php.dist` as well because this value should remain `true` on production.

0 commit comments

Comments
 (0)