Download the PHP package gumslone/laravel-package-url without Composer
On this page you can find all versions of the php package gumslone/laravel-package-url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gumslone/laravel-package-url
More information about gumslone/laravel-package-url
Files in gumslone/laravel-package-url
Package laravel-package-url
Short Description Package URL (purl) for Laravel — parse, build, normalize and validate purls per the spec, plus registry/repository/download URL resolution, ecosystem mapping, and CPE-friendly helpers.
License MIT
Homepage https://github.com/gumslone/laravel-package-url
Informations about the package laravel-package-url
laravel-package-url
Package URL (purl) for Laravel — parse, build, normalize and validate purls, plus registry / repository / download URL resolution, vulnerability-database ecosystem mapping, and reverse-parsing from VCS URLs.
The core is a faithful, dependency-light implementation of the purl spec that
passes the entire official package-url/purl-spec conformance suite (base
spec + all 40+ type definitions) — the same suite
packageurl-php and
packageurl-python test
against — and then goes further with the helpers you actually need in an app.
Installation
The service provider and Purl facade are auto-discovered.
Core: parse, build, normalize, validate
Normalization follows the spec: the type is lowercased, qualifier keys are
lowercased/sorted with empty values dropped, subpaths are cleaned, and
type-specific rules apply (e.g. pypi lowercases the name and turns _ into
-; github/bitbucket/golang lowercase namespace and name). Invalid
purls throw PackageUrlException — including per-type rules such as swift
requiring a namespace, vcpkg/otp forbidding one, and chrome-extension
id/version formats.
Extended: the Purl facade
Checks
Non-throwing booleans to guard a conversion before you attempt it:
Registry, repository & download URLs
Coverage matches (and extends) packageurl-python's purl2url:
- repositoryUrl — cargo, bitbucket, github, gitlab, gem, cran, npm, pypi, composer, nuget, hackage, golang, cocoapods, maven (+ hex, pub, conda).
- downloadUrl — cargo, gem, npm, maven, hackage, nuget, github, gitlab, bitbucket, hex, golang, pub, swift, luarocks, conda, alpm, deb, apk.
A download_url qualifier always takes precedence. Distro artifact URLs
(deb/apk/alpm/conda) read the relevant qualifiers (arch, repo, channel, …).
Vulnerability-database ecosystem mapping
Reverse-parse from a URL
From a VCS repository URL:
From a download / registry URL — the inverse of downloadUrl():
Recognition covers (and extends) packageurl-python's url2purl: npm
(incl. yarnpkg mirrors), PyPI (CDN files, /packages/source, project/JSON
API), RubyGems, crates.io, NuGet, Maven, Go (proxy + pkg.go.dev), Hex,
Composer/Packagist, pub.dev, CocoaPods, Hackage, LuaRocks, CRAN, SourceForge
and Google Code archives (→ pkg:generic), and the full GitHub / GitLab /
Bitbucket surface — web, REST API (api.github.com/repos),
codeload.github.com, archive/release/download, and raw/blob/tree/
commit refs. Returns null for anything unrecognised.
Pairs well with
gumslone/laravel-purl2cpe— resolve a purl to its NVD CPE (vendor/product) from the curated scanoss/purl2cpe database.
Testing
The suite runs the bundled official conformance data under tests/data.
Credits
- The purl specification and conformance suite: package-url/purl-spec (MIT).
Support
If this package saves you time, consider supporting its development:
License
MIT. See LICENSE. Bundled test fixtures are from package-url/purl-spec, also MIT.