seld/phar-utils
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The "seld/phar-utils" is a comprehensive PHP tool that provides utilities for PHAR file format handling. It is developed for instances when PHP phars you up by offering important solutions for the Phar archive. It enables the loading of a phar file into memory, allows for updates to each file's Unix timestamps within the PHAR for signature production in a reproducible manner. It also provides a linter to lint all PHP files inside a given phar with the current PHP version, and enables the saving of the updated phar file using an updated signature.
Usage of the "seld/phar-utils" package is straightforward. Firstly, you would need to install the package by running the command:
composer require seld/phar-utils
After the successful installation of the package, you can use it in your PHP script as follows:
To construct or load a phar file in memory:
$timestamps = new \Seld\PharUtils\Timestamps('sample.phar');
To update timestamps:
$timestamps->updateTimestamps();
To save the updated phar file with an updated signature, for example using Phar::SHA512
:
$timestamps->save('sample.phar', Phar::SHA512);
Also, you can lint all php files inside the sample.phar
using:
\Seld\PharUtils\Linter::lint('sample.phar');
The "seld/phar-utils" package has well-defined API documentation in the README.md file on the repository's GitHub page. It outlines the usage of each function and object in clear detail and provides a step-by-step guide on how to use the package effectively. This serves as the main source of documentation for any user wanting to make the most of the package.