Skip to content

Commit 5844faa

Browse files
committed
No issue - Mainly fixes in documentation
1 parent d43a869 commit 5844faa

File tree

16 files changed

+207
-190
lines changed

16 files changed

+207
-190
lines changed

config/db_tools.standalone.complete.sample.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@
3333
# Default timeout for restore process.
3434
#restore_timeout: 2400 # default 1800
3535

36-
# List here tables (you don't want in your backups.
36+
# List here tables you don't want in your backups.
3737
# If you have more than one connection, it is strongly advised to configure
3838
# this for each connection instead.
3939
#backup_excluded_tables: ['table1', 'table2']
4040

41-
# Specify here paths to backup and restore binaries and command line options.
41+
# Specify here paths to backup and restoration binaries and command line
42+
# options.
4243
# Warning: this will apply to all connections disregarding their database
4344
# vendor. If you have more than one connection and if they use different
4445
# database vendors or versions, please configure those for each connection
@@ -54,7 +55,7 @@
5455
# Connection name will be "default" when configured this way.
5556
connections: "pgsql://username:password@hostname:port?version=16.0&other_option=..."
5657

57-
# Alternatively, you are allowed to have more than one connections, case
58+
# Alternatively, you are allowed to have more than one connection, case
5859
# in which you might synthesize the configuration as this:
5960
#connections:
6061
# connection_one: "pgsql://username:password@hostname:port?version=16.0&other_option=..."
@@ -66,7 +67,8 @@ connections: "pgsql://username:password@hostname:port?version=16.0&other_option=
6667
#connections:
6768
# connection_one:
6869
# # Connection URL for connecting.
69-
# # Please refer to makinacorpus/db-query-builder or documentation for more information.
70+
# # Please refer to makinacorpus/db-query-builder or documentation for
71+
# # more information.
7072
# # Any URL built for doctrine/dbal usage should work.
7173
# # URL is the sole mandatory parameter.
7274
# # Complete list of accepted parameters follows.
@@ -85,14 +87,15 @@ connections: "pgsql://username:password@hostname:port?version=16.0&other_option=
8587
# url: "mysql://username:password@hostname:port?version=8.1&other_option=..."
8688
# # ...
8789

88-
# You can explicitely set which will be default connection in use when
89-
# none providen in the command line options. If you omit this configuration
90+
# You can explicitly set which will be default connection in use when none
91+
# is provided in the command line options. If you omit this configuration
9092
# value, then the first one in the list will be used.
9193
#default_connection: connection_one
9294

93-
# Update this configuration if you want to look for anonymizers in a custom folder.
95+
# Update this configuration if you want to look for anonymizers in a custom
96+
# folder.
9497
#anonymizer_paths:
95-
#- ./src/Anonymization/Anonymizer'
98+
# - ./src/Anonymizer
9699

97100
# For simple needs, you may simply write the anonymization configuration here.
98101
# Keys are connection names, values are structures which are identical to what
@@ -112,8 +115,8 @@ anonymization:
112115

113116
# You can for organisation purpose delegate anonymization config into extra
114117
# YAML configuration files, and simply reference them here.
115-
# Pathes can be either relative or absolute. Relative paths are relative to
116-
# the workdir option if specified, or from this configuration file directory
118+
# Paths can be either relative or absolute. Relative paths are relative to
119+
# the workdir option if specified, or from this configuration file directory
117120
# otherwise.
118121
# See the "anonymizations.sample.yaml" in this folder for an example.
119122
anonymization_files:

config/db_tools.standalone.sample.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This configuration file is an example for standalone usage.
2-
# Only required parameter is the connection URL.
2+
# The only required parameter is the connection URL.
33

44
# If you have a single connection, you can use this syntax.
55
# Connection name will be "default" when configured this way.
66
# If you have multiple connections, please refer to the exhaustive
7-
# sample in 'db_tools.standalone.complete.sample.yaml'.
7+
# sample in 'db_tools.standalone.complete.sample.yaml'.
88
connections: "pgsql://username:password@hostname:port?version=16.0&other_option=..."
99

1010
# Where to put generated backups.
@@ -27,21 +27,22 @@ connections: "pgsql://username:password@hostname:port?version=16.0&other_option=
2727
# (Use relative date/time formats : https://www.php.net/manual/en/datetime.formats.relative.php)
2828
#backup_expiration_age: '6 months ago' # default '3 months ago'
2929

30-
# List here tables (you don't want in your backups.
30+
# List here tables you don't want in your backups.
3131
# If you have more than one connection, it is strongly advised to configure
3232
# this for each connection instead.
3333
#backup_excluded_tables: ['table1', 'table2']
3434

35-
# Update this configuration if you want to look for anonymizers in a custom folder.
35+
# Update this configuration if you want to look for anonymizers in a custom
36+
# folder.
3637
#anonymizer_paths:
37-
#- ./src/Anonymization/Anonymizer'
38+
# - ./src/Anonymizer'
3839

3940
# Write the anonymization configuration here.
4041
# You may also write anonymization configuration in extra files instead, please
41-
# see the 'db_tools.standalone.complete.sample.yaml' for more documentation.
42+
# see the 'db_tools.standalone.complete.sample.yaml' for more documentation.
4243
#anonymization:
43-
# # Keys are connection names, values are structures which are identical to what
44-
# # you may find in the "anonymizations.sample.yaml" example.
44+
# # Keys are connection names, values are structures which are identical to
45+
# # what you may find in the "anonymizations.sample.yaml" example.
4546
# # If you only specified one URL in the "connections" parameter above, the
4647
# # connection name is "default".
4748
# default:

config/packages/db_tools.yaml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ db_tools:
1616
# - "default": alias of "datetime".
1717
# - "datetime": implementation is "%db_tools.storage_directory%/YYYY/MM/<connection-name>-<datestamp>.<ext>".
1818
# - CLASS_NAME: a class name to use that implements a strategy.
19-
# - SERVICE_ID: A service identifier registered in container that implements a strategy.
19+
# - SERVICE_ID: A service identifier registered in container that
20+
# implements a strategy.
2021
#storage_filename_strategy: default
2122

2223
# When old backups are considered obsolete.
@@ -29,12 +30,13 @@ db_tools:
2930
# Default timeout for restore process.
3031
#restore_timeout: 2400 # default 1800
3132

32-
# List here tables (you don't want in your backups.
33+
# List here tables you don't want in your backups.
3334
# If you have more than one connection, it is strongly advised to configure
3435
# this for each connection instead.
3536
#backup_excluded_tables: ['table1', 'table2']
3637

37-
# Specify here paths to backup and restore binaries and command line options.
38+
# Specify here paths to backup and restoration binaries and command line
39+
# options.
3840
# Warning: this will apply to all connections disregarding their database
3941
# vendor. If you have more than one connection and if they use different
4042
# database vendors or versions, please configure those for each connection
@@ -67,16 +69,17 @@ db_tools:
6769
# connection_two:
6870
# # ...
6971

70-
# Update this configuration if you want to look for anonymizers in a custom folder.
71-
# These are default paths that will always be registered even if you override
72-
# the setting so please don't repeat them:
72+
# Update this configuration if you want to look for anonymizers in a custom
73+
# folder.
74+
# Be aware that DbToolsBundle will always take a look at the default folder
75+
# dedicated to your custom anonymizers: %kernel.project_dir%/src/Anonymizer,
76+
# so you don't have to repeat it.
7377
#anonymizer_paths:
74-
#- '%kernel.project_dir%/vendor/makinacorpus/db-tools-bundle/src/Anonymization/Anonymizer/Core'
75-
#- '%kernel.project_dir%/src/Anonymization/Anonymizer'
78+
# - '%kernel.project_dir%/src/Database/Anonymizer'
7679

77-
# For simple needs, you may simply write the anonymization configuration here.
78-
# Keys are connection names, values are structures which are identical to what
79-
# you may find in the "anonymizations.sample.yaml" example.
80+
# For simple needs, you may simply write the anonymization configuration
81+
# here. Keys are connection names, values are structures which are identical
82+
# to what you may find in the "anonymizations.sample.yaml" example.
8083
#anonymization:
8184
# connection_one:
8285
# table1:
@@ -92,8 +95,8 @@ db_tools:
9295

9396
# You can for organisation purpose delegate anonymization config into extra
9497
# YAML configuration files, and simply reference them here.
95-
# Pathes can be either relative or absolute. Relative paths are relative to
96-
# the workdir option if specified, or from this configuration file directory
98+
# Paths can be either relative or absolute. Relative paths are relative to
99+
# the workdir option if specified, or from this configuration file directory
97100
# otherwise.
98101
# See the "anonymizations.sample.yaml" in this folder for an example.
99102
#anonymization_files:

docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ To build it locally :
99
```sh
1010
nvm use
1111
npm ci
12-
npm run docs:dev
12+
npm run docs:dev
13+
```

docs/content/anonymization/custom-anonymizers.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
To create one, you will need to
88

9-
1. add a class in the `src/Anonymizer` directory extends `AbstractAnonymizer`
9+
1. add a class extending `AbstractAnonymizer` in the `src/Anonymizer` directory
1010
2. add the `AsAnonymizer` attribute on it
1111

1212
```php
@@ -24,8 +24,8 @@ use MakinaCorpus\DbToolsBundle\Attribute\AsAnonymizer;
2424
)]
2525
class MyAnonymizer extends AbstractAnonymizer
2626
{
27-
28-
// ...
27+
// ...
28+
}
2929
```
3030

3131
To understand how an `Anonymizer` works, read `vendor/makinacorpus/db-tools-bundle/src/Anonymizer/AbstractAnonymizer.php`
@@ -40,7 +40,7 @@ with the [*Anonymizer paths* configuration](../configuration/basics#anonymizer-p
4040

4141
::: tip
4242
To generate its update queries, *DbToolsBundle* uses the *[makinacorpus/query-builder-bundle](https://github.com/makinacorpus/query-builder-bundle) package*.
43-
If you want to create your own anonymizers, you will problably need to take a look at
43+
If you want to create your own anonymizers, you will probably need to take a look at
4444
[its basic uses](https://php-query-builder.readthedocs.io/en/stable/introduction/usage.html).
4545
:::
4646

@@ -70,21 +70,19 @@ use MakinaCorpus\DbToolsBundle\Attribute\AsAnonymizer;
7070
)]
7171
class MyEnumAnonymizer extends AbstractEnumAnonymizer
7272
{
73-
7473
#[\Override]
7574
protected function getSample(): array
7675
{
7776
// Generate here your sample.
78-
7977
return ['Foo', 'Bar', 'Baz'];
8078
}
8179
}
8280
```
8381
84-
## Mutlicolumn Anonymizers
82+
## Multicolumn Anonymizers
8583
86-
As for an enum anonymizer, if you need to create a mutlicolumn anonymizer based on a big sample, you can extend the
87-
*AbstractMultipleColumnAnonymizer*.
84+
As for an enum anonymizer, if you need to create a multicolumn anonymizer based
85+
on a big sample, you can extend the *AbstractMultipleColumnAnonymizer*.
8886
8987
Here is a complete example:
9088
@@ -106,8 +104,7 @@ class MyMulticolumnAnonymizer extends AbstractMultipleColumnAnonymizer
106104
#[\Override]
107105
protected function getColumnNames(): array
108106
{
109-
// Declare here name fo each part of your multicolumn
110-
// anonymizer
107+
// Declare here name of each part of your multicolumn anonymizer.
111108
return [
112109
'part_one',
113110
'part_two',
@@ -119,13 +116,12 @@ class MyMulticolumnAnonymizer extends AbstractMultipleColumnAnonymizer
119116
protected function getSample(): array
120117
{
121118
// Generate here your sample.
122-
123119
return [
124-
['Foo', 'Bar', 'Baz'],
125-
['Foo1', 'Bar1', 'Baz1'],
126-
['Foo2', 'Bar2', 'Baz2'],
127-
['Foo3', 'Bar3', 'Baz3'],
120+
['Foo', 'Bar', 'Baz'],
121+
['Foo1', 'Bar1', 'Baz1'],
122+
['Foo2', 'Bar2', 'Baz2'],
123+
['Foo3', 'Bar3', 'Baz3'],
128124
];
129125
}
130126
}
131-
```
127+
```

docs/content/anonymization/workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ For example, you can automate this workflow **as a CI job** and therefore use a
5050
to play the *intermediate environment* role.
5151

5252
This approach has many benefits:
53-
* You don't need to backup and restore initial state of this environment:
53+
* You don't need to back up and restore initial state of this environment:
5454
the <span class="standalone">`vendor/bin/db-tools anonymize`</span><span class="symfony">`php bin/console db-tools:anonymize`</span>
5555
will be faster,
5656
* You can store the anonymized backup as a CI artefact, it will then be automatically available for

docs/content/backup_restore.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Backup and Restore
1+
# Back up and Restore
22

3-
*DbToolsBundle* comes with two commands to back up and restore
4-
your database but also a tiny backups manager which handle backup files for you.
3+
*DbToolsBundle* comes with two commands to back up and restore your database
4+
but also a tiny backups manager which handle backup files for you.
55

66
## Backup command
77

@@ -36,7 +36,7 @@ You can specify the behavior of the command with some options detailed below.
3636

3737
<div class="standalone">
3838

39-
By default, the command will backup the database from the default connection.
39+
By default, the command will back up the database from the default connection.
4040

4141
If you configured several ones, you can choose to back up a database from a specific
4242
connection with `--connection` option:
@@ -48,7 +48,7 @@ vendor/bin/db-tools backup --connection other_connection_name
4848
</div>
4949
<div class="symfony">
5050

51-
By default, the command will backup the database from the default DBAL connection.
51+
By default, the command will back up the database from the default DBAL connection.
5252

5353
You can choose to back up a database from another connection with `--connection` option:
5454

0 commit comments

Comments
 (0)