Forrest logo
tool overview
On this page you find all important commands for the CLI tool phar. If the command you are looking for is missing please ask our AI.

phar

The Phar command line tool is a utility included in PHP since version 5.3.0, used to manage and manipulate PHP Archive (PHAR) files. PHAR is a file format used to package PHP applications or libraries into a single executable file. The Phar tool provides a variety of commands to create, extract, and archive PHAR files. It can also modify the contents of existing PHAR archives. With Phar, you can add files or directories to an archive, update or remove files, and even create an executable PHAR that can be run directly from the command line. Furthermore, Phar supports compression of files within archives, allowing for smaller file sizes and faster execution. The Phar tool can also be used to sign PHAR archives, providing additional security and verifying the authenticity of the archive contents. Overall, Phar is a powerful command line tool for managing PHP Archive files, making it easier to distribute and deploy PHP applications.

List of commands for phar:

  • phar:tldr:4a1c9 phar: Display the contents of a Phar file.
    $ phar list -f ${path-to-phar_file}
    try on your machine
    explain this command
  • phar:tldr:51143 phar: Sign a Phar file with an OpenSSL private key.
    $ phar sign -f ${path-to-phar_file} -h openssl -y ${path-to-private_key}
    try on your machine
    explain this command
  • phar:tldr:607c8 phar: Compress or uncompress files and directories in a Phar file.
    $ phar compress -f ${path-to-phar_file} -c ${algorithm}
    try on your machine
    explain this command
  • phar:tldr:955a3 phar: Delete the specified file or directory from a Phar file.
    $ phar delete -f ${path-to-phar_file} -e ${file_or_directory}
    try on your machine
    explain this command
  • phar:tldr:af0d0 phar: Get information about a Phar file.
    $ phar info -f ${path-to-phar_file}
    try on your machine
    explain this command
  • phar:tldr:b8fda phar: Add space-separated files or directories to a Phar file.
    $ phar add -f ${path-to-phar_file} ${files_or_directories}
    try on your machine
    explain this command
  • phar:tldr:bd556 phar: Display full usage information and available hashing/compression algorithms.
    $ phar help
    try on your machine
    explain this command
  • phar:tldr:f360d phar: Sign a Phar file with a specific hash algorithm.
    $ phar sign -f ${path-to-phar_file} -h ${algorithm}
    try on your machine
    explain this command
tool overview