Task: #53687 Support instance-specific cfg write targets and add coverage #3

Closed
alejandro.sosa wants to merge 0 commits from 53687/task-support-instance-specific-cfg-write-target into master
Member

cfg behavior (functional summary)

cfg separates two concepts:
--pkgPath (-p): where extension/package default files are read from (<prefix>.default.conf.php).
--appPath (-a): where local/override configuration is written (config/...).

So -p does not define the write target; it defines the defaults source.

  1. Global configuration (existing)
cfg -p public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523..."'
  • Reads defaults from: public/extensions/myCEESV/config/myCEESV.default.conf.php
  • Writes to global local config: ./config/myCEESV.conf.php (if -a is not provided, cwd is used)
  1. Global configuration in an instance subdirectory (new)
cfg -p public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523..."' --directory-name=owner_xyz
  • Reads defaults from: public/extensions/myCEESV/config/myCEESV.default.conf.php
  • Writes to: ./config/owner_xyz/myCEESV.conf.php
  • --site or --directory-name accepts both owner_xyz and config/owner_xyz (both normalize to the same target)
  1. Configuration inside the extension tree (existing)
cfg -p public/extensions/myCEESV/ -a public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523226823721217"'
  • Reads defaults from: public/extensions/myCEESV/config/myCEESV.default.conf.php
  • Writes to: public/extensions/myCEESV/config/myCEESV.conf.php

Technical note
A bug was fixed in Settings::load() so cfg no longer fails when the extension default config does not define mode; it now applies an automatic fallback and does not require -m.

Please test cfg with instance-specific targets:

From an instance root (cd <path2instance>), run:

cfg -p public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523..."' --directory-name=owner_xyz
cfg -p public/extensions/myCEESV/ write myCEESV 'auth:clientId="service-9999-qual@myceesv.ch"' --directory-name=owner_xyz
cfg -p public/extensions/myCEESV/ show myCEESV --site=owner_xyz

Expected:

  • Writes go to config/owner_xyz/myCEESV.conf.php (directory created if missing)
  • Local file config/myCEESV.conf.php is untouched when --directory-name/--site is used
  • Repeated writes merge values and create .bak when overwriting existing instance config
  • Without --directory-name/--site, behavior stays unchanged (writes to local config)
### cfg behavior (functional summary) cfg separates two concepts: • `--pkgPath` (`-p`): where extension/package default files are read from (`<prefix>.default.conf.php`). • `--appPath `(`-a`): where local/override configuration is written (`config/...`). So `-p` does not define the write target; it defines the defaults source. 1) Global configuration (existing) ```shell cfg -p public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523..."' ``` - Reads defaults from: `public/extensions/myCEESV/config/myCEESV.default.conf.php` - Writes to global local config: .`/config/myCEESV.conf.php` (if -a is not provided, cwd is used) 2) Global configuration in an instance subdirectory (new) ```shell cfg -p public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523..."' --directory-name=owner_xyz ``` - Reads defaults from: public/extensions/myCEESV/config/myCEESV.default.conf.php - Writes to: `./config/owner_xyz/myCEESV.conf.php` - `--site` or `--directory-name` accepts both owner_xyz and config/owner_xyz (both normalize to the same target) 3) Configuration inside the extension tree (existing) ```shell cfg -p public/extensions/myCEESV/ -a public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523226823721217"' ``` - Reads defaults from: `public/extensions/myCEESV/config/myCEESV.default.conf.php` - Writes to: `public/extensions/myCEESV/config/myCEESV.conf.php` **Technical note** A bug was fixed in Settings::load() so cfg no longer fails when the extension default config does not define mode; it now applies an automatic fallback and does not require -m. ### Please test cfg with instance-specific targets: From an instance root (`cd <path2instance>`), run: ``` cfg -p public/extensions/myCEESV/ write myCEESV 'auth:projectId="218523..."' --directory-name=owner_xyz cfg -p public/extensions/myCEESV/ write myCEESV 'auth:clientId="service-9999-qual@myceesv.ch"' --directory-name=owner_xyz cfg -p public/extensions/myCEESV/ show myCEESV --site=owner_xyz ``` **Expected:** - Writes go to `config/owner_xyz/myCEESV.conf.php` (directory created if missing) - Local file `config/myCEESV.conf.php` is untouched when `--directory-name/--site` is used - Repeated writes merge values and create `.bak` when overwriting existing instance config - Without `--directory-name/--site`, behavior stays unchanged (writes to local config)
alejandro.sosa force-pushed 53687/task-support-instance-specific-cfg-write-target from e2cc59fe91 to adf5a98768 2026-03-26 09:12:17 +00:00 Compare
Author
Member

Closing this pull request because it was created with the wrong Git user/author metadata. I opened a replacement PR from a new branch with the correct author information.

Check the PR link below instead of this current one
New PR: #4

Closing this pull request because it was created with the wrong Git user/author metadata. I opened a replacement PR from a new branch with the correct author information. Check the PR link below instead of this current one New PR: https://code.verua.online/rabe/Util-Settings/pulls/4
alejandro.sosa closed this pull request 2026-03-26 09:21:09 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rabe/Util-Settings!3
No description provided.