diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-12 07:01:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-15 09:27:59 +0900 |
| commit | 592ab8b1a2d73a1f77db8a7b7e17238ce3577030 (patch) | |
| tree | ccd0e3d550c9591557a84112f110bea355cb7444 /crates/shirabe/src/command/diagnose_command.rs | |
| parent | bb4684f7d1c51bc1be9c1bda1b00cb52c839cd25 (diff) | |
| download | php-shirabe-592ab8b1a2d73a1f77db8a7b7e17238ce3577030.tar.gz php-shirabe-592ab8b1a2d73a1f77db8a7b7e17238ce3577030.tar.zst php-shirabe-592ab8b1a2d73a1f77db8a7b7e17238ce3577030.zip | |
feat(cli): report Shirabe's own identity instead of Composer's
The binary called itself Composer everywhere: the application name, the
logo, --version, about, and every warning that talks about the running
program. Prompts to file a bug also pointed at Composer's issue tracker.
Add SHIRABE_VERSION and SHIRABE_RELEASE_DATE next to the Composer version
constants and report those, naming the Composer version this port tracks
alongside them. Composer::VERSION and getVersion() are untouched, so the
composer platform package, composer-runtime-api and the HTTP User-Agent
keep the value plugins and package repositories expect.
build.rs stamps the release date with the UTC date of the HEAD commit,
the way Composer's Compiler fills in @release_date@ when building the
phar. It now also fails the build when git cannot be read, instead of
letting COMPOSER_DEV_WARNING_TIME fall back to the tagged-release value
and suppress the outdated-build warning forever.
Messages about the Composer ecosystem keep their wording. Two of them are
pinned by upstream installer fixtures (Rule's "cannot be modified by
Composer" and SolverProblemsException's "you can run Composer with") and
stay as they are so those fixtures can keep being used verbatim.
The e2e list comparison against upstream Composer now skips the banner,
which cannot match by design, and compares everything below it as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/diagnose_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/diagnose_command.rs | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs index da043a4f..451b051c 100644 --- a/crates/shirabe/src/command/diagnose_command.rs +++ b/crates/shirabe/src/command/diagnose_command.rs @@ -177,7 +177,7 @@ impl DiagnoseCommand { let mut result_list: Vec<PhpMixed> = vec![]; let mut tls_warning: Option<String> = None; if proto == "https" && config.borrow().get("disable-tls").as_bool() == Some(true) { - tls_warning = Some("<warning>Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.</warning>".to_string()); + tls_warning = Some("<warning>Shirabe is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.</warning>".to_string()); } match self @@ -236,7 +236,7 @@ impl DiagnoseCommand { let mut tls_warning: Option<String> = None; if url.starts_with("https://") && config.borrow().get("disable-tls").as_bool() == Some(true) { - tls_warning = Some("<warning>Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.</warning>".to_string()); + tls_warning = Some("<warning>Shirabe is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.</warning>".to_string()); } match self @@ -964,7 +964,7 @@ impl DiagnoseCommand { ), other => { return Err(InvalidArgumentException::new(format!( - "DiagnoseCommand: Unknown error type \"{}\". Please report at https://github.com/composer/composer/issues/new.", + "DiagnoseCommand: Unknown error type \"{}\". Please report at https://github.com/nsfisis/php-shirabe/issues/new.", other, )) .into()); @@ -989,7 +989,7 @@ impl DiagnoseCommand { "zlib" => { display_ini_message = true; format!( - "The zlib extension is not loaded, this can slow down Composer a lot.{}If possible, enable it or recompile php with --with-zlib{}", + "The zlib extension is not loaded, this can slow down Shirabe a lot.{}If possible, enable it or recompile php with --with-zlib{}", PHP_EOL, PHP_EOL ) } @@ -1021,29 +1021,29 @@ impl DiagnoseCommand { ) } "xdebug_loaded" => format!( - "The xdebug extension is loaded, this can slow down Composer a little.{} Disabling it when using Composer is recommended.", + "The xdebug extension is loaded, this can slow down Shirabe a little.{} Disabling it when using Shirabe is recommended.", PHP_EOL ), "xdebug_profile" => { display_ini_message = true; format!( - "The xdebug.profiler_enabled setting is enabled, this can slow down Composer a lot.{}Add the following to the end of your `php.ini` to disable it:{} xdebug.profiler_enabled = 0", + "The xdebug.profiler_enabled setting is enabled, this can slow down Shirabe a lot.{}Add the following to the end of your `php.ini` to disable it:{} xdebug.profiler_enabled = 0", PHP_EOL, PHP_EOL ) } "onedrive" => format!( - "The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.{}Upgrade your PHP ({}) to use this location with Composer.{}", + "The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.{}Upgrade your PHP ({}) to use this location with Shirabe.{}", PHP_EOL, current.as_string().unwrap_or(""), PHP_EOL ), "uopz" => format!( - "The uopz extension ignores exit calls and may not work with all Composer commands.{}Disabling it when using Composer is recommended.", + "The uopz extension ignores exit calls and may not work with all Shirabe commands.{}Disabling it when using Shirabe is recommended.", PHP_EOL ), other => { return Err(InvalidArgumentException::new(format!( - "DiagnoseCommand: Unknown warning type \"{}\". Please report at https://github.com/composer/composer/issues/new.", + "DiagnoseCommand: Unknown warning type \"{}\". Please report at https://github.com/nsfisis/php-shirabe/issues/new.", other, )) .into()); @@ -1197,17 +1197,18 @@ impl Command for DiagnoseCommand { let r = self.check_pub_keys(&config.borrow())?; self.output_result(r); - io.write_no_newline("Checking Composer version: "); + io.write_no_newline("Checking Shirabe version: "); let r = self.check_version(&config)?; self.output_result(r); } io.write(&format!( - "Composer version: <comment>{}</comment>", - composer::get_version() + "Shirabe version: <comment>{}</comment> (based on Composer <comment>{}</comment>)", + composer::SHIRABE_VERSION, + composer::VERSION )); - io.write_no_newline("Checking Composer and its dependencies for vulnerabilities: "); + io.write_no_newline("Checking Shirabe and its dependencies for vulnerabilities: "); let r = self.check_composer_audit(&config)?; self.output_result(r); |
