github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/pkg/cataloger/php/cataloger.go (about)

     1  /*
     2  Package php provides a concrete Cataloger implementation relating to packages within the PHP language ecosystem.
     3  */
     4  package php
     5  
     6  import (
     7  	"github.com/anchore/syft/syft/pkg"
     8  	"github.com/anchore/syft/syft/pkg/cataloger/generic"
     9  )
    10  
    11  // Note about the distinction between composer.lock and installed.json: composer.lock and installed.json have different
    12  // semantic meanings. The lock file represents what should be installed, whereas the installed file represents what is installed.
    13  
    14  // NewComposerInstalledCataloger returns a new cataloger for PHP installed.json files.
    15  func NewComposerInstalledCataloger() pkg.Cataloger {
    16  	return generic.NewCataloger("php-composer-installed-cataloger").
    17  		WithParserByGlobs(parseInstalledJSON, "**/installed.json")
    18  }
    19  
    20  // NewComposerLockCataloger returns a new cataloger for PHP composer.lock files.
    21  func NewComposerLockCataloger() pkg.Cataloger {
    22  	return generic.NewCataloger("php-composer-lock-cataloger").
    23  		WithParserByGlobs(parseComposerLock, "**/composer.lock")
    24  }