aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core/src/lib.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 20:34:27 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 20:44:37 +0900
commit5254a9e9b698c3618229f4f802b39a82baf9169a (patch)
treed89127778b56ee0421d9838a1dc462eaa7599eab /crates/mozart-core/src/lib.rs
parent884d9ab32bbca7a8ec5c7ee7d42cbde0e7e6babf (diff)
downloadphp-mozart-5254a9e9b698c3618229f4f802b39a82baf9169a.tar.gz
php-mozart-5254a9e9b698c3618229f4f802b39a82baf9169a.tar.zst
php-mozart-5254a9e9b698c3618229f4f802b39a82baf9169a.zip
feat(core): port Factory::createConfig() as factory::create_config()
Adds crates/mozart-core/src/factory.rs with get_cache_dir(), get_data_dir(), and create_config() — a Rust port of Composer\Factory::createConfig() (auth loading and htaccess creation are out of scope for now). Also fixes a correctness bug on Linux: the previous Config::default() resolved cache-dir to $XDG_CONFIG_HOME/composer/cache via the {$home}/cache placeholder, whereas Composer uses the XDG cache base ($XDG_CACHE_HOME or ~/.cache), giving ~/.cache/composer. Callers updated: - Composer::load() uses create_config() as the global baseline before merging project-level config. - config command execute_read() builds the global baseline with create_config() and overlays local config on top when not --global, matching Composer's actual layering order. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-core/src/lib.rs')
-rw-r--r--crates/mozart-core/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/mozart-core/src/lib.rs b/crates/mozart-core/src/lib.rs
index 1264292..74f3512 100644
--- a/crates/mozart-core/src/lib.rs
+++ b/crates/mozart-core/src/lib.rs
@@ -2,6 +2,7 @@ pub mod composer;
pub mod config;
pub mod console;
pub mod exit_code;
+pub mod factory;
pub mod http;
pub mod package;
pub mod platform;