github.com/anchore/syft@v1.38.2/syft/pkg/php.go (about)

     1  package pkg
     2  
     3  // PhpComposerInstalledEntry represents a single package entry from a composer v1/v2 "installed.json" files (very similar to composer.lock files).
     4  type PhpComposerInstalledEntry PhpComposerLockEntry
     5  
     6  // PhpComposerLockEntry represents a single package entry found from a composer.lock file.
     7  type PhpComposerLockEntry struct {
     8  	// Name is package name in vendor/package format (e.g. symfony/console)
     9  	Name string `json:"name"`
    10  
    11  	// Version is the package version
    12  	Version string `json:"version"`
    13  
    14  	// Source is the source repository information for development (typically git repo, used when passing --prefer-source). Originates from source code repository.
    15  	Source PhpComposerExternalReference `json:"source"`
    16  
    17  	// Dist is distribution archive information for production (typically zip/tar, default install method). Packaged version of released code.
    18  	Dist PhpComposerExternalReference `json:"dist"`
    19  
    20  	// Require is runtime dependencies with version constraints (package will not install unless these requirements can be met)
    21  	Require map[string]string `json:"require,omitempty"`
    22  
    23  	// Provide is virtual packages/functionality provided by this package (allows other packages to depend on capabilities)
    24  	Provide map[string]string `json:"provide,omitempty"`
    25  
    26  	// RequireDev is development-only dependencies (not installed in production, only when developing this package or running tests)
    27  	RequireDev map[string]string `json:"require-dev,omitempty"`
    28  
    29  	// Suggest is optional but recommended dependencies (suggestions for packages that would extend functionality)
    30  	Suggest map[string]string `json:"suggest,omitempty"`
    31  
    32  	// License is the list of license identifiers (SPDX format)
    33  	License []string `json:"license,omitempty"`
    34  
    35  	// Type is package type indicating purpose (library=reusable code, project=application, metapackage=aggregates dependencies, etc.)
    36  	Type string `json:"type,omitempty"`
    37  
    38  	// NotificationURL is the URL to notify when package is installed (for tracking/statistics)
    39  	NotificationURL string `json:"notification-url,omitempty"`
    40  
    41  	// Bin is the list of binary/executable files that should be added to PATH
    42  	Bin []string `json:"bin,omitempty"`
    43  
    44  	// Authors are the list of package authors with name/email/homepage
    45  	Authors []PhpComposerAuthors `json:"authors,omitempty"`
    46  
    47  	// Description is a human-readable package description
    48  	Description string `json:"description,omitempty"`
    49  
    50  	// Homepage is project homepage URL
    51  	Homepage string `json:"homepage,omitempty"`
    52  
    53  	// Keywords are the list of keywords for package discovery/search
    54  	Keywords []string `json:"keywords,omitempty"`
    55  
    56  	// Time is timestamp when this package version was released
    57  	Time string `json:"time,omitempty"`
    58  }
    59  
    60  // PhpComposerExternalReference represents source or distribution information for a PHP package, indicating where the package code is retrieved from.
    61  type PhpComposerExternalReference struct {
    62  	// Type is reference type (git for source VCS, zip/tar for dist archives)
    63  	Type string `json:"type"`
    64  
    65  	// URL is the URL to the resource (git repository URL or archive download URL)
    66  	URL string `json:"url"`
    67  
    68  	// Reference is git commit hash or version tag for source, or archive version for dist
    69  	Reference string `json:"reference"`
    70  
    71  	// Shasum is SHA hash of the archive file for integrity verification (dist only)
    72  	Shasum string `json:"shasum,omitempty"`
    73  }
    74  
    75  // PhpComposerAuthors represents author information for a PHP Composer package from the authors field in composer.json.
    76  type PhpComposerAuthors struct {
    77  	// Name is author's full name
    78  	Name string `json:"name"`
    79  
    80  	// Email is author's email address
    81  	Email string `json:"email,omitempty"`
    82  
    83  	// Homepage is author's personal or company website
    84  	Homepage string `json:"homepage,omitempty"`
    85  }
    86  
    87  // PhpPeclEntry represents a single package entry found within php pecl metadata files.
    88  //
    89  // Deprecated: please use PhpPearEntry instead with the pear cataloger.
    90  type PhpPeclEntry PhpPearEntry
    91  
    92  // PhpPearEntry represents a single package entry found within php pear metadata files.
    93  type PhpPearEntry struct {
    94  	// Name is the package name
    95  	Name string `json:"name"`
    96  
    97  	// Channel is PEAR channel this package is from
    98  	Channel string `json:"channel,omitempty"`
    99  
   100  	// Version is the package version
   101  	Version string `json:"version"`
   102  
   103  	// License is the list of applicable licenses
   104  	License []string `json:"license,omitempty"`
   105  }