oh-my-posh/src/segment_php.go

30 lines
678 B
Go
Raw Normal View History

2021-10-27 01:52:56 -07:00
package main
type php struct {
language *language
}
func (n *php) string() string {
return n.language.string()
}
2021-11-26 01:37:33 -08:00
func (n *php) init(props properties, env environmentInfo) {
2021-10-27 01:52:56 -07:00
n.language = &language{
env: env,
props: props,
extensions: []string{"*.php", "composer.json", "composer.lock", ".php-version"},
2021-10-27 01:52:56 -07:00
commands: []*cmd{
{
executable: "php",
args: []string{"--version"},
regex: `(?:PHP (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,
},
},
versionURLTemplate: "[%[1]s](https://www.php.net/ChangeLog-%[2]s.php#PHP_%[2]s_%[3]s)",
}
}
func (n *php) enabled() bool {
return n.language.enabled()
}