adachsoft / remote-code-browser-lib
Ecosystem-agnostic library for browsing remote package source code.
Package info
gitlab.com/a.adach/remote-code-browser-lib
pkg:composer/adachsoft/remote-code-browser-lib
Requires
- php: >=8.3
- ext-zip: *
- adachsoft/collection: ^3.0
- adachsoft/normalized-safe-path: ^0.1
Requires (Dev)
- adachsoft/php-code-style: ^0.7.4
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^12.4
- rector/rector: ^2.9
- symplify/phpstan-rules: ^14.19
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
An ecosystem-agnostic domain library for resolving package versions, caching and extracting source archives, and browsing package files locally. Applications provide the adapters that connect the library to a package ecosystem and its archive source.
Features
- Resolve an explicitly requested version or the latest stable version.
- Fetch and cache package source archives, then extract ZIP archives.
- List files and directories with optional recursion and depth limits.
- Read files with an optional maximum size.
- Search extracted source trees by file name.
- Use interfaces for package-version lookup and archive fetching, keeping ecosystem-specific integration outside the domain library.
Requirements
- PHP 8.3 or newer.
- The PHP ZIP extension.
Installation
composer require adachsoft/remote-code-browser-lib
Usage
See the usage example for complete service wiring and browsing operations.
Integration
Implement PackageVersionProviderInterface and PackageArchiveFetcherInterface for the package ecosystem used by your application. Inject those adapters into RemoteCodeBrowserService together with the library's cache, path, listing, reading, and search services. The library does not make network requests or select an ecosystem-specific package registry by itself.
See the usage example for service wiring and browsing operations.