Documentation
¶
Index ¶
- func BinBasename(binEntry string) string
- func BuildIncludePath(packageName, binEntry string) string
- func CheckComposerVersion(composerPath string) error
- func FindComposer(projectDir string) (string, error)
- func GenerateInstalledJSON(lock *parser.ComposerLock) ([]byte, error)
- func GenerateInstalledPHP(lock *parser.ComposerLock, composerJSON map[string]interface{}) string
- func GeneratePHPProxyNoShebang(packageName, binEntry string) string
- func GeneratePHPProxyWithShebang(packageName, binEntry string) string
- func GenerateShellProxy(packageName, binEntry string) string
- func RunDumpautoload(composerPath, projectDir string, verbose, noDev bool) error
- func WriteInstalledFiles(vendorDir string, lock *parser.ComposerLock, ...) error
- type BinTargetType
- type InstalledJSON
- type InstalledPackage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinBasename ¶
BinBasename extracts the filename from a bin entry path.
func BuildIncludePath ¶
BuildIncludePath returns the PHP include path string for a bin proxy.
func CheckComposerVersion ¶
CheckComposerVersion verifies Composer >= 2.0.
func FindComposer ¶
FindComposer locates the composer binary by precedence: 1. ALLEGRO_COMPOSER_PATH env var 2. "composer" in PATH 3. "composer.phar" in projectDir
func GenerateInstalledJSON ¶
func GenerateInstalledJSON(lock *parser.ComposerLock) ([]byte, error)
GenerateInstalledJSON creates installed.json content from composer.lock data.
func GenerateInstalledPHP ¶
func GenerateInstalledPHP(lock *parser.ComposerLock, composerJSON map[string]interface{}) string
GenerateInstalledPHP creates installed.php content.
func GeneratePHPProxyNoShebang ¶
GeneratePHPProxyNoShebang generates the proxy for PHP targets without a shebang.
func GeneratePHPProxyWithShebang ¶
GeneratePHPProxyWithShebang generates the proxy for PHP targets with a shebang.
func GenerateShellProxy ¶
GenerateShellProxy generates the POSIX shell proxy for non-PHP targets.
func RunDumpautoload ¶
RunDumpautoload runs "composer dumpautoload" in the given directory. Does not use --optimize by default, matching Composer's own install behavior. Users who want optimized autoloading can run `composer dumpautoload --optimize` separately.
func WriteInstalledFiles ¶
func WriteInstalledFiles(vendorDir string, lock *parser.ComposerLock, composerJSON map[string]interface{}) error
WriteInstalledFiles writes installed.json and installed.php to vendor/composer/.
Types ¶
type BinTargetType ¶
type BinTargetType int
BinTargetType classifies a bin target file.
const ( BinPHPNoShebang BinTargetType = iota BinPHPWithShebang BinNonPHP )
func DetectBinTarget ¶
func DetectBinTarget(path string) (BinTargetType, error)
DetectBinTarget reads the first 500 bytes and classifies the file.
type InstalledJSON ¶
type InstalledJSON struct {
Packages []InstalledPackage `json:"packages"`
Dev bool `json:"dev"`
DevPackageNames []string `json:"dev-package-names"`
}
InstalledJSON represents vendor/composer/installed.json.
type InstalledPackage ¶
type InstalledPackage struct {
Name string `json:"name"`
Version string `json:"version"`
VersionNormalized string `json:"version_normalized,omitempty"`
Type string `json:"type"`
Require map[string]string `json:"require,omitempty"`
Autoload interface{} `json:"autoload"`
InstallPath string `json:"install-path"`
Extra map[string]interface{} `json:"extra,omitempty"`
Description string `json:"description,omitempty"`
Bin []string `json:"bin,omitempty"`
NotificationURL string `json:"notification-url,omitempty"`
Replace map[string]string `json:"replace,omitempty"`
Provide map[string]string `json:"provide,omitempty"`
Source map[string]interface{} `json:"source,omitempty"`
}
InstalledPackage represents a single package in installed.json. InstalledPackage represents a single package in installed.json.