mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01:00
* Adds installed.json functionality and tests Signed-off-by: Blaize Kaye <blaize.kaye@amazee.com> * Adds php-installed-cataloger Signed-off-by: Blaize Kaye <blaize.kaye@amazee.com> * Changes fallback logic Signed-off-by: Blaize Kaye <blaize.kaye@amazee.com> * Adds image tests for installed.json composer packages Signed-off-by: Blaize Kaye <blaize.kaye@amazee.com> * tweak PHP cataloger names Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * unexport PHP types and fix CLI tests Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * rename PHP cataloger file Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
27 lines
827 B
Go
27 lines
827 B
Go
/*
|
|
Package php provides a concrete Cataloger implementation for PHP ecosystem files.
|
|
*/
|
|
package php
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/pkg/cataloger/common"
|
|
)
|
|
|
|
// NewPHPComposerInstalledCataloger returns a new cataloger for PHP installed.json files.
|
|
func NewPHPComposerInstalledCataloger() *common.GenericCataloger {
|
|
globParsers := map[string]common.ParserFn{
|
|
"**/installed.json": parseInstalledJSON,
|
|
}
|
|
|
|
return common.NewGenericCataloger(nil, globParsers, "php-composer-installed-cataloger")
|
|
}
|
|
|
|
// NewPHPComposerLockCataloger returns a new cataloger for PHP composer.lock files.
|
|
func NewPHPComposerLockCataloger() *common.GenericCataloger {
|
|
globParsers := map[string]common.ParserFn{
|
|
"**/composer.lock": parseComposerLock,
|
|
}
|
|
|
|
return common.NewGenericCataloger(nil, globParsers, "php-composer-lock-cataloger")
|
|
}
|