From 9f80243b1eeb7b87b6321df9b161ea64eaabf61d Mon Sep 17 00:00:00 2001 From: lnu Date: Wed, 27 Oct 2021 14:31:56 +0200 Subject: [PATCH] feat(php): extensions added + doc updated --- docs/docs/segment-php.md | 4 ++-- docs/sidebars.js | 2 +- src/segment_php.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/segment-php.md b/docs/docs/segment-php.md index 8920d9e4..a7b05aa2 100644 --- a/docs/docs/segment-php.md +++ b/docs/docs/segment-php.md @@ -1,7 +1,7 @@ --- id: php title: php -sidebar_label: php +sidebar_label: PHP --- ## What @@ -32,5 +32,5 @@ Display the currently active php version. - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - - `files`: the segment is only displayed when `*.php` files are present (default) + - `files`: the segment is only displayed when `*.php, composer.json, composer.lock, .php-version` files are present (default) - enable_hyperlink: `bool` - display an hyperlink to the php release notes - defaults to `false` diff --git a/docs/sidebars.js b/docs/sidebars.js index 789dc4c8..a7a6de59 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -48,6 +48,7 @@ module.exports = { "os", "owm", "path", + "php", "python", "root", "ruby", @@ -59,7 +60,6 @@ module.exports = { "text", "time", "ytm", - "php", ], }, { diff --git a/src/segment_php.go b/src/segment_php.go index 6bf5127e..eca30264 100644 --- a/src/segment_php.go +++ b/src/segment_php.go @@ -12,7 +12,7 @@ func (n *php) init(props *properties, env environmentInfo) { n.language = &language{ env: env, props: props, - extensions: []string{"*.php", "composer.json", ".php-version"}, + extensions: []string{"*.php", "composer.json", "composer.lock", ".php-version"}, commands: []*cmd{ { executable: "php",