Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 17 additions & 0 deletions db_sync_tool/utility/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@ def set_is_same_client(value: bool) -> None:
_set_config_value('is_same_client', value)


_FRAMEWORK_TYPE_MAP = {
'typo3': 'TYPO3',
'symfony': 'Symfony',
'drupal': 'Drupal',
'wordpress': 'Wordpress',
'laravel': 'Laravel',
}
Comment thread
konradmichalik marked this conversation as resolved.


def _normalize_framework_type() -> None:
"""Normalize framework type to canonical casing before validation."""
_type = config.get('type')
if isinstance(_type, str):
config['type'] = _FRAMEWORK_TYPE_MAP.get(_type.lower(), _type)


def set_use_sshpass(value: bool) -> None:
"""Set use_sshpass flag."""
_set_config_value('use_sshpass', value)
Expand Down Expand Up @@ -206,6 +222,7 @@ def get_configuration(host_config, args = {}):
link_configuration_with_hosts()
build_config(args)

_normalize_framework_type()
validation.check(config)
check_options()

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ target:
Specify the framework for automatic credential extraction:

```yaml
type: TYPO3 # or SYMFONY, DRUPAL, WORDPRESS, LARAVEL
type: TYPO3 # or Symfony, Drupal, Wordpress, Laravel
```

If omitted, the tool attempts to detect the framework from the file path.
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Complete reference for `config.yaml` (or `config.json`).
## Full Configuration

```yaml
# Application type: TYPO3 | SYMFONY | DRUPAL | WORDPRESS | LARAVEL
# Application type: TYPO3 | Symfony | Drupal | Wordpress | Laravel
# Not necessary if database credentials are provided manually
type:

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/drupal.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Example for [receiver mode](/reference/sync-modes#receiver):

```bash
db_sync_tool \
--type DRUPAL \
--type Drupal \
--origin-host <ORIGIN_HOST> \
--origin-user <ORIGIN_USER> \
--origin-path <ORIGIN_PATH> \
Expand All @@ -32,7 +32,7 @@ Point the `path` to the Drupal installation directory:

```yaml
# config.yaml
type: DRUPAL
type: Drupal
target:
path: /var/www/local/drupal
origin:
Expand All @@ -44,7 +44,7 @@ origin:
## Complete Example

```yaml
type: DRUPAL
type: Drupal
target:
path: /var/www/local/drupal
origin:
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/laravel.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Example for [receiver mode](/reference/sync-modes#receiver):

```bash
db_sync_tool \
--type LARAVEL \
--type Laravel \
--origin-host <ORIGIN_HOST> \
--origin-user <ORIGIN_USER> \
--origin-path <ORIGIN_PATH> \
Expand All @@ -23,7 +23,7 @@ db_sync_tool \

```yaml
# config.yaml
type: LARAVEL
type: Laravel
target:
path: /var/www/local/laravel/.env
origin:
Expand All @@ -35,7 +35,7 @@ origin:
## Complete Example

```yaml
type: LARAVEL
type: Laravel
target:
path: /var/www/local/laravel/.env
origin:
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Example for [receiver mode](/reference/sync-modes#receiver):

```bash
db_sync_tool \
--type WORDPRESS \
--type Wordpress \
--origin-host <ORIGIN_HOST> \
--origin-user <ORIGIN_USER> \
--origin-path <ORIGIN_PATH> \
Expand All @@ -25,7 +25,7 @@ db_sync_tool \

```yaml
# config.yaml
type: WORDPRESS
type: Wordpress
target:
path: /var/www/local/wordpress/wp-config.php
origin:
Expand All @@ -37,7 +37,7 @@ origin:
## Complete Example

```yaml
type: WORDPRESS
type: Wordpress
target:
path: /var/www/local/wordpress/wp-config.php
origin:
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ db_sync_tool [OPTIONS] [ORIGIN] [TARGET]

| Option | Short | Description |
|--------|-------|-------------|
| `--type` | `-t` | Framework type: `TYPO3`, `SYMFONY`, `DRUPAL`, `WORDPRESS`, `LARAVEL` |
| `--type` | `-t` | Framework type: `TYPO3`, `Symfony`, `Drupal`, `Wordpress`, `Laravel` |

## Transfer Options

Expand Down
Loading