php

package
v0.0.0-...-91c21f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PhpComposerBackend = api.LanguageBackend{
	Name:             "php-composer",
	Specfile:         "composer.json",
	Lockfile:         "composer.lock",
	IsAvailable:      composerIsAvailable,
	FilenamePatterns: []string{"*.php"},
	Quirks:           api.QuirksAddRemoveAlsoLocks | api.QuirksAddRemoveAlsoInstalls,
	GetPackageDir: func() string {
		return "vendor"
	},
	Search: search,
	Info:   info,
	Add: func(ctx context.Context, pkgs map[api.PkgName]api.PkgSpec, projectVendorName string) {

		span, ctx := tracer.StartSpanFromContext(ctx, "composer require")
		defer span.Finish()
		cmd := []string{"composer", "require"}

		for name, spec := range pkgs {
			arg := string(name)
			if spec != "" {
				arg += ":" + string(spec)
			}
			cmd = append(cmd, arg)
		}
		util.RunCmd(cmd)
	},
	Remove: func(ctx context.Context, pkgs map[api.PkgName]bool) {

		span, ctx := tracer.StartSpanFromContext(ctx, "composer remove")
		defer span.Finish()
		cmd := []string{"composer", "remove"}
		for name := range pkgs {
			cmd = append(cmd, string(name))
		}
		util.RunCmd(cmd)
	},
	Lock: func(ctx context.Context) {

		span, ctx := tracer.StartSpanFromContext(ctx, "composer update")
		defer span.Finish()
		util.RunCmd([]string{"composer", "update"})
	},
	Install: func(ctx context.Context) {

		span, ctx := tracer.StartSpanFromContext(ctx, "composer install")
		defer span.Finish()
		util.RunCmd([]string{"composer", "install"})
	},
	ListSpecfile: listSpecfile,
	ListLockfile: listLockfile,
	Guess: func(context.Context) (map[string][]api.PkgName, bool) {
		util.NotImplemented()
		return nil, false
	},
	InstallReplitNixSystemDependencies: nix.DefaultInstallReplitNixSystemDependencies,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL