Add php8.3 to known versions

This commit is contained in:
Tom Wiesing 2023-12-07 16:05:36 +01:00
parent 0ab8d3a4e4
commit dc79b5c2d7
No known key found for this signature in database
3 changed files with 19 additions and 4 deletions

View file

@ -16,7 +16,8 @@ import (
var Provision wisski_distillery.Command = pv{} var Provision wisski_distillery.Command = pv{}
type pv struct { type pv struct {
PHPVersion string `short:"p" long:"php" description:"specific php version to use for instance. Should be one of '8.0', '8.1'."` PHPVersion string `short:"p" long:"php" description:"specific php version to use for instance. See 'provision --list-php-versions' for available versions. "`
ListPHPVersions bool `long:"list-php-versions" description:"List available php versions"`
IIPServer bool `short:"i" long:"iip-server" description:"enable iip-server inside this instance"` IIPServer bool `short:"i" long:"iip-server" description:"enable iip-server inside this instance"`
OPCacheDevelopment bool `short:"o" long:"opcache-devel" description:"Include opcache development configuration"` OPCacheDevelopment bool `short:"o" long:"opcache-devel" description:"Include opcache development configuration"`
Flavor string `short:"f" long:"flavor" description:"Use specific flavor. Use '--list-flavors' to list flavors. "` Flavor string `short:"f" long:"flavor" description:"Use specific flavor. Use '--list-flavors' to list flavors. "`
@ -33,7 +34,7 @@ var errMissingSlug = exit.Error{
} }
func (pv pv) AfterParse() error { func (pv pv) AfterParse() error {
if !pv.ListFlavors && pv.Positionals.Slug == "" { if !pv.ListFlavors && !pv.ListPHPVersions && pv.Positionals.Slug == "" {
return errMissingSlug return errMissingSlug
} }
return nil return nil
@ -60,6 +61,9 @@ func (p pv) Run(context wisski_distillery.Context) error {
if p.ListFlavors { if p.ListFlavors {
return p.listFlavors(context) return p.listFlavors(context)
} }
if p.ListPHPVersions {
return p.listPHPVersions(context)
}
instance, err := context.Environment.Provision().Provision(context.Stderr, context.Context, provision.Flags{ instance, err := context.Environment.Provision().Provision(context.Stderr, context.Context, provision.Flags{
Slug: p.Positionals.Slug, Slug: p.Positionals.Slug,
@ -90,3 +94,14 @@ func (pv) listFlavors(context wisski_distillery.Context) error {
encoder.Encode(manager.Profiles()) encoder.Encode(manager.Profiles())
return nil return nil
} }
func (pv) listPHPVersions(context wisski_distillery.Context) error {
for _, v := range models.KnownPHPVersions() {
if v == models.DefaultPHPVersion {
context.Printf("%s (default)\n", v)
} else {
context.Println(v)
}
}
return nil
}

View file

@ -19,7 +19,7 @@ type rebuild struct {
Parallel int `short:"a" long:"parallel" description:"run on (at most) this many instances in parallel. 0 for no limit." default:"1"` Parallel int `short:"a" long:"parallel" description:"run on (at most) this many instances in parallel. 0 for no limit." default:"1"`
System bool `short:"s" long:"system-update" description:"Update the system configuration according to other flags"` System bool `short:"s" long:"system-update" description:"Update the system configuration according to other flags"`
PHPVersion string `short:"p" long:"php" description:"update to specific php version to use for instance. Should be one of '8.0', '8.1'."` PHPVersion string `short:"p" long:"php" description:"update to specific php version to use for instance. See 'provision --list-php-versions' for available versions. "`
IIPServer bool `short:"i" long:"iip-server" description:"enable iip-server inside this instance"` IIPServer bool `short:"i" long:"iip-server" description:"enable iip-server inside this instance"`
OPCacheDevelopment bool `short:"o" long:"opcache-devel" description:"Include opcache development configuration"` OPCacheDevelopment bool `short:"o" long:"opcache-devel" description:"Include opcache development configuration"`
Flavor string `short:"f" long:"flavor" description:"Use specific flavor. Use 'provision --list-flavors' to list flavors. "` Flavor string `short:"f" long:"flavor" description:"Use specific flavor. Use 'provision --list-flavors' to list flavors. "`

View file

@ -25,7 +25,7 @@ func (system System) OpCacheMode() string {
} }
var ( var (
phpVersions = []string{"8.0", "8.1", "8.2"} phpVersions = []string{"8.1", "8.2", "8.3"}
phpVersionMap = (func() map[string]struct{} { phpVersionMap = (func() map[string]struct{} {
m := make(map[string]struct{}, len(phpVersions)) m := make(map[string]struct{}, len(phpVersions))
for _, v := range phpVersions { for _, v := range phpVersions {