Ship the default config in each core package and add config:publish
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Start by reading Config::import and the existing UploadConfigProvider, LoggerConfig, and module:generate config handling; inspect the starter project's config files and the package registration points. Resolve the open merge and application-file decisions, coordinating with #619 because it changes the same resolution path. Add tests for merge order, missing application files, existing-config compatibility, and config:publish; done means all acceptance criteria pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Move the default configuration of the app-wide packages (cache, mailer, session, lang, logging, view, view_cache, fs, rate_limit, captcha, database, auth, cors) from the starter project into the framework's packages. Each package ships its defaults, Config merges them under the application's file, and a new php qt config:publish command copies a default into shared/config/ for editing.
Why
- The framework loads 15 config files in 16 places, always as
config()->import(new Setup('config', '<name>')), and throws aConfigExceptionwhen one is missing. So it depends on files that only the starter project ships. - Every release needs hand edits in the application. The 3.1.0 starter project had to add the
resendmailer entry,logging.message.limitandmailer.transport_log_limit, change the shape oflang.php, and removehooks.php. An existing application never receives them. - The framework already has half of the idea:
UploadConfigProviderandLoggerConfigkeep defaults in code, andmodule:generatecopies module config from templates. The app-wide packages have neither a default nor a merge, andConfig::importthrows when a name is imported twice. - Laravel (
mergeConfigFromandvendor:publish) and Symfony (Flex recipes) both keep the defaults next to the code that reads them.
Scope
- Defaults per package, at
src/<Package>/config/<name>.php, with the same keys andenv()reads as the starter project's file today. Configresolves a name from three layers: the package default (lowest), thenshared/config/<name>.php, then the module's file, where the later layer wins. A missing application file is no longer fatal.php qt config:publish <name>(and--all) copies a default intoshared/config/, and does not overwrite an existing file without a flag.- The starter project keeps its config files at first, so no application breaks. Trimming them is a later, separate change.
Designed for extracted packages
The packages are to be extracted into separate Composer packages later, and their config has to install the same way, or almost:
- a package's defaults live inside its own folder and reference nothing outside it;
- defaults are found through a registry (package name to config path) that each package registers, and
Configdoes not hard-code a path; config:publishworks by package name, so an extracted package registers itself and the same command publishes it;- a Composer plugin that copies the config on install can be added later on top of this. It is not a prerequisite.
To decide
- how lists and nested arrays merge (replace or merge by key)
- whether an application still needs its own file for the required packages
- whether the starter project keeps full copies or only the values that differ from the defaults
Related
- #619 (remove the
hierarchyflag fromConfigSetup) changes the same config resolution and should be planned together with this ticket. - #644 splits the
commontranslations into files by topic, which follows the same idea for translations.
Out of scope
- Moving or splitting any package into its own repository.
- A Composer plugin.
Acceptance criteria
- an application with no
shared/config/cache.phpboots and uses the cache defaults - a value in
shared/config/<name>.phpwins over the default, and a key it omits falls back to the default - an application that keeps its current config files behaves exactly as before
php qt config:publish <name>writes the default file and refuses to overwrite an existing one without a flag- a package registers its defaults in one place, and removing that registration is the only change needed to extract the package
- tests cover the merge order, the missing application file and the publish command
- Ngôn ngữ chính
- PHP
- Star
- 43
- Fork
- 22
- Merge trung bình
- 54 phút
- Pull request đã merge (30 ngày)
- 57
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quantum-php/framework
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quantum-php/framework#692 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
routing testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
quantum-php/framework#547 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
quantum-php/framework#694 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Raise PHPStan to level 9Đang mởrefactoring tech debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
quantum-php/framework#693 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
install:debugbar reads the package folder from the working directory and uses the default storage adapterCó thể đã có người làm @armanist đã nhận hôm nay. Đang mởbug console debugbar good first issue
quantum-php/framework#691 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quantum-php/framework
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
ajeetraina/awesome-docker-sbx#559 ·
-
dependencies enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
novalo-dev/Prestashop-MCP-Server#329 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug origin:interactive status:available
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Ultimate-Multisite/ultimate-multisite#2131 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày